【本文谢绝转载】
【===================先展示一下最后的效果=======================】
树莓派插入网卡,有供电,有TF卡。就可以了
打开终端:直接登录上去,可以看到,当有数据传输时,小灯闪爆你的钛合金眼
【=======================效果展示完毕===============】
开始干活!============================
为什么用300M带宽的无线网卡?
怎么为树莓派安装新的系统?
为什么是串口,而不是双绞线
怎么接线?
怎么安装串口驱动?
怎么设置终端
怎么登陆树莓派
要不要安装无线网卡驱动?
开始干活:扫描AP热点
两种连接无线网的方式!
显示连接的wifi状态
【2016淘宝热销树莓派无线网卡】
无线网卡 EDUP EP-N8508GS 芯片:RTL8188CUS 带宽150bps
【我手头上只有2012年前买的这个网卡】
无线网卡 水星MW300U 芯片:RTL8192CU 带宽300M
整个过程,没有拿RJ45双绞线。因为路由器距离我2米多远,懒得拿网线把树莓派接到路由器。
但是PC距离我很近,索性用串口干活,同时还避免了配置无线的时候有线网络带来的干扰,在Linux下干活的人会知道IP的绑定和内核有关系,具体IP在哪个网卡设备工作,是另外一回儿事儿。
写到内存卡:http://jaist.dl.sourceforge.net/project/win32diskimager/Archive/Win32DiskImager-0.9.5-install.exe
不做任何修改,上机,先不插入网卡。
串口线接好【图】
PC端串口驱动装好,我的USB转串口,芯片是CH340,
CH340驱动下载:http://www.stcmcu.com/STCISP/stc-isp-15xx-v6.85O.zip
解压打开目录:USB to UART Driver/CH340_CH341双击安装
插入CH340,在设备管理器会发现有了一个COM5
终端设置好,直接用串口干活 ,设置波特率:115200
开机信息输出:
Uncompressing Linux... done, booting the kernel. [ 0.000000] Booting Linux on physical CPU 0xf00 [ 0.000000] Initializing cgroup subsys cpuset [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Initializing cgroup subsys cpuacct [ 0.000000] Linux version 4.4.11-v7+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #888 SMP Mon May 23 20:10:33 BST 2016 [ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] Machine model: Raspberry Pi 2 Model B Rev 1.1 [ 0.000000] cma: Reserved 8 MiB at 0x36800000 [ 0.000000] Memory policy: Data cache writealloc [ 0.000000] [bcm2709_smp_init_cpus] enter (9520->f3003010) [ 0.000000] [bcm2709_smp_init_cpus] ncores=4 [ 0.000000] PERCPU: Embedded 13 pages/cpu @b5ff3000 s22592 r8192 d22464 u53248 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 223300 [ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa21041 bcm2709.serial=0xf4c5cc4 smsc95xx.macaddr=B8:27:EB:4C:5C:C4 bcm2708_fb.fbswap=1 bcm2709.uart_clock=3000000 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) [ 0.000000] Memory: 874128K/901120K available (6344K kernel code, 432K rwdata, 1712K rodata, 476K init, 764K bss, 18800K reserved, 8192K cma-reserved) [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB) [ 0.000000] vmalloc : 0xb7800000 - 0xff800000 (1152 MB) [ 0.000000] lowmem : 0x80000000 - 0xb7000000 ( 880 MB) [ 0.000000] modules : 0x7f000000 - 0x80000000 ( 16 MB) [ 0.000000] .text : 0x80008000 - 0x807e6420 (8058 kB) [ 0.000000] .init : 0x807e7000 - 0x8085e000 ( 476 kB) [ 0.000000] .data : 0x8085e000 - 0x808ca0c8 ( 433 kB) [ 0.000000] .bss : 0x808cd000 - 0x8098c1ac ( 765 kB) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] Hierarchical RCU implementation. [ 0.000000] Build-time adjustment of leaf fanout to 32. [ 0.000000] NR_IRQS:16 nr_irqs:16 16 [ 0.000000] Architected cp15 timer(s) running at 19.20MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns [ 0.000011] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns [ 0.000031] Switching to timer-based delay loop, resolution 52ns [ 0.000353] Console: colour dummy device 80x30 [ 0.001602] console [tty1] enabled [ 0.001654] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) [ 0.001732] pid_max: default: 32768 minimum: 301 [ 0.002149] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.002199] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.003417] Disabling cpuset control group subsystem [ 0.003499] Initializing cgroup subsys io [ 0.003559] Initializing cgroup subsys memory [ 0.003639] Initializing cgroup subsys devices [ 0.003691] Initializing cgroup subsys freezer [ 0.003742] Initializing cgroup subsys net_cls [ 0.003841] CPU: Testing write buffer coherency: ok [ 0.003952] ftrace: allocating 21205 entries in 63 pages [ 0.056251] CPU0: update cpu_capacity 1024 [ 0.056329] CPU0: thread -1, cpu 0, socket 15, mpidr 80000f00 [ 0.056367] [bcm2709_smp_prepare_cpus] enter [ 0.056521] Setting up static identity map for 0x8240 - 0x8274 [ 0.058900] [bcm2709_boot_secondary] cpu:1 started (0) 17 [ 0.059335] [bcm2709_secondary_init] enter cpu:1 [ 0.059396] CPU1: update cpu_capacity 1024 [ 0.059404] CPU1: thread -1, cpu 1, socket 15, mpidr 80000f01 [ 0.059977] [bcm2709_boot_secondary] cpu:2 started (0) 17 [ 0.060329] [bcm2709_secondary_init] enter cpu:2 [ 0.060360] CPU2: update cpu_capacity 1024 [ 0.060367] CPU2: thread -1, cpu 2, socket 15, mpidr 80000f02 [ 0.060915] [bcm2709_boot_secondary] cpu:3 started (0) 16 [ 0.061169] [bcm2709_secondary_init] enter cpu:3 [ 0.061200] CPU3: update cpu_capacity 1024 [ 0.061208] CPU3: thread -1, cpu 3, socket 15, mpidr 80000f03 [ 0.061293] Brought up 4 CPUs [ 0.061405] SMP: Total of 4 processors activated (153.60 BogoMIPS). [ 0.061438] CPU: All CPU(s) started in HYP mode. [ 0.061467] CPU: Virtualization extensions available. [ 0.062391] devtmpfs: initialized [ 0.074851] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5 [ 0.075352] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.076442] pinctrl core: initialized pinctrl subsystem [ 0.077261] NET: Registered protocol family 16 [ 0.083074] DMA: preallocated 4096 KiB pool for atomic coherent allocations [ 0.091266] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers. [ 0.091330] hw-breakpoint: maximum watchpoint size is 8 bytes. [ 0.091556] Serial: AMBA PL011 UART driver [ 0.091907] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2 [ 0.594608] console [ttyAMA0] enabled [ 0.598904] bcm2835-mbox 3f00b880.mailbox: mailbox enabled [ 0.676443] bcm2835-dma 3f007000.dma: DMA legacy API manager at f3007000, dmachans=0x1 [ 0.686523] SCSI subsystem initialized [ 0.690533] usbcore: registered new interface driver usbfs [ 0.696177] usbcore: registered new interface driver hub [ 0.701654] usbcore: registered new device driver usb [ 0.716826] raspberrypi-firmware soc:firmware: Attached to firmware from 2016-05-20 19:05 [ 0.752623] clocksource: Switched to clocksource arch_sys_counter [ 0.811814] FS-Cache: Loaded [ 0.815188] CacheFiles: Loaded [ 0.834716] NET: Registered protocol family 2 [ 0.840334] TCP established hash table entries: 8192 (order: 3, 32768 bytes) [ 0.847600] TCP bind hash table entries: 8192 (order: 4, 65536 bytes) [ 0.854268] TCP: Hash tables configured (established 8192 bind 8192) [ 0.860785] UDP hash table entries: 512 (order: 2, 16384 bytes) [ 0.866804] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes) [ 0.873530] NET: Registered protocol family 1 [ 0.878375] RPC: Registered named UNIX socket transport module. [ 0.884363] RPC: Registered udp transport module. [ 0.889083] RPC: Registered tcp transport module. [ 0.893819] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.901677] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available [ 0.911606] futex hash table entries: 1024 (order: 4, 65536 bytes) [ 0.933580] VFS: Disk quotas dquot_6.6.0 [ 0.937896] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 0.947749] FS-Cache: Netfs ‘nfs‘ registered for caching [ 0.954277] NFS: Registering the id_resolver key type [ 0.959404] Key type id_resolver registered [ 0.963636] Key type id_legacy registered [ 0.970770] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) [ 0.978432] io scheduler noop registered [ 0.982385] io scheduler deadline registered (default) [ 0.987641] io scheduler cfq registered [ 0.994464] BCM2708FB: allocated DMA memory f6c00000 [ 0.999485] BCM2708FB: allocated DMA channel 0 @ f3007000 [ 1.010750] Console: switching to colour frame buffer device 82x26 [ 1.965819] bcm2835-rng 3f104000.rng: hwrng registered [ 1.972804] vc-cma: Videocore CMA driver [ 1.978377] vc-cma: vc_cma_base = 0x00000000 [ 1.984763] vc-cma: vc_cma_size = 0x00000000 (0 MiB) [ 1.991743] vc-cma: vc_cma_initial = 0x00000000 (0 MiB) [ 1.998975] vc-mem: phys_addr:0x00000000 mem_base=0x3dc00000 mem_size:0x3f000000(1008 MiB) [ 2.030793] brd: module loaded [ 2.046589] loop: module loaded [ 2.052279] vchiq: vchiq_init_state: slot_zero = 0xb6c80000, is_master = 0 [ 2.062425] Loading iSCSI transport class v2.0-870. [ 2.069728] usbcore: registered new interface driver smsc95xx [ 2.077096] dwc_otg: version 3.00a 10-AUG-2012 (platform bus) [ 2.284749] Core Release: 2.80a [ 2.289329] Setting default values for core params [ 2.295641] Finished setting default values for core params [ 2.503152] Using Buffer DMA mode [ 2.507941] Periodic Transfer Interrupt Enhancement - disabled [ 2.515312] Multiprocessor Interrupt Enhancement - disabled [ 2.522435] OTG VER PARAM: 0, OTG VER FLAG: 0 [ 2.528348] Dedicated Tx FIFOs mode [ 2.533758] WARN::dwc_otg_hcd_init:1047: FIQ DMA bounce buffers: virt = 0xb6c14000 dma = 0xf6c14000 len=9024 [ 2.546785] FIQ FSM acceleration enabled for : [ 2.546785] Non-periodic Split Transactions [ 2.546785] Periodic Split Transactions [ 2.546785] High-Speed Isochronous Endpoints [ 2.546785] Interrupt/Control Split Transaction hack enabled [ 2.577172] WARN::hcd_init_fiq:413: FIQ on core 1 at 0x804464e4 [ 2.584729] WARN::hcd_init_fiq:414: FIQ ASM at 0x80446854 length 36 [ 2.592589] WARN::hcd_init_fiq:439: MPHI regs_base at 0xb787e000 [ 2.600213] dwc_otg 3f980000.usb: DWC OTG Controller [ 2.606788] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1 [ 2.615730] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000 [ 2.622911] Init: Port Power? op_state=1 [ 2.628359] Init: Power Port (0) [ 2.633371] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 2.641721] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 2.650518] usb usb1: Product: DWC OTG Controller [ 2.656767] usb usb1: Manufacturer: Linux 4.4.11-v7+ dwc_otg_hcd [ 2.664325] usb usb1: SerialNumber: 3f980000.usb [ 2.671477] hub 1-0:1.0: USB hub found [ 2.676784] hub 1-0:1.0: 1 port detected [ 2.683351] usbcore: registered new interface driver usb-storage [ 2.691179] mousedev: PS/2 mouse device common for all mice [ 2.699067] bcm2835-cpufreq: min=600000 max=900000 [ 2.705742] sdhci: Secure Digital Host Controller Interface driver [ 2.713478] sdhci: Copyright(c) Pierre Ossman [ 2.719721] sdhost: log_buf @ b6c13000 (f6c13000) [ 2.802674] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1) [ 2.810025] sdhci-pltfm: SDHCI platform and OF driver helper [ 2.838212] ledtrig-cpu: registered to indicate activity on CPUs [ 2.846032] hidraw: raw HID events driver (C) Jiri Kosina [ 2.853247] usbcore: registered new interface driver usbhid [ 2.860366] usbhid: USB HID core driver [ 2.866411] Initializing XFRM netlink socket [ 2.872284] NET: Registered protocol family 17 [ 2.876573] mmc0: command never completed. [ 2.876588] mmc0:>cmd op 5 arg 0x0 flags 0x2e1 - resp 00000000 00000000 00000000 00000000, err 0 [ 2.876593] mmc0: =========== REGISTER DUMP =========== [ 2.876598] mmc0: SDCMD 0x00004005 [ 2.876601] mmc0: SDARG 0x00000000 [ 2.876605] mmc0: SDTOUT 0x00030d40 [ 2.876610] mmc0: SDCDIV 0x0000026f [ 2.876614] mmc0: SDRSP0 0xffffffff [ 2.876618] mmc0: SDRSP1 0x0000ff7f [ 2.876622] mmc0: SDRSP2 0xc2000000 [ 2.876626] mmc0: SDRSP3 0xffffffff [ 2.876630] mmc0: SDHSTS 0x00000040 [ 2.876634] mmc0: SDVDD 0x00000001 [ 2.876638] mmc0: SDEDM 0x00010800 [ 2.876642] mmc0: SDHCFG 0x0000040a [ 2.876645] mmc0: SDHBCT 0x00000000 [ 2.876650] mmc0: SDHBLC 0x00000000 [ 2.876653] mmc0: =========================================== [ 2.922566] mmc0: host does not support reading read-only switch, assuming write-enable [ 2.941821] mmc0: new high speed SDHC card at address 0002 [ 2.942652] mmcblk0: mmc0:0002 00000 15.0 GiB [ 2.964681] mmcblk0: p1 p2 [ 3.001313] Indeed it is in host mode hprt0 = 00021501 [ 3.001389] Key type dns_resolver registered [ 3.001973] Registering SWP/SWPB emulation handler [ 3.003201] registered taskstats version 1 [ 3.003497] vc-sm: Videocore shared memory driver [ 3.003510] [vc_sm_connected_init]: start [ 3.007969] [vc_sm_connected_init]: end - returning 0 [ 3.008230] of_cfs_init [ 3.008361] of_cfs_init: OK [ 3.062950] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem [ 3.071598] EXT4-fs (mmcblk0p2): write access will be enabled during recovery [ 3.222684] usb 1-1: new high-speed USB device number 2 using dwc_otg [ 3.230759] Indeed it is in host mode hprt0 = 00001101 [ 3.442993] usb 1-1: New USB device found, idVendor=0424, idProduct=9514 [ 3.451304] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 3.461139] hub 1-1:1.0: USB hub found [ 3.466600] hub 1-1:1.0: 5 ports detected [ 3.752663] usb 1-1.1: new high-speed USB device number 3 using dwc_otg [ 3.872934] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00 [ 3.881356] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 3.893189] smsc95xx v1.0.4 [ 3.956650] smsc95xx 1-1.1:1.0 eth0: register ‘smsc95xx‘ at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:4c:5c:c4 [ 4.017707] EXT4-fs (mmcblk0p2): recovery complete [ 4.034877] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) [ 4.046372] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. [ 4.062671] usb 1-1.4: new high-speed USB device number 4 using dwc_otg [ 4.072303] devtmpfs: mounted [ 4.077952] Freeing unused kernel memory: 476K (807e7000 - 8085e000) [ 4.184281] usb 1-1.4: New USB device found, idVendor=0bda, idProduct=8178 [ 4.193187] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 4.202426] usb 1-1.4: Product: USB WLAN [ 4.208222] usb 1-1.4: Manufacturer: Realtek [ 4.214330] usb 1-1.4: SerialNumber: 00e04c000001 [ 4.489839] random: systemd urandom read with 67 bits of entropy available [ 4.504793] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR) [ 4.522435] systemd[1]: Detected architecture ‘arm‘. [ 4.693351] NET: Registered protocol family 10 [ 4.701649] systemd[1]: Inserted module ‘ipv6‘ [ 4.713047] systemd[1]: Set hostname to <raspberrypi>. [ 4.832839] uart-pl011 3f201000.uart: no DMA platform data [ 5.436553] systemd[1]: Expecting device dev-ttyAMA0.device... [ 5.446759] systemd[1]: Starting Forward Password Requests to Wall Directory Watch. [ 5.458127] systemd[1]: Started Forward Password Requests to Wall Directory Watch. [ 5.469295] systemd[1]: Starting Remote File Systems (Pre). [ 5.479009] systemd[1]: Reached target Remote File Systems (Pre). [ 5.487142] systemd[1]: Starting Encrypted Volumes. [ 5.496171] systemd[1]: Reached target Encrypted Volumes. [ 5.503578] systemd[1]: Starting Arbitrary Executable File Formats File System Automount Point. [ 5.518796] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point. [ 5.532196] systemd[1]: Starting Swap. [ 5.540324] systemd[1]: Reached target Swap. [ 5.546668] systemd[1]: Expecting device dev-mmcblk0p1.device... [ 5.556994] systemd[1]: Starting Root Slice. [ 5.565554] systemd[1]: Created slice Root Slice. [ 5.572143] systemd[1]: Starting User and Session Slice. [ 5.581682] systemd[1]: Created slice User and Session Slice. [ 5.589314] systemd[1]: Starting /dev/initctl Compatibility Named Pipe. [ 5.600129] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe. [ 5.609035] systemd[1]: Starting Delayed Shutdown Socket. [ 5.618650] systemd[1]: Listening on Delayed Shutdown Socket. [ 5.626292] systemd[1]: Starting Journal Socket (/dev/log). [ 5.635936] systemd[1]: Listening on Journal Socket (/dev/log). [ 5.643691] systemd[1]: Starting udev Control Socket. [ 5.652708] systemd[1]: Listening on udev Control Socket. [ 5.659928] systemd[1]: Starting udev Kernel Socket. [ 5.668827] systemd[1]: Listening on udev Kernel Socket. [ 5.675993] systemd[1]: Starting Journal Socket. [ 5.684650] systemd[1]: Listening on Journal Socket. [ 5.691489] systemd[1]: Starting System Slice. [ 5.699987] systemd[1]: Created slice System Slice. [ 5.706726] systemd[1]: Starting File System Check on Root Device... [ 5.743453] systemd[1]: Starting system-systemd\x2dfsck.slice. [ 5.754021] systemd[1]: Created slice system-systemd\x2dfsck.slice. [ 5.762287] systemd[1]: Starting system-getty.slice. [ 5.772192] systemd[1]: Created slice system-getty.slice. [ 5.779661] systemd[1]: Starting system-serial\x2dgetty.slice. [ 5.790188] systemd[1]: Created slice system-serial\x2dgetty.slice. [ 5.798612] systemd[1]: Starting Increase datagram queue length... [ 5.812400] systemd[1]: Starting Restore / save the current clock... [ 5.851955] systemd[1]: Started Set Up Additional Binary Formats. [ 5.860280] systemd[1]: Mounted Huge Pages File System. [ 5.867556] systemd[1]: Starting udev Coldplug all Devices... [ 5.882243] systemd[1]: Starting Create list of required static device nodes for the current kernel... [ 5.942417] systemd[1]: Starting Load Kernel Modules... [ 5.957127] systemd[1]: Mounting Debug File System... [ 5.970909] systemd[1]: Mounting POSIX Message Queue File System... [ 5.986769] systemd[1]: Starting Slices. [ 5.995404] systemd[1]: Reached target Slices. [ 6.008965] systemd[1]: Started Increase datagram queue length. [ 6.050456] systemd[1]: Started Create list of required static device nodes for the current kernel. [ 6.068875] systemd[1]: Started Load Kernel Modules. [ 6.081078] systemd[1]: Mounted Debug File System. [ 6.093861] systemd[1]: Mounted POSIX Message Queue File System. [ 6.108274] systemd[1]: Started Restore / save the current clock. [ 6.121160] systemd[1]: Started udev Coldplug all Devices. [ 6.144201] systemd[1]: Time has been changed [ 6.316552] systemd[1]: Starting Apply Kernel Variables... [ 6.374143] systemd[1]: Mounting Configuration File System... [ 6.388764] systemd[1]: Mounted FUSE Control File System. Raspbian GNU/Linux 8 raspberrypi ttyAMA0 raspberrypi login:
第一次登陆:
账户:pi
密码:raspberry
新的系统·罗列usb 状态
[email protected]:/home/pi# lsusb Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub [email protected]:/home/pi#
罗列系统mod状态
[email protected]:/home/pi# lsmod Module Size Used by cfg80211 427855 0 rfkill 16037 1 cfg80211 snd_bcm2835 20511 0 snd_pcm 75698 1 snd_bcm2835 snd_timer 19160 1 snd_pcm snd 51844 3 snd_bcm2835,snd_timer,snd_pcm bcm2835_gpiomem 3040 0 bcm2835_wdt 3225 0 uio_pdrv_genirq 3164 0 uio 8000 1 uio_pdrv_genirq ipv6 347530 26 [email protected]:/home/pi#
插上RTL8192cu芯片的usb网卡,不需要安装任何驱动,直接干活
罗列usb 状态
[email protected]:/home/pi# lsusb Bus 001 Device 004: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
罗列系统mod状态
[email protected]:/home/pi# lsmod Module Size Used by 8192cu 519156 0 cfg80211 427855 0 rfkill 16037 2 cfg80211 snd_bcm2835 20511 0 snd_pcm 75698 1 snd_bcm2835 snd_timer 19160 1 snd_pcm snd 51844 3 snd_bcm2835,snd_timer,snd_pcm bcm2835_gpiomem 3040 0 bcm2835_wdt 3225 0 uio_pdrv_genirq 3164 0 uio 8000 1 uio_pdrv_genirq ipv6 347530 26
扫描附近wifi状态
[email protected]:/home/pi# iwlist wlan0 scanning wlan0 Scan completed : Cell 01 - Address: D8:B0:4C:E0:A1:1B ESSID:"XEEDER4CE0A11A" Protocol:IEEE 802.11bgn Mode:Master Frequency:2.412 GHz (Channel 1) Encryption key:off Bit Rates:72 Mb/s Quality:47 Signal level:0 Noise level:0 Cell 02 - Address: D8:B0:4C:E0:9B:65 ESSID:"XEEDER4CE09B64" Protocol:IEEE 802.11bgn Mode:Master Frequency:2.412 GHz (Channel 1) Encryption key:off Bit Rates:72 Mb/s Quality:44 Signal level:0 Noise level:0
树莓派无线网卡上网方式1
使用DHCP方式联网,无线路由器的配置:3个条件 开启DHCP服务,有SSID,有密码,
配置树莓派的网络:
Linux_树莓派@http://990487026.blog.51cto.com:~# cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and ‘man dhcpcd.conf‘ # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d auto lo iface lo inet loopback iface eth0 inet manual auto wlan0 allow-hotplug wlan0 #表示wlan设备可以热插拨 iface wlan0 inet dhcp wpa-ssid haha_ssid wpa-psk haha_password Linux_树莓派@http://990487026.blog.51cto.com:~#
重启网卡设备,并测试
Linux_树莓派@http://990487026.blog.51cto.com:~# ifdown wlan0 && ifup wlan0 测试 Linux_树莓派@http://990487026.blog.51cto.com:~# ping www.jd.com PING www.jdcdn.com (61.174.55.1) 56(84) bytes of data. 64 bytes from 1.55.174.61.dial.wz.zj.dynamic.163data.com.cn (61.174.55.1): icmp_seq=1 ttl=55 time=12.4 ms 64 bytes from 1.55.174.61.dial.wz.zj.dynamic.163data.com.cn (61.174.55.1): icmp_seq=2 ttl=55 time=11.6 ms 64 bytes from 1.55.174.61.dial.wz.zj.dynamic.163data.com.cn (61.174.55.1): icmp_seq=3 ttl=55 time=14.8 ms 64 bytes from 1.55.174.61.dial.wz.zj.dynamic.163data.com.cn (61.174.55.1): icmp_seq=4 ttl=55 time=12.7 ms ^C --- www.jdcdn.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 11.644/12.919/14.804/1.166 ms Linux_树莓派@http://990487026.blog.51cto.com:~#
树莓派无线网卡上网方式2
使用static方式联网,无线路由器的配置:3个条件 关闭DHCP服务,有SSID,有密码,
Linux_树莓派@http://990487026.blog.51cto.com:~# cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and ‘man dhcpcd.conf‘ # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d auto lo iface lo inet loopback iface eth0 inet manual auto wlan0 allow-hotplug wlan0 #表示wlan设备可以热插拨 iface wlan0 inet static wpa-ssid xiaomiAP wpa-psk apple2016 address 10.11.12.103 netmask 255.255.255.0 gateway 10.11.12.13 dns-nameservers 180.76.76.76 223.5.5.5 Linux_树莓派@http://990487026.blog.51cto.com:~#
配置好了,必须重启一下。ifdown wlan0 && ifup wlan0这条命令不管用
【重启】
Linux_树莓派@http://990487026.blog.51cto.com:~# reboot 登陆树莓派,测试 Linux_树莓派@http://990487026.blog.51cto.com:~# ping www.taobao.com PING www.taobao.com.danuoyi.tbcache.com (183.136.138.188) 56(84) bytes of data. 64 bytes from 183.136.138.188: icmp_seq=1 ttl=50 time=17.0 ms 64 bytes from 183.136.138.188: icmp_seq=2 ttl=50 time=15.7 ms 64 bytes from 183.136.138.188: icmp_seq=3 ttl=50 time=22.4 ms 64 bytes from 183.136.138.188: icmp_seq=4 ttl=50 time=18.0 ms ^C --- www.taobao.com.danuoyi.tbcache.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 15.793/18.315/22.412/2.499 ms Linux_树莓派@http://990487026.blog.51cto.com:~#
查看wifi网络状态:
Linux_树莓派@http://990487026.blog.51cto.com:~# iwconfig wlan0 wlan0 IEEE 802.11bgn ESSID:"xiaomiAP" Nickname:"<[email protected]>" Mode:Managed Frequency:2.427 GHz Access Point: 5C:63:BF:BA:67:3E Bit Rate:300 Mb/s Sensitivity:0/0 Retry:off RTS thr:off Fragment thr:off Encryption key:****-****-****-****-****-****-****-**** Security mode:open Power Management:off Link Quality=100/100 Signal level=93/100 Noise level=0/100 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 Linux_树莓派@http://990487026.blog.51cto.com:~#
恭喜你!
现在可以在linux下面干活了!