Thursday, October 28, 2021

Bi-directional Communication between Heltec LoRa ESP32 and Heltec CubeCell

Direction: ESP32 to CubeCell:


Heltec LoRa ESP32 transmitting to CubeCell:
https://gist.github.com/bshambaugh/a8040e9a0964f5d60145e7211ee0455c

CubeCell receiving from Heltec ESP32:
https://gist.github.com/bshambaugh/f9bf79b9fd2d9e2ef6c8efcbb8ecb90d


Direction: CubeCell to ESP32

Heltec LoRa ESP32 receiving from CubCell:
https://gist.github.com/bshambaugh/57597999c76efb953c60eefa18cedaa0

CubeCell transmitting to Heltec ESP32:
https://gist.github.com/bshambaugh/8b619ea061ddabe142a6ebe407848ba9


+++++++++++++++++++++++++++++++++++++++++++++++

Edit: for future attractions see preliminary work forwarding received data over websockets:

https://gist.github.com/bshambaugh/a78c6a322aaade65b780809e7a6234ed


Edit: this is the code for sending data in one direction:

CubeCell:
https://gist.github.com/bshambaugh/18acf34544f219182ca224b8d648642b

Heltec ESP32:
https://gist.github.com/bshambaugh/5e7f358f034c160ce305490b149721de

Node.js:
https://gist.github.com/bshambaugh/4481addef68862bc5891d187d4391258




This is the code to send from the websockets server to the Heltec ESP32 to the Heltec CubeCell and blink based on the result of a particular string:

https://gist.github.com/bshambaugh/4ea7de432a6aee345ebc4707ea42e11e
(see : https://gist.github.com/bshambaugh/4481addef68862bc5891d187d4391258 for websockets going the other way)

Edit:

Blink light:

websocket server sketch:
https://gist.github.com/bshambaugh/6c84e52a7281b87d5c05b8df963bdbc9


CubeCell  LoRa receive sketch:
https://gist.github.com/bshambaugh/20467d0e7a97735aa690f3a39cd954af


Heltec ESP32 gateway (websocket to LoRa):
https://gist.github.com/bshambaugh/4d93e5871a32aae38a79f1548adf91e0

Blink light: https://github.com/HelTecAutomation/CubeCell-Arduino/blob/68b01ab7bf04ab2fb4d41a01287dcf4b42defd97/cores/asr6601/base/ASR_Arduino.h for https://gist.github.com/bshambaugh/20467d0e7a97735aa690f3a39cd954af#file-sketch_nov05a_cubecell_receive-ino-L92
do not use: https://github.com/adafruit/Adafruit_NeoPixel --> https://github.com/HelTecAutomation/CubeCell-Arduino/blob/68b01ab7bf04ab2fb4d41a01287dcf4b42defd97/libraries/RGB/src/CubeCell_NeoPixel.h
https://github.com/HelTecAutomation/CubeCell-Arduino/blob/68b01ab7bf04ab2fb4d41a01287dcf4b42defd97/libraries/RGB/examples/RGB/RGB.ino to make
https://gist.github.com/bshambaugh/de846af8637f590b5a47225b526f23f2
as there is a library conflict with ASR_Arduino.h forLoRaWan_APP.h for  turnOnRGB . see lines: https://github.com/HelTecAutomation/CubeCell-Arduino/blob/68b01ab7bf04ab2fb4d41a01287dcf4b42defd97/libraries/LoRa/src/LoRaWan_APP.h#L76-L77

extern "C" void turnOnRGB(uint32_t color,uint32_t time);
extern "C" void turnOffRGB(void);


Heltec ESP32 gateway (websocket to LoRa):
https://gist.github.com/bshambaugh/4d93e5871a32aae38a79f1548adf91e0




No comments:

Post a Comment