当前位置:网站首页>全志V3s学习记录--ESP8089的使用
全志V3s学习记录--ESP8089的使用
2022-06-09 06:06:00 【liefyuan】
文章目录
总结:主线Linux目前没有可用的解决方法,就算加载成功并连接成功后,过一段时间也会奔溃,目前无解,需要避开这个大坑!!!
一、构建一些Networking相关的工具
- wpa_supplicant:
- hostapd:
- dhcpc:
buildroot构建文件系统:


wpa_supplicant 需要 Openssl 支持
> Target packages
----> Libraries
----> Crypto
----> [*] openssl
----> [*] openssl binary
----> [*] openssl additional engines

二、STA模式–连接WiFi

如上:WiFi模块的复位引脚是PB4,GPIO就是43
2.1 加载模块
insmod /lib/modules/esp8089.ko config=crystal_26M_en=1 esp_reset_gpio=43
# insmod /lib/modules/esp8089.ko config=crystal_26M_en=1 esp_reset_gpio=43
[ 47.055824] esp8089: unknown parameter 'config' ignored
[ 47.061635]
[ 47.061635] ***** EAGLE DRIVER VER:bdf5087c3deb*****
[ 47.061635]
[ 47.069704] ESP8089 reset via GPIO 43
[ 47.289314] esp_sdio_dummy_probe enter
[ 47.509006] esp_sdio_init power up OK
[ 47.976313] esp_host:bdf5087c3deb
[ 47.976313] esp_target: e826c2b3c9fd 57 18202
[ 47.976313]
[ 47.985659] esp_readwrite_file: file /system/lib/modules/test_results filp_open error
[ 47.994634] first normal exit
[ 47.997870] esp_sdio_remove enter
[ 48.002734] sif_disable_irq release irq failed
[ 48.119286] eagle_sdio: probe of mmc1:0001:1 failed with error -110
# [ 48.169593] mmc1: card 0001 removed
[ 48.223706] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 48.236381] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 48.245281] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 48.252668] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[ 48.258200] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[ 48.264257] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[ 48.269900] mmc1: new high speed SDIO card at address 0001
[ 48.633821] esp_host:bdf5087c3deb
[ 48.633821] esp_target: e826c2b3c9fd 57 18202
[ 48.633821]
[ 48.723697] esp_op_add_interface STA
2.2 打开wlan0
# ifconfig wlan0 up
# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:64 errors:0 dropped:0 overruns:0 frame:0
TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4736 (4.6 KiB) TX bytes:4736 (4.6 KiB)
wlan0 Link encap:Ethernet HWaddr AC:D0:74:C1:26:99
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)
2.3 连接WiFi(wpa_supplicant)
第一步:编辑vi /etc/network/interfaces文件
# Configure Loopback
auto lo
iface lo inet loopback
# wlan0
auto wlan0
iface wlan0 inet dhcp
wpa_supplicant连接WIFI的时候会从配置文件中读取账号和密码,以及加密方式等, 所以我们再运行wpa_supplicant工具的时候要提前写好配置文件。
第二步:编辑配置文件:vi /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1
network={
ssid="liefyuan"
scan_ssid=1
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
pairwise=TKIP CCMP
group=CCMP TKIP WEP104 WEP40
psk="1234567890"
priority=5
}
第三步:创建一个socket通信的目录
mkdir -p /var/run/wpa_supplicant
第四步:运行命令连接WiFi
# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
第五步:配置DHCP,获取IP地址
# udhcpc -i wlan0
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.1.109
udhcpc: lease of 192.168.1.109 obtained, lease time 7200
deleting routers
adding dns 202.96.134.33
adding dns 202.96.128.68
第六步:检查网络状况
# wpa_cli -iwlan0 status
bssid=c8:e7:d8:34:27:84
freq=2437
ssid=MERCURY_2784
id=0
mode=station
wifi_generation=4
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.1.109
p2p_device_address=ac:d0:74:c1:26:99
address=ac:d0:74:c1:26:99
uuid=29899bfe-dde5-5afd-9f9f-0797878b0d93
第七步:ping功能测试
# ping www.baidu.com
PING www.baidu.com (14.215.177.39): 56 data bytes
64 bytes from 14.215.177.39: seq=0 ttl=56 time=28.294 ms
64 bytes from 14.215.177.39: seq=1 ttl=56 time=19.842 ms
64 bytes from 14.215.177.39: seq=2 ttl=56 time=16.529 ms
64 bytes from 14.215.177.39: seq=3 ttl=56 time=19.067 ms
64 bytes from 14.215.177.39: seq=4 ttl=56 time=31.391 ms
64 bytes from 14.215.177.39: seq=5 ttl=56 time=15.985 ms
64 bytes from 14.215.177.39: seq=6 ttl=56 time=15.033 ms
64 bytes from 14.215.177.39: seq=7 ttl=56 time=16.011 ms
64 bytes from 14.215.177.39: seq=8 ttl=56 time=14.188 ms
64 bytes from 14.215.177.39: seq=9 ttl=56 time=15.148 ms
64 bytes from 14.215.177.39: seq=10 ttl=56 time=15.779 ms
64 bytes from 14.215.177.39: seq=11 ttl=56 time=13.834 ms
64 bytes from 14.215.177.39: seq=12 ttl=56 time=12.730 ms
64 bytes from 14.215.177.39: seq=13 ttl=56 time=16.115 ms
64 bytes from 14.215.177.39: seq=14 ttl=56 time=9.792 ms
64 bytes from 14.215.177.39: seq=15 ttl=56 time=12.465 ms
^C
--- www.baidu.com ping statistics ---
16 packets transmitted, 16 packets received, 0% packet loss
round-trip min/avg/max = 9.792/17.012/31.391 ms
如果复位了:https://whycan.com/t_4326.html
十多分钟后还是崩溃了!无语了!
[ 412.649394] esp_sdio_remove enter
[ 412.653926] sif_disable_irq release irq failed
[ 412.658381] ------------[ cut here ]------------
[ 412.663119] WARNING: CPU: 0 PID: 72 at kernel/workqueue.c:3031 __flush_work+0x184/0x1ac
[ 412.671150] Modules linked in: esp8089
[ 412.674910] CPU: 0 PID: 72 Comm: kworker/0:2 Not tainted 5.2.0-licheepi-zero #3
[ 412.682206] Hardware name: Allwinner sun8i Family
[ 412.686917] Workqueue: events_freezable mmc_rescan
[ 412.691728] [<c010ec34>] (unwind_backtrace) from [<c010b6cc>] (show_stack+0x10/0x14)
[ 412.699473] [<c010b6cc>] (show_stack) from [<c0715720>] (dump_stack+0x94/0xa8)
[ 412.706693] [<c0715720>] (dump_stack) from [<c011d984>] (__warn+0xfc/0x114)
[ 412.713649] [<c011d984>] (__warn) from [<c011dab0>] (warn_slowpath_null+0x40/0x48)
[ 412.721212] [<c011dab0>] (warn_slowpath_null) from [<c0133eec>] (__flush_work+0x184/0x1ac)
[ 412.729472] [<c0133eec>] (__flush_work) from [<c0136fc8>] (__cancel_work_timer+0x110/0x1ec)
[ 412.737850] [<c0136fc8>] (__cancel_work_timer) from [<bf004168>] (sip_detach+0xe8/0x1bc [esp8089])
[ 412.746827] [<bf004168>] (sip_detach [esp8089]) from [<bf000fe0>] (esp_sdio_remove+0x60/0x1ac [esp8089])
[ 412.756316] [<bf000fe0>] (esp_sdio_remove [esp8089]) from [<c0539780>] (sdio_bus_remove+0x30/0xf8)
[ 412.765274] [<c0539780>] (sdio_bus_remove) from [<c04330b4>] (device_release_driver_internal+0xdc/0x1a0)
[ 412.774748] [<c04330b4>] (device_release_driver_internal) from [<c0431bec>] (bus_remove_device+0xcc/0xf8)
[ 412.784308] [<c0431bec>] (bus_remove_device) from [<c042e2a0>] (device_del+0x13c/0x324)
[ 412.792308] [<c042e2a0>] (device_del) from [<c0539c08>] (sdio_remove_func+0x1c/0x28)
[ 412.800045] [<c0539c08>] (sdio_remove_func) from [<c0537a34>] (mmc_sdio_remove+0x40/0x70)
[ 412.808216] [<c0537a34>] (mmc_sdio_remove) from [<c0537c44>] (mmc_sdio_detect+0x6c/0xf8)
[ 412.816299] [<c0537c44>] (mmc_sdio_detect) from [<c052fe30>] (mmc_rescan+0x1bc/0x38c)
[ 412.824124] [<c052fe30>] (mmc_rescan) from [<c0135e64>] (process_one_work+0x150/0x358)
[ 412.832034] [<c0135e64>] (process_one_work) from [<c0136098>] (worker_thread+0x2c/0x518)
[ 412.840121] [<c0136098>] (worker_thread) from [<c013b854>] (kthread+0x120/0x150)
[ 412.847513] [<c013b854>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 412.854723] Exception stack(0xc3ba5fb0 to 0xc3ba5ff8)
[ 412.859770] 5fa0: 00000000 00000000 00000000 00000000
[ 412.867937] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 412.876103] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 412.882795] ---[ end trace 3facca9bc593b142 ]---
[ 412.887457] wlan0: deauthenticating from c8:e7:d8:34:27:84 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 412.990409] mmc1: card 0001 removed
[ 413.047521] sdio_read_cis: 2 callbacks suppressed
[ 413.047534] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[ 413.071318] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[ 413.084716] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[ 413.095915] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[ 413.110722] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[ 413.119887] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[ 413.132454] mmc1: new high speed SDIO card at address 0001
[ 413.152429] 8<--- cut here ---
[ 413.155554] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[ 413.163791] pgd = 7a215147
[ 413.166501] [00000004] *pgd=00000000
[ 413.170112] Internal error: Oops: 17 [#1] SMP ARM
[ 413.174810] Modules linked in: esp8089
[ 413.178565] CPU: 0 PID: 72 Comm: kworker/0:2 Tainted: G W 5.2.0-licheepi-zero #3
[ 413.187247] Hardware name: Allwinner sun8i Family
[ 413.191961] Workqueue: events_freezable mmc_rescan
[ 413.196783] PC is at esp_sdio_probe+0x48/0x3e4 [esp8089]
[ 413.202094] LR is at sdio_bus_probe+0xfc/0x114
[ 413.206531] pc : [<bf001174>] lr : [<c0539944>] psr: 20070013
[ 413.212787] sp : c3ba5d98 ip : 29aaaaab fp : c0b04c48
[ 413.218003] r10: 0000000e r9 : bf00a188 r8 : bf00a188
[ 413.223220] r7 : c3356200 r6 : bf00d080 r5 : bf039784 r4 : 00000000
[ 413.229736] r3 : c3356208 r2 : 00000003 r1 : 00000000 r0 : c3356200
[ 413.236255] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 413.243379] Control: 10c5387d Table: 4335c06a DAC: 00000051
[ 413.249118] Process kworker/0:2 (pid: 72, stack limit = 0x2bb573d3)
[ 413.255377] Stack: (0xc3ba5d98 to 0xc3ba6000)
[ 413.259731] 5d80: bf00d0e8 0000000e
[ 413.267899] 5da0: c0b04c48 c3356208 00000000 c3356200 bf00d0e8 bf00a188 bf00d0e8 c0539944
[ 413.276067] 5dc0: c0b838c8 c3356208 00000000 c0b838cc 00000001 c04329b4 c3356208 bf00d0e8
[ 413.284235] 5de0: c0432e1c c0b04c48 00000001 00000000 00000001 c0432c34 c0b41240 00000000
[ 413.292402] 5e00: 00000000 c0b87250 bf00d0e8 c3ba5e64 c3356208 00000000 c3ba5e64 c0432e1c
[ 413.300570] 5e20: c0b04c48 00000001 00000000 00000001 c0b04c48 c0430cc8 00000001 c39a0c6c
[ 413.308738] 5e40: c31dd9b8 3e4fcf47 c3356208 c3356208 c0b04c48 c335624c c3299008 c0432764
[ 413.316906] 5e60: 00000cc0 c3356208 00000001 3e4fcf47 c3356208 c3356208 c0b3b860 c3299008
[ 413.325074] 5e80: 00000000 c0431b18 c3356208 00000000 c0b04c48 c042f5cc c3356200 c3b91000
[ 413.333242] 5ea0: 00000001 c052f164 c3299004 3e4fcf47 c3ba5ec8 c3356200 c3356208 c3299004
[ 413.341410] 5ec0: c3b91000 c3299398 c3299000 c0539bd8 00000000 00000001 c3299004 c0538f40
[ 413.349577] 5ee0: 00000000 c3ba5ef7 00000000 00000000 00000000 00000000 10ffff00 3e4fcf47
[ 413.357745] 5f00: ffffff92 c3b9128c 00061a80 c3b91000 c086bfc0 c086bfcc c3b91290 00000000
[ 413.365913] 5f20: c3dee880 c052ff78 c3b9b580 c3b9128c c3dee880 c3df1c00 00000000 c0135e64
[ 413.374081] 5f40: c3dee898 c0b03d00 c3b9b580 c3dee880 c3b9b594 c3dee898 c0b03d00 c3ba4000
[ 413.382249] 5f60: 00000008 c0136098 00000000 c3b9c180 c3b9c100 00000000 c3b9b580 c013606c
[ 413.390417] 5f80: c3b9c19c c3845ebc 00000000 c013b854 c3b9c100 c013b734 00000000 00000000
[ 413.398584] 5fa0: 00000000 00000000 00000000 c01010e8 00000000 00000000 00000000 00000000
[ 413.406751] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 413.414918] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 413.423114] [<bf001174>] (esp_sdio_probe [esp8089]) from [<c0539944>] (sdio_bus_probe+0xfc/0x114)
[ 413.431988] [<c0539944>] (sdio_bus_probe) from [<c04329b4>] (really_probe+0x1dc/0x2e0)
[ 413.439904] [<c04329b4>] (really_probe) from [<c0432c34>] (driver_probe_device+0x60/0x1a0)
[ 413.448162] [<c0432c34>] (driver_probe_device) from [<c0430cc8>] (bus_for_each_drv+0x74/0xb8)
[ 413.456681] [<c0430cc8>] (bus_for_each_drv) from [<c0432764>] (__device_attach+0xd0/0x13c)
[ 413.464939] [<c0432764>] (__device_attach) from [<c0431b18>] (bus_probe_device+0x84/0x8c)
[ 413.473111] [<c0431b18>] (bus_probe_device) from [<c042f5cc>] (device_add+0x444/0x5e4)
[ 413.481023] [<c042f5cc>] (device_add) from [<c0539bd8>] (sdio_add_func+0x5c/0x70)
[ 413.488500] [<c0539bd8>] (sdio_add_func) from [<c0538f40>] (mmc_attach_sdio+0x270/0x370)
[ 413.496584] [<c0538f40>] (mmc_attach_sdio) from [<c052ff78>] (mmc_rescan+0x304/0x38c)
[ 413.504412] [<c052ff78>] (mmc_rescan) from [<c0135e64>] (process_one_work+0x150/0x358)
[ 413.512326] [<c0135e64>] (process_one_work) from [<c0136098>] (worker_thread+0x2c/0x518)
[ 413.520413] [<c0136098>] (worker_thread) from [<c013b854>] (kthread+0x120/0x150)
[ 413.527804] [<c013b854>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 413.535014] Exception stack(0xc3ba5fb0 to 0xc3ba5ff8)
[ 413.540059] 5fa0: 00000000 00000000 00000000 00000000
[ 413.548226] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 413.556392] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 413.563003] Code: e5954018 e3a01000 e5851018 e2873008 (e5948004)
[ 413.569168] ---[ end trace 3facca9bc593b143 ]---
三、设置开机启动连接WiFi
新建一个rc.local文件到/etv/init.d目录下
# vi /etc/init.d/rc.local
内容:
!/bin/sh
sh /etc/init.d/auto_wifi_link.sh
echo "wifi finish!!"
创建脚本auto_wifi_link.sh放到/etc/init.d/目录下
vi /etc/init.d/auto_wifi_link.sh
内容:
#!/bin/sh
insmod /lib/modules/esp8089.ko config=crystal_26M_en=1 esp_reset_gpio=43
ifconfig wlan0 up
wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0
sleep 3s
udhcpc -i wlan0
修改开机启动项 vi /etc/inittab
在# now run any rc scripts 后加入如下
::sysinit:/etc/init.d/rc.local
如下:
# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <[email protected]>
#
# Note: BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id == tty to run on, or empty for /dev/console
# runlevels == ignored
# action == one of sysinit, respawn, askfirst, wait, and once
# process == program to run
# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mkdir -p /dev/shm
::sysinit:/bin/mount -a
::sysinit:/bin/hostname -F /etc/hostname
# now run any rc scripts
::sysinit:/etc/init.d/rcS
::sysinit:/etc/init.d/rc.local #看这里!!!!
# Put a getty on the serial port
#console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL
::respawn:-/bin/sh
# Stuff to do for the 3-finger salute
#::ctrlaltdel:/sbin/reboot
# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
修改rc.local 权限
# chmod 755 /etc/init.d/rc.local
rc.local就能够正常工作了。
reboot重启看到自动导入驱动然后连接wifi得到ip地址
边栏推荐
- Itop-2k1000 development board startup ramdisk production startup USB flash disk
- C string usage set
- How to solve the garbled code in the query statement when MySQL uses fuzzy query for Chinese
- 全志平台BSP裁剪(7)rootfs裁剪--用户工具和库的裁剪 & rootfs压缩
- VK Cup 2017 - round 3 B. Dynamic problem Scoring
- Oracle lock table solution
- VK Cup 2017 - Round 2 A. Voltage Keepsake
- C # characteristic
- run LK in Qemu
- 工业级AM335X核心模块选型
猜你喜欢

Mt2712 Display Debug Method

全国产工业级全志T3/A40i核心板-CoM-X40I,助力智能电力系统
![[paper] cbam: revolutionary block attention module](/img/62/3fde7346dae090567f749e63e5b25f.png)
[paper] cbam: revolutionary block attention module

TypeScript

CountDownLatch

全志平台BSP裁剪(7)rootfs裁剪--用户工具和库的裁剪 & rootfs压缩

Solution d'instructeur de robot basée sur l'enregistrement complet a40i fabriqué en Chine

Cmake compiling littlevgl demo

DBeaver导出查询数据sql文件

Mvcc multi version control
随机推荐
全志平台BSP裁剪(7)rootfs裁剪--用户工具和库的裁剪 & rootfs压缩
Divide by Zero 2017 and Codeforces Round #399 (Div. 1 + Div. 2, combined) E. Game of Stones
C anonymous function
香蕉派 BPI-M2 Ultra的缩小版-CoM-X40I核心板
Oracle lock table solution
VK Cup 2017 - Round 3 B. Dynamic Problem Scoring
VK Cup 2017 - Round 2 B. Volatile Kite
C# 事件
传输介质双绞线和光纤及二进制
1433: [example 1] angry cattle
Coredns part 4-compiling and installing unbound
VK Cup 2017 - round 3 B. Dynamic problem Scoring
Coredns Part 1 Introduction and installation
Yocto compiling libdrm
Use the default value method if the configuration file does not exist
Educational Codeforces Round 20 C. Maximal GCD
MT2712 Boot Flow Introduction
Bind 01 bind+kept install highly available DNS cluster
VK Cup 2017 - Round 2 A. Voltage Keepsake
CountDownLatch