您尚未登录。

楼主 #1 2021-04-21 01:13:56

kekemuyu
会员
注册时间: 2018-12-13
已发帖子: 844
积分: 720

esp8266通过串口用作网卡使用

相对于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

离线

楼主 #6 2021-04-21 10:43:41

kekemuyu
会员
注册时间: 2018-12-13
已发帖子: 844
积分: 720

Re: esp8266通过串口用作网卡使用

通过slip(串行互联网协议)实现的,这里是wiki详细介绍:
https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol

离线

楼主 #7 2021-04-21 10:46:26

kekemuyu
会员
注册时间: 2018-12-13
已发帖子: 844
积分: 720

Re: esp8266通过串口用作网卡使用

我的tiny200s内核没有slip驱动,所以报了一下错误:

SLIP_set_disc(1): Invalid argument

将这个驱动编译进内核应该就可以了,当然还需要有slattach 和telnet这两个工具

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn