相对于spi或者sdio接口方式,串口的配置更加简单。已经通过笔记本验证,下次验证f1c100s。
https://github.com/martin-ger/esp_slip_router
Usage as STA
In this mode the ESP connects to the internet via an AP with ssid, password and offers at UART0 a SLIP interface with IP address 192.168.240.1. This default can be changed in the file user_config.h.
To connect a Linux-based host, start the firmware on the ESP, connect it via serial to USB, and use the following commands on the host:
sudo slattach -L -p slip -s 115200 /dev/ttyUSB0&
sudo ifconfig sl0 192.168.240.2 pointopoint 192.168.240.1 up mtu 1500
now
telnet 192.168.240.1 7777
gives you terminal access to the esp as router. On the ESP you then enter:
CMD>set ssid <your_ssid>
CMD>set password <your_pw>
CMD>set use_ap 0
CMD>save
CMD>reset
To get full internet access you will need aditionally a route:
sudo route add default gw 192.168.240.1
and a DNS server - add an appropriate entry (e.g. public DNS server) in /etc/resolv.conf, eg. by (as root):
echo "nameserver 9.9.9.9" > /etc/resolv.conf
离线
网络通讯也是走串口吗?
离线
这个用法有点意思哦
离线
网络通讯也是走串口吗?
我看了一眼那个github repo,里头写了 “This is an implementation of a SLIP (Serial Line IP - RFC1055) router on the ESP8266.” 这应该就是说网络通讯也是从串口走的
离线
ppp 的应用?
离线
通过slip(串行互联网协议)实现的,这里是wiki详细介绍:
https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol
离线
我的tiny200s内核没有slip驱动,所以报了一下错误:
SLIP_set_disc(1): Invalid argument
将这个驱动编译进内核应该就可以了,当然还需要有slattach 和telnet这两个工具
离线
linux的tap或者tun可以直接使用串口虚拟网卡吧
https://blog.csdn.net/coroutines/article/details/8106674
最近编辑记录 小智 (2021-04-22 19:56:31)
离线