ap6181调通SSH和SCP+ap6212a0_r16_tinav2.1.7z
文件大小: 545k
源码售价: 10 个金币 积分规则     积分充值
资源说明:全志R16的tinav2.1下调通AP6181的步骤.txt 思路:由于tinav2.1的SDK在全志R16的开发板SC3817上是可以使用AP6212A0的WIFI功能的。 由此证明:SC3817的开发板的WIFI的硬件部分正常。我拿到的tinav2.1的SDK正常。 由于在驱动lichee中,WIFI通过读取ID号自动加载固件的。 因此只需要把AP6181A2的固件放到AP6212的目录下,并适当修改配置文件/做出相应的修改。 就可以让tinav2.1在上电启动的时候,通过自动识别AP6181A2来加载其固件了。 1、使用AP6212原厂/代理商提供的固件在android4.4.2 parrotv1.1下调通AP6181: (如果没有这个文件,可以生成WLAN0节点,但是不能连网) R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\firmware\ap6212\config.txt (这个文件没用) R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\firmware\ap6212\device-bcm.mk R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\firmware\ap6212\fw_bcm40181a2.bin R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\firmware\ap6212\fw_bcm40181a2_apsta.bin R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\firmware\ap6212\fw_bcm40181a2_p2p.bin R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\firmware\ap6212\nvram_ap6181.txt 2、 R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\firmware\linux-firmware\broadcom.mk Package/ap6212-firmware = $(call Package/firmware-default,Broadcom AP6212 firmware) define Package/ap6212-firmware/install $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) \ $(TOPDIR)/package/firmware/ap6212/*.bin \ $(1)/lib/firmware/ $(INSTALL_DATA) \ $(TOPDIR)/package/firmware/ap6212/*.hcd \ $(1)/lib/firmware/ $(INSTALL_DATA) \ $(TOPDIR)/package/firmware/ap6212/nvram_ap6212.txt \ $(1)/lib/firmware/nvram.txt endef $(eval $(call BuildPackage,ap6212-firmware)) 修改为: Package/ap6212-firmware = $(call Package/firmware-default,Broadcom AP6212 firmware) define Package/ap6212-firmware/install $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) \ $(TOPDIR)/package/firmware/ap6212/*.bin \ $(1)/lib/firmware/ $(INSTALL_DATA) \ $(TOPDIR)/package/firmware/ap6212/*.hcd \ $(1)/lib/firmware/ $(INSTALL_DATA) \ $(TOPDIR)/package/firmware/ap6212/nvram_ap6181.txt \ $(1)/lib/firmware/nvram.txt $(INSTALL_DATA) \ $(TOPDIR)/package/firmware/ap6212/config.txt \ $(1)/lib/firmware/config.txt endef $(eval $(call BuildPackage,ap6212-firmware)) 3、 R:\wyb\ap6181+ap6212a0_r16_tinav2.1\target\allwinner\astar-parrot\configs\sys_config.fex [wakeup_src_para] cpu_en = 0 cpu_freq = 48 ; (cpu:apb:ahb) pll_ratio = 0x111 dram_selfresh_en= 1 dram_freq = 36 wakeup_src_wl = port:PL07<4><0> wakeup_src_bt = port:PL09<4><0> bb_wake_ap = port:PL02<4><0> 修改为: [wakeup_src_para] cpu_en = 0 cpu_freq = 48 ; (cpu:apb:ahb) pll_ratio = 0x111 dram_selfresh_en= 1 dram_freq = 36 ;wakeup_src_wl = port:PL07<4><0> wakeup_src_wl = port:PG09<4><0> ;wakeup_src_bt = port:PL09<4><0> bb_wake_ap = port:PL02<4><0> [rf_para] module_num = 10 module_power1 = "axp22_dldo1" module_power1_vol = 3300000 module_power2 = "axp22_dldo2" module_power2_vol = 3300000 module_power3 = "axp22_aldo1" module_power3_vol = 3300000 power_switch = chip_en = lpo_use_apclk = "losc_out" 修改为: [rf_para] module_num = 1 module_power1 = "axp22_dldo1" module_power1_vol = 3300000 module_power2 = "axp22_dldo2" module_power2_vol = 3300000 module_power3 = "axp22_aldo1" module_power3_vol = 3300000 power_switch = chip_en = lpo_use_apclk = "losc_out" [wifi_para] wifi_used = 1 wifi_sdc_id = 1 wifi_usbc_id = 1 wifi_usbc_type = 1 wl_reg_on = port:PL06<1><0> wl_host_wake = port:PL07<4><0> 修改为: [wifi_para] wifi_used = 1 wifi_sdc_id = 1 wifi_usbc_id = 1 wifi_usbc_type = 1 ;wl_reg_on = port:PL06<1><0> ;wl_host_wake = port:PL07<4><0> wl_reg_on = port:PG06<1><0> wl_host_wake = port:PG09<4><0> wl_host_wake_invert = 0 AP6181没有蓝牙功能,直接关闭。 [bt_para] bt_used = 0 ;bt_uart_id = 1 ;bt_rst_n = port:PL08<1><0> ;bt_wake = port:PL10<1><0> ;bt_host_wake = port:PL09<4><0> ;bt_host_wake_invert = 0 4、编译系统: rootroot@rootroot-E400:~/wyb/ap6181+ap6212a0_r16_tinav2.1$ source build/envsetup.sh including target/allwinner/tulip-d1/vendorsetup.sh including target/allwinner/azalea-evb/vendorsetup.sh including target/allwinner/octopus-sch/vendorsetup.sh including target/allwinner/astar-evb/vendorsetup.sh including target/allwinner/azalea-perf3/vendorsetup.sh including target/allwinner/azalea-perf2/vendorsetup.sh including target/allwinner/azalea-perf1/vendorsetup.sh including target/allwinner/astar-spk/vendorsetup.sh including target/allwinner/generic/vendorsetup.sh including target/allwinner/astar-parrot/vendorsetup.sh including target/allwinner/octopus-dev/vendorsetup.sh rootroot@rootroot-E400:~/wyb/ap6181+ap6212a0_r16_tinav2.1$ lunch You're building on Linux Lunch menu... pick a combo: 1. tulip_d1-tina 2. tulip_d1-dragonboard 3. azalea_evb-tina 4. azalea_evb-dragonboard 5. octopus_sch-tina 6. octopus_sch-dragonboard 7. astar_evb-tina 8. azalea_perf3-tina 9. azalea_perf3-dragonboard 10. azalea_perf2-tina 11. azalea_perf2-dragonboard 12. azalea_perf1-tina 13. azalea_perf1-dragonboard 14. astar_spk-tina 15. astar_spk-dragonboard 16. astar_parrot-tina 17. astar_parrot-dragonboard 18. octopus_dev-tina 19. octopus_dev-dragonboard Which would you like?16 ============================================ PLATFORM_VERSION_CODENAME=Neptune PLATFORM_VERSION=2.0.0 TARGET_PRODUCT=astar_parrot TARGET_BUILD_VARIANT=tina TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a-neon TARGET_CPU_VARIANT=cortex-a7 TARGET_2ND_ARCH= TARGET_2ND_ARCH_VARIANT= TARGET_2ND_CPU_VARIANT= HOST_ARCH=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty HOST_BUILD_TYPE=release BUILD_ID=57513AA3 OUT_DIR= ============================================ rootroot@rootroot-E400:~/wyb/ap6181+ap6212a0_r16_tinav2.1$ make -j8 rootroot@rootroot-E400:~/wyb/ap6181+ap6212a0_r16_tinav2.1$ pack -d 5、打开WIFI连接的应用程序: Tina wifimanager API_V2.0.pdf WIFI管理的API接口文档 rootroot@rootroot-E400:~/wyb/ap6181+ap6212a0_r16_tinav2.1$ make menuconfig Allwinner ---> -*- wifimanager............................................ Tina wifi manager ---> --- wifimanager............................................ Tina wifi manager (选中) <*> wifimanager-demo...................................... Tina wifi app demo R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\allwinner\wifimanager\demo\wifi_on_off_test.c R:\wyb\ap6181+ap6212a0_r16_tinav2.1\package\allwinner\wifimanager\demo\wifi_connect_ap.cpp 编译之后,R16的TINAV2.1的系统的/bin中会有: root@TinaLinux:/bin# ll w* lrwxrwxrwx 1 root root 13 Oct 19 14:22 wget -> uclient-fetch -rwxr-xr-x 1 root root 4102 Oct 19 14:12 wifi_connect_ap_test -rwxr-xr-x 1 root root 4102 Oct 19 14:12 wifi_on_off_test root@TinaLinux:/bin# /* *argc[1] ap ssid *argc[2] ap passwd */ int main(int argv, char *argc[]){ wifi_connect_ap.cpp的main函数嵌可以看见第一个参数为SSID,第二参数为密码,中间用空格隔开即可。 WIFI连接之前: root@TinaLinux:/# ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:20 errors:0 dropped:0 overruns:0 frame:0 TX packets:20 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1572 (1.5 KiB) TX bytes:1572 (1.5 KiB) wlan0 Link encap:Ethernet HWaddr 94:A1:A2:C4:E3:12 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) root@TinaLinux:/# WIFI连接: root@TinaLinux:/bin# root@TinaLinux:/bin# ./wifi_connect_ap_test citybrand-2 citybrand200903 ********************************* ***Start wifi connect ap test!*** ********************************* event_label 0x0 WiFi on success! do cmd LIST_NETWORKS call event 0xf004 do cmd SCAN event_label 0x0 It has no wifi auto connect when wifi on! aw wifi connect state 0xf0 enter get_key_mgmt, ssid citybrand-2 scan stauts 1 do cmd SCAN_RESULTS ssid citybrand-2, flag [WPA2-PSK-CCMP][ESS] do cmd LIST_NETWORKS do cmd ADD_NETWORK do cmd SET_NETWORK 0 ssid "citybrand-2" do cmd SET_NETWORK 0 key_mgmt WPA-PSK do cmd SET_NETWORK 0 psk "citybrand200903" do cmd LIST_NETWORKS do cmd GET_NETWORK 0 priority do cmd SET_NETWORK 0 priority 1 do cmd SELECT_NETWORK 0 do cmd RECONNECT do cmd LIST_NETWORKS connecting id 0, connected id 0 Unknown HZ value! (-1) Assume 1241 ttyS0 15049-12:58:15 udhcpc_wlan0 Command failed: Not found Unknown HZ value! (-1) Assume 1241 ttyS0 15049-12:58:15 udhcpc_wlan0 do cmd SAVE_CONFIG do cmd LIST_NETWORKS do cmd ENABLE_NETWORK 0 do cmd SAVE_CONFIG wifi state busing,waiting vflag= 4 call event 0xf00b event_label 0x1 WiFi connected ap! ****************************** Wifi connect ap test: Success! ****************************** root@TinaLinux:/bin# root@TinaLinux:/bin# root@TinaLinux:/bin# ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:40 errors:0 dropped:0 overruns:0 frame:0 TX packets:40 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3116 (3.0 KiB) TX bytes:3116 (3.0 KiB) wlan0 Link encap:Ethernet HWaddr 94:A1:A2:C4:E3:12 inet addr:192.168.0.167 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:34 errors:0 dropped:0 overruns:0 frame:0 TX packets:25 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3084 (3.0 KiB) TX bytes:2516 (2.4 KiB) root@TinaLinux:/bin# root@TinaLinux:/bin# 6、R16的TINAV2.0平台的SSH连接 rootroot@rootroot-E400:~/wyb/ap6181+ap6212a0_r16_tinav2.1$ make menuconfig Base system ---> (选中这里) <*> dropbear........................................ Small SSH2 client/server Configuration ---> [*] Curve25519 support (NEW) (这里不用选中) [ ] Elliptic curve cryptography (ECC) (NEW) 7、再次编译系统打包刷机之后以SCP方式远程登陆R16的tinav2.1: rootroot@cm-System-Product-Name:/home/wwt/parrot_r16_tinav2.0$ make -j12 rootroot@cm-System-Product-Name:/home/wwt/parrot_r16_tinav2.0$ pack -d 在串口终端中输入(必须设置root用户的密码): root@TinaLinux:/bin# root@TinaLinux:/bin# passwd Changing password for root New password: Bad password: too short Retype password: Password for root changed by root root@TinaLinux:/bin# root@TinaLinux:/bin# SSH连接工具使用:WinSCP_5.9.0.6786_Setup.exe 文件协议选择:SCP 主机名:192.168.0.167(根据你的R16的实际IP修改) 端口号:22 用户名:root 密码:root 点击 登陆 即可。 如果重新刷机,IP地址不变,但是RSA密码改变,选择 更新 即可。 8、在ubuntu14.04中文版下通过SSH访问R16的tinav2.1: (注意刚登陆的地方是空的根目录) rootroot@rootroot-E400:~/wyb/ap6181+ap6212a0_r16_tinav2.1$ rootroot@rootroot-E400:~/wyb/ap6181+ap6212a0_r16_tinav2.1$ ssh root@192.168.0.108 root@192.168.0.108's password: BusyBox v1.24.1 () built-in shell (ash) _____ _ __ _ |_ _||_| ___ _ _ | | |_| ___ _ _ _ _ | | _ | || | | |__ | || || | ||_'_| | | | || | || _ | |_____||_||_|_||___||_,_| |_| |_||_|_||_|_| Tina is Based on OpenWrt! ---------------------------------------------- Tina Linux (Neptune, 57513AA3) ---------------------------------------------- root@TinaLinux:~# ll drwxr-xr-x 2 root root 3 Dec 22 20:11 . drwxr-xr-x 1 root root 1024 Dec 23 2016 .. root@TinaLinux:~# pwd /root root@TinaLinux:~# cd / root@TinaLinux:/# ll drwxr-xr-x 1 root root 1024 Dec 23 2016 . drwxr-xr-x 1 root root 1024 Dec 23 2016 .. drwxr-xr-x 2 root root 984 Dec 22 20:11 bin drwxrwxrwx 2 root root 16384 Jan 1 1970 boot drwxrwxrwx 2 root root 8192 Jan 1 1970 boot-res -rw-r--r-- 1 root root 441 Dec 23 2016 bt_config.xml drwxr-xr-x 9 root root 2900 Dec 23 2016 dev drwxr-xr-x 1 root root 1024 Dec 23 11:33 etc drwxr-xr-x 10 root root 661 Dec 22 19:38 lib drwx------ 2 root root 12288 Dec 23 2016 lost+found drwxr-xr-x 1 root root 1024 Dec 23 2016 mnt drwxr-xr-x 7 root root 1024 Dec 23 2016 overlay dr-xr-xr-x 88 root root 0 Jan 1 1970 proc drwxr-xr-x 16 root root 211 Dec 22 20:11 rom drwxr-xr-x 2 root root 3 Dec 22 20:11 root drwxr-xr-x 2 root root 689 Dec 22 20:11 sbin dr-xr-xr-x 12 root root 0 Dec 23 2016 sys drwxrwxrwt 9 root root 300 Dec 23 2016 tmp drwxr-xr-x 7 root root 101 Dec 22 19:50 usr lrwxrwxrwx 1 root root 4 Dec 22 20:11 var -> /tmp drwxr-xr-x 2 root root 3 Dec 22 20:11 www root@TinaLinux:/#
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。