这是使用RN2483 Lorawan模块的任何ESP8266设备之间的WiFi和串行之间的纯透明桥。它对于没有网络连接的RN2483等远程串行设备(例如RN2483)非常有用。它致力于与WEMOS RN2483 Shield一起使用,我正在将其与Things Network Lorawan后端一起使用,但您可以使用其他提供商。
我在WEMOS Target上使用它,您可以在其网站上找到有关WEMOS的更多信息,这确实有很好的记录。
该项目主要基于出色的 @me-no-dev espasyncweberver库和Jakub Jankiewicz完成的出色jQuery终端。
上传SPIFFS数据(网页)后,您可以将浏览器连接到http://ip_of_esp8266并开始使用它。主index.htm网页包含一个完整的JavaScript终端,因此您可以键入命令并接收响应。
主网页也可以在任何地方托管,也不必须将其放在设备上(除非设备和计算机在Internet上无法访问)。我已经从GitHub发布了完全farctionnal的网页,因此您可以从这里访问它,然后在Wich上连接到您的设备,然后刷新了固件。
某些命令将由目标解释(ESP8266),而不会传递给串行,因此您可以与ESP8266进行一些可变的东西进行交互。
首次设置(假设您使用的是RN2483盾牌)
connect以连接到本地设备,一个连接的检查ALL都可以打字sys get ver =>应该像RN2483 1.0.1 Dec 15 2015 09:38:09返回某个返回的某个返回reset 12并重试,直到横幅mac set appeui YOUR_APP_EUImac set appkey YOUR_APP_KEYmac set deveui YOUR_DEV_EUImac savemac join otaa然后等待ok并accepted ,然后您进入!
按下按钮(长按不同的行为)
PS:如果您只想使用硬件,请使用简化的check-rn2483草图
您需要安装nodejs和一些依赖npm install zlib 。
WebDEV文件夹是用于测试和验证网页的开发文件夹。它用于避免在每次修改上刷新设备。所有源文件都位于此文件夹中,ESP8266 data文件夹(包含Web页面)均由从WebDEV文件夹启动的NodeJS脚本填充。此存储库包含在数据最新文件中,因此,如果您不更改任何文件,则可以按原样上传到Spiffs。
要测试网页,请转到命令行,进入WebDev文件夹并发出:
node web_server.js
然后将您的浏览器连接到htpp:// localhost:8080您可以适度并测试源文件此类index.htm
一旦一切都可以,问题node create_spiffs.js
这将gzip文件并将它们放入数据文件夹中,然后您可以从Arduino IDE上传到设备Spiffs
请参阅create_spiffs.js和web_server.js文件中的注释,还指示了nodejs所需的依赖关系。
您还可以使用集成编辑器直接从设备中直接从设备编辑文件,例如更改配置文件。 http://your_device_ip/edit.htm带有登录通道(admin/admin)
!close或CTRL-D:关闭连接swap交换eSP8266 gpio1/gpio3之间的uart pinping在终端和ESP8266上打字Ping将寄回乒乓球?或help显示帮助heap Show ESP8266免费RAMwhoami显示websocket客户端#我们是who向所有Websocket客户端显示了连接send second自动发送数据(0 =禁用发送)fw显示固件日期/时间baud显示ESP8266串行波特率配置baud n设置ESP8266串行baud速率为n(与设备驱动兼容)rgb l集RGB LED发光度L(0..100)reset p重置GPIO PIN编号P Pls列表SPIFFS文件read file执行spiffs文件命令hostname显示网络主机名restart重置ESP8266(重启)debug表演调试信息cat file显示文件的内容up type发送上行链路消息(类型0 =未确认的类型1 =已确认)文件startup.ini中的每个命令均在setup()中执行您可以与其他文件链。
我正在使用此草图来驱动Microchip RN2483 Lora模块测试Lorawan,请参阅我使用的板。
例如,我的startup.ini文件包含命令读取名为rn2483-cfg.txt的microchip rn2483配置文件,然后链条与文件rn2483-ttn-otaa.txt一起加入otaa
startup.ini
# Startup config file executed once in setup()
# commands prefixed by ! are executed by ESP
# all others passed to serial module
# Set Onboard RGB LED luminosity (0=off 100=full light)
! rgb 50
# Microchip Lora rn2483 configuration
! read /rn2483-cfg.txt
# Join ttn in otaa mode
! read /rn2483-ttn-otaa.txt
RN2483配置文件示例RN2483 SHIELD rn2483-cfg.txt
# Startup config file for Microchip RN2483
# commands prefixed by ! or $ are executed by ESP all others passed to serial module
# command starting with $ wait until device return n
# RN2483 always return string followed by "rn" on each command (ex "okrn")
# so $ wait a response (good or not) before sending next command
# !delay or any $ are not executed when connected via browser web terminal (websocket)
# See schematics here https://github.com/hallard/WeMos-RN2483
# Set ESP Module serial speed (RN2483 is 57600)
# as reminder, it's now done in sketch
# !baud 57600
# !delay 50
# For Hardware boards V1.1+
# -------------------------
# reset RN2483 module
$reset 12
# !baud 57600
# !delay 50
# Wired GPIO to output
$sys set pinmode GPIO1 digout
$sys set pinmode GPIO10 digout
# Light on the LED on all GPIO
$sys set pindig GPIO1 1
$sys set pindig GPIO10 1
# Custom config here
# ------------------
# Set Power Max
$radio set pwr 14 RN2483加入TTN OTAA配置文件示例RN2483 SHIELD rn2483-otaa.txt
# Startup config file for Microchip RN2483 join TTN in otaa
# commands prefixed by ! or $ are executed by ESP all others passed to serial module (RN2483)
# command starting with $ wait until device return n
# RN2483 always return string followed by "rn" on each command (ex "okrn")
# so $ wait a response (good or not) before sending next command
# !delay or any $ are not executed when connected via browser web terminal (websocket)
# See schematics here https://github.com/hallard/WeMos-RN2483
# Your device should have been registered on TTN before using, here is how to
# On the RN2483, use `sys get hweui` and `mac get deveui`
# you then get the devices hweui & deveui, They are probably the same
# then register device on TTN console dashboard
# Then you must setup your keys (obtained from TTN console dashboard)
# Personnaly I prefer setup the 3 fixed values in TTN dashboard
# then put them into the RN2483 module
# then on RN2483 device (1st setup, then don't need to be set again)
# $mac set appeui YOUR_APP_EUI
# $mac set appkey YOUR_APP_KEY
# $mac set deveui YOUR_DEV_EUI
# and saved with `mac save`
# $mac save
# Then Join TTN Network
$mac join otaa看到所有行动
http://cdn.rawgit.com/hallard/wemos-rn2483-firmware/master/wemos-rn2483/webdev/index.htm
顺便说一句,我集成了出色的 @me-no-dev Spiffs Web编辑器,因此您可以将Spiffs的编辑配置文件转到http://your_module_ip/edit您的计算机需要连接到Internet(可能是您的ESP8266设备),并且为此功能进行了认证,默认登录/通过(默认登录/范围)(范围/管理)
如果添加一些功能,请随时执行拉动请求,以便我可以合并您的更改。
在我的博客上查看新闻和其他项目