這是使用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設備),並且為此功能進行了認證,默認登錄/通過(默認登錄/範圍)(範圍/管理)
如果添加一些功能,請隨時執行拉動請求,以便我可以合併您的更改。
在我的博客上查看新聞和其他項目