@dhanushmh
Here is my project using mySensors and LoRa modules for sensors around a farm.
https://farmer-eds-shed.com/?s=lora
Posts made by FarmerEd
-
RE: ESP32 with LoRa
-
RE: Heltec Lora32 V2 Gateway
@electrik said in Heltec Lora32 V2 Gateway:
Can you post your node and gateway sketch?
I think you should start with an example sketch, e.g. you don't need the heltec defines I recall.Yes both sketches would help to see where any issue might lie.
The following is a sketch I have previously used with the Heltec device as a Node. It's for a distance sensor but it may give some guidance.
#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RFM95 #define MY_DEBUG_VERBOSE_RFM95 #define MY_RFM95_RST_PIN 14 #define MY_RFM95_CS_PIN 18 #define MY_RFM95_IRQ_PIN 26 #define MY_RFM95_IRQ_NUM MY_RFM95_IRQ_PIN #define MY_SOFT_SPI_MOSI_PIN 27 #define MY_SOFT_SPI_SCK_PIN 5 #define MY_RFM95_FREQUENCY (RFM95_868MHZ) #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128 #define MY_NODE_ID 44 #include <SPI.h> #include <MySensors.h> #include <NewPing.h> #define SENSOR_NAME "Distance Sensor" #define SENSOR_VERSION "1.1" #define CHILD_ID 1 // Each radio node can report data for up to 254 different child sensors. You are free to choose the child id yourself. // You should avoid using child-id 255 because it is used for things like sending in battery level and other (protocol internal) node specific information. #define TRIGGER_PIN 3 // Arduino pin tied to trigger pin on the ultrasonic sensor. #define ECHO_PIN 4 // Arduino pin tied to echo pin on the ultrasonic sensor. #define MAX_DISTANCE 300 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm. unsigned long SLEEP_TIME = 21600000; // Sleep time between reads (in milliseconds) 900000 = 15min, 21600000 = 6h NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance. MyMessage msg(CHILD_ID, V_DISTANCE); int lastDist; bool metric = true; void setup() { metric = getControllerConfig().isMetric; } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo(SENSOR_NAME, SENSOR_VERSION); // Register all sensors to gw (they will be created as child devices) by their ID and S_TYPE present(CHILD_ID, S_DISTANCE); } void loop() { // use the build-in digital filter to discard out of range pings int echoTime = sonar.ping_median(10); int dist = metric?sonar.convert_cm(echoTime):sonar.convert_in(echoTime); Serial.print("Ping: "); Serial.print(dist); Serial.println(metric?" cm":" in"); if (dist != lastDist) { send(msg.set(dist)); lastDist = dist; } wait(SLEEP_TIME); } void setup() { } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo(SENSOR_NAME, SENSOR_VERSION); } void loop() { }
-
RE: Heltec Lora32 V2 Gateway
Have you setup a node to talk to the Gateway yet?
And if so is it the other Heltec device? I have a recollection of ESP32 devices not working with sketches with "Sleep" in them but sleep can be replaced with "wait" not great for battery nodes but will do for testing.
-
RE: Heltec Lora32 V2 Gateway
With a very chatty node to talk to the output looks like this.
18:42:17.284 -> 1455 TSM:READY:NWD REQ 18:42:17.284 -> 1459 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0 18:42:17.331 -> 1513 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: 18:42:17.518 -> 1686 RFM95:SAC:SEND ACK,TO=84,SEQ=313,RSSI=-39,SNR=9 18:42:17.564 -> 1734 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:662 18:42:17.659 -> 1839 RFM95:SAC:SEND ACK,TO=84,SEQ=314,RSSI=-38,SNR=9 18:42:17.704 -> 1887 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:17.843 -> 1992 RFM95:SAC:SEND ACK,TO=84,SEQ=315,RSSI=-42,SNR=9 18:42:17.891 -> 2040 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:17.983 -> 2145 RFM95:SAC:SEND ACK,TO=84,SEQ=316,RSSI=-43,SNR=9 18:42:18.030 -> 2193 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:16 18:42:18.404 -> 2578 GWT:TSA:C=0,CONNECTED 18:42:18.404 -> 2589 GWT:RFC:C=0,MSG=255;255;3;0;20; 18:42:18.450 -> 2592 RFM95:SWR:SEND,TO=255,SEQ=5,RETRY=0 18:42:18.498 -> 2646 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=1,l=1,sg=0,ft=0,st=OK:0 18:42:18.592 -> 2749 RFM95:SAC:SEND ACK,TO=84,SEQ=317,RSSI=-43,SNR=9 18:42:18.638 -> 2797 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:6 18:42:18.733 -> 2902 RFM95:SAC:SEND ACK,TO=84,SEQ=318,RSSI=-44,SNR=9 18:42:18.779 -> 2950 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:13 18:42:18.873 -> 3055 RFM95:SAC:SEND ACK,TO=84,SEQ=319,RSSI=-44,SNR=10 18:42:18.920 -> 3103 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:19.062 -> 3208 RFM95:SAC:SEND ACK,TO=84,SEQ=320,RSSI=-43,SNR=9 18:42:19.109 -> 3256 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:1 18:42:19.204 -> 3361 RFM95:SAC:SEND ACK,TO=84,SEQ=321,RSSI=-41,SNR=9 18:42:19.251 -> 3409 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:3 18:42:19.345 -> 3514 RFM95:SAC:SEND ACK,TO=84,SEQ=322,RSSI=-39,SNR=9 18:42:19.393 -> 3562 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:19.485 -> 3667 RFM95:SAC:SEND ACK,TO=84,SEQ=323,RSSI=-40,SNR=9 18:42:19.531 -> 3715 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:8 18:42:19.673 -> 3820 RFM95:SAC:SEND ACK,TO=84,SEQ=324,RSSI=-41,SNR=9 18:42:19.719 -> 3868 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:8 18:42:19.813 -> 3973 RFM95:SAC:SEND ACK,TO=84,SEQ=325,RSSI=-41,SNR=9 18:42:19.861 -> 4021 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:19.955 -> 4126 RFM95:SAC:SEND ACK,TO=84,SEQ=326,RSSI=-42,SNR=9 18:42:20.001 -> 4174 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:6 18:42:20.094 -> 4279 RFM95:SAC:SEND ACK,TO=84,SEQ=327,RSSI=-41,SNR=9 18:42:20.142 -> 4327 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:8 18:42:20.281 -> 4432 RFM95:SAC:SEND ACK,TO=84,SEQ=328,RSSI=-39,SNR=9 18:42:20.327 -> 4480 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:20.419 -> 4585 RFM95:SAC:SEND ACK,TO=84,SEQ=329,RSSI=-40,SNR=9 18:42:20.467 -> 4633 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:11 18:42:20.560 -> 4738 RFM95:SAC:SEND ACK,TO=84,SEQ=330,RSSI=-40,SNR=9 18:42:20.607 -> 4786 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:6 18:42:20.747 -> 4891 RFM95:SAC:SEND ACK,TO=84,SEQ=331,RSSI=-39,SNR=9 18:42:20.794 -> 4939 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:20.887 -> 5044 RFM95:SAC:SEND ACK,TO=84,SEQ=332,RSSI=-40,SNR=9 18:42:20.935 -> 5092 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:13 18:42:21.027 -> 5197 RFM95:SAC:SEND ACK,TO=84,SEQ=333,RSSI=-40,SNR=9 18:42:21.075 -> 5245 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:6 18:42:21.167 -> 5350 RFM95:SAC:SEND ACK,TO=84,SEQ=334,RSSI=-41,SNR=9 18:42:21.215 -> 5398 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:21.353 -> 5503 RFM95:SAC:SEND ACK,TO=84,SEQ=335,RSSI=-42,SNR=9 18:42:21.401 -> 5551 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:16 18:42:21.496 -> 5656 RFM95:SAC:SEND ACK,TO=84,SEQ=336,RSSI=-42,SNR=9 18:42:21.541 -> 5704 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:21.636 -> 5809 RFM95:SAC:SEND ACK,TO=84,SEQ=337,RSSI=-42,SNR=9 18:42:21.682 -> 5857 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:21.822 -> 5962 RFM95:SAC:SEND ACK,TO=84,SEQ=338,RSSI=-41,SNR=9 18:42:21.870 -> 6010 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:11 18:42:21.964 -> 6115 RFM95:SAC:SEND ACK,TO=84,SEQ=339,RSSI=-38,SNR=10 18:42:22.010 -> 6163 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:22.102 -> 6268 RFM95:SAC:SEND ACK,TO=84,SEQ=340,RSSI=-43,SNR=9 18:42:22.149 -> 6316 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:-1 18:42:22.243 -> 6421 RFM95:SAC:SEND ACK,TO=84,SEQ=341,RSSI=-36,SNR=9 18:42:22.289 -> 6469 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:142 18:42:22.429 -> 6574 RFM95:SAC:SEND ACK,TO=84,SEQ=342,RSSI=-36,SNR=9 18:42:22.476 -> 6622 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:804 18:42:22.570 -> 6727 RFM95:SAC:SEND ACK,TO=84,SEQ=343,RSSI=-36,SNR=9 18:42:22.615 -> 6775 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:629 18:42:22.709 -> 6880 RFM95:SAC:SEND ACK,TO=84,SEQ=344,RSSI=-34,SNR=9 18:42:22.758 -> 6928 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:745 18:42:22.850 -> 7033 RFM95:SAC:SEND ACK,TO=84,SEQ=345,RSSI=-36,SNR=9 18:42:22.897 -> 7081 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:896 18:42:23.038 -> 7186 RFM95:SAC:SEND ACK,TO=84,SEQ=346,RSSI=-36,SNR=10 18:42:23.086 -> 7234 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:1042 18:42:23.178 -> 7339 RFM95:SAC:SEND ACK,TO=84,SEQ=347,RSSI=-36,SNR=9 18:42:23.225 -> 7387 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:1150 18:42:23.317 -> 7492 RFM95:SAC:SEND ACK,TO=84,SEQ=348,RSSI=-38,SNR=9 18:42:23.365 -> 7540 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:1227 18:42:23.504 -> 7645 RFM95:SAC:SEND ACK,TO=84,SEQ=349,RSSI=-37,SNR=9 18:42:23.552 -> 7693 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:1265 18:42:23.644 -> 7798 RFM95:SAC:SEND ACK,TO=84,SEQ=350,RSSI=-39,SNR=9 18:42:23.691 -> 7846 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:1306 18:42:23.785 -> 7951 RFM95:SAC:SEND ACK,TO=84,SEQ=351,RSSI=-38,SNR=9 18:42:23.832 -> 7999 TSF:MSG:READ,84-84-0,s=0,c=1,t=23,pt=2,l=2,sg=0:1332
-
RE: Heltec Lora32 V2 Gateway
Think you already came across mine.
If you use code tags in your post it would be easier to read.This is mine, as far as I can see you are using the similar.
#define MY_RADIO_RFM95 #define MY_DEBUG_VERBOSE_RFM95 #define MY_RFM95_RST_PIN 14 #define MY_RFM95_CS_PIN 18 #define MY_RFM95_IRQ_PIN 26 #define MY_RFM95_IRQ_NUM MY_RFM95_IRQ_PIN #define MY_SOFT_SPI_MOSI_PIN 27 #define MY_SOFT_SPI_SCK_PIN 5 #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128 #define MY_RFM95_FREQUENCY (RFM95_868MHZ)
This is the initial start-up with no nodes connected.
18:36:09.139 -> 61 RFM95:INIT:PIN,CS=18,IQP=26,IQN=26,RST=14 18:36:09.202 -> 75 RFM95:PTX:LEVEL=13 18:36:09.202 -> 77 TSM:INIT:TSP OK 18:36:09.202 -> 81 TSM:INIT:GW MODE 18:36:09.202 -> 85 TSM:READY:ID=0,PAR=0,DIS=0 18:36:09.202 -> 89 MCO:REG:NOT NEEDED 18:36:10.284 -> 1182 GWT:TIN:CONNECTING... 18:36:10.284 -> 1184 GWT:TIN:IP: 192.168.1.203 18:36:10.284 -> 1190 MCO:BGN:STP 18:36:10.331 -> Serial initial done 18:36:10.519 -> you can see OLED printed OLED initial done! 18:36:10.566 -> 1451 MCO:BGN:INIT OK,TSP=1 18:36:10.566 -> 1454 TSM:READY:NWD REQ 18:36:10.566 -> 1458 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0 18:36:10.613 -> 1512 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: 18:36:12.023 -> 2922 GWT:TSA:C=0,CONNECTED 18:36:12.023 -> 2932 GWT:RFC:C=0,MSG=255;255;3;0;20; 18:36:12.023 -> 2935 RFM95:SWR:SEND,TO=255,SEQ=1,RETRY=0 18:36:12.070 -> 2989 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=1,l=1,sg=0,ft=0,st=OK:0
This is my complete Heltec Gateway Sketch,
#define MY_DEBUG #define MY_RADIO_RFM95 #define MY_DEBUG_VERBOSE_RFM95 #define MY_RFM95_RST_PIN 14 #define MY_RFM95_CS_PIN 18 #define MY_RFM95_IRQ_PIN 26 #define MY_RFM95_IRQ_NUM MY_RFM95_IRQ_PIN #define MY_SOFT_SPI_MOSI_PIN 27 #define MY_SOFT_SPI_SCK_PIN 5 #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128 //Select Frequency #define MY_RFM95_FREQUENCY (RFM95_868MHZ) #define MY_GATEWAY_ESP32 //SSID and Password #define MY_WIFI_SSID "MY_SSID" #define MY_WIFI_PASSWORD "MY_PASSWORD" //Set Hostname #define MY_HOSTNAME "Home_GW_LoRa" //Static IP Address #define MY_IP_ADDRESS 192,168,1,203 // If using static IP define Gateway and Subnet address as well #define MY_IP_GATEWAY_ADDRESS 192,168,1,1 #define MY_IP_SUBNET_ADDRESS 255,255,255,0 // The port to keep open on node server mode #define MY_PORT 5003 // How many clients should be able to connect to this gateway (default 1) #define MY_GATEWAY_MAX_CLIENTS 2 #include <MySensors.h> #include "heltec.h" void setup() { // Setup locally attached sensors Heltec.begin(true /*DisplayEnable Enable*/, false /*LoRa Disable*/, true /*Serial Enable*/); Heltec.display->setContrast(255); Heltec.display->clear(); Heltec.display->setFont(ArialMT_Plain_16); Heltec.display->drawString(30, 10, "LoRa Home"); Heltec.display->setFont(ArialMT_Plain_10); Heltec.display->drawString(30, 40, WiFi.localIP().toString()); Heltec.display->display(); } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attached sensors data here }```
-
RE: Adafruit RFM69 Bonnet not working
What great timing (for me anyway), only this week I purchased the Adafruit RFM95 Bonnet version, and this thread is the only thing returned in a quick search. Your solution works for RFM95 also.
I didn't need to comment out the code that prevented toggling the CS_PIN, but I'm using the development version as the main branch dose not seem to build on Pi OS Bullseye.
./configure --my-transport=rfm95 --my-rfm95-frequency=868 --my-gateway=ethernet --my-port=5003 --my-rfm95-cs-pin=26 --my-rfm95-irq-pin=15 --extra-cxxflags="-DMY_RFM95_RST_PIN=22" --spi-spidev-device=/dev/spidev0.1 --spi-driver=SPIDEV
Thanks to your post I got this working in a few min of trying, would have taken me much longer otherwise, so thank you for posting to an ancient thread.
-
RE: Mysensors and BSFrance Lora32u4 ii
@CarloMagno, No problem, this is not an RF69 device, it is RFM95 which is LoRa. I'm only interested in LoRa radios at the moment as I'm building a sensor network across a farm.
-
RE: Mysensors and BSFrance Lora32u4 ii
I realize this topic is old, but not sure if it was ever resolved. I'm trying out one of these boards at the moment, this was the only topic I seen about the board and I encountered the same issues as above.
This is how I got it to communicate in the end and I thought I'd leave it here in case anyone else is looking at the same.
#define MY_RADIO_RFM95
#define MY_RFM95_RST_PIN 4
#define MY_RFM95_CS_PIN 8
#define MY_RFM95_IRQ_PIN 7
#define MY_RFM95_IRQ_NUM digitalPinToInterrupt(7)
#define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128
#define MY_RFM95_FREQUENCY (RFM95_868MHZ)Soft SPI isn't necessary, but the only issue in the code above was the missing digitalPinToInterrupt.
#define MY_RFM95_IRQ_NUM digitalPinToInterrupt(7)
I presume the following should work also:
#define MY_RFM95_IRQ_NUM digitalPinToInterrupt(MY_RFM95_IRQ_PIN) -
RE: mysensors regularly disconnect from HA
@keithellis , I had similar issues with my setup although I didn't investigate it in any kind of detail like suggested above, my solution was simply changing the WiFi network. I was having intermittent connectivity issues with a number of ESP8266/ESP32 devices on my mixed 2.4Ghz/5Ghz Mesh network, so I switched back on my routers WiFi in 2.4ghz mode only and named its SSID "WiFi-IOT" and connected all of these ESP based IOT devices to it and I've had no dropouts since.
I have 4 MySensors gateways connected to Home Assistant, 2 by WiFi using an ESP8266 and an ESP32, the other 2 are Pi Zeros with 4G Hats connected by a VPN, since surprisingly I never had connectivity issues with the 2 remote devices and always the 2 WiFi ones literally next to the router I could only suspect the WiFi network. It may not be your issue but worth considering just the same. I think I will probably convert mine to serial gateways when I get the time.
-
RE: LoRa/RFM95 - Testing long range PHY settings - Findings
@cloolalang said in LoRa/RFM95 - Testing long range PHY settings - Findings:
w the SF 12 long payload messages pass!
I tested various SF and BW and coding rates, I decided on the following for the "long-range mode". Typical use will be point-point mode, or gateway to 2 or 3 nodes max, no repeaters. Horizontal polarised yagi antennas.
MY_RFM95_FREQUENCY 433237500ul (its 1MHz away from my co-located standard mode gateway frequency and other local ISM users).
RFM95_MODEM_CONFIGRUATION RFM95_BW62_5CR45SF4096 (Typical time-on-air is around 4000ms.
MY_RFM95_ATC_MODE_DISABLED (to reduce traffic).
How is testing going on this?
I'm interested to know what sort of distance you can cover, I'm planning on some long range sensors to be deployed on my farm. I'm not quite gettting the range I would like.Here is the radio config in my current setup, but I will definitly look at some of the additional config that you have.
#define MY_RFM95_FREQUENCY (RFM95_868MHZ) #define MY_RFM95_MAX_POWER_LEVEL_DBM (100) #define MY_TRANSPORT_STATE_TIMEOUT_MS (3*1000ul) #define RFM95_RETRY_TIMEOUT_MS (3000ul) #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR48SF4096
As a matter of interest has anyone used repeater nodes with these sort of long range setups. I'm talking about distances over a KM with no clear line of sight. I've managed to get simple comunications working over the required distance using simple transmitter and receiver sketches (provided by heltec, to demonstrate their Lora Node) sending "hello" packets
-
RE: My Sensors with Heltec V2
@mrussi
Not sure if you still need this info, but I'll leave it here in case anyone else needs it. I couldn't find this either so i had to look at the heltec pinout diagram and compared to the ESP32 Library/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2018 Sensnology AB * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - tekka * * DESCRIPTION * The ESP32 gateway sends data received from sensors to the WiFi link. * The gateway also accepts input on ethernet interface, which is then sent out to the radio network. * * Make sure to fill in your ssid and WiFi password below. */ // Enable debug prints to serial monitor #define MY_DEBUG // Enables and select radio type (if attached) //#define MY_RADIO_RF24 //#define MY_RADIO_RFM69 #define MY_RADIO_RFM95 #define MY_DEBUG_VERBOSE_RFM95 #define MY_RFM95_RST_PIN 14 #define MY_RFM95_CS_PIN 18 #define MY_RFM95_IRQ_PIN 26 #define MY_RFM95_IRQ_NUM MY_RFM95_IRQ_PIN #define MY_SOFT_SPI_MOSI_PIN 27 #define MY_SOFT_SPI_SCK_PIN 5 #define MY_RFM95_FREQUENCY (RFM95_868MHZ) #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128 #define MY_GATEWAY_ESP32 #define MY_WIFI_SSID "WiFi_SSID" #define MY_WIFI_PASSWORD "password" // Set the hostname for the WiFi Client. This is the hostname // it will pass to the DHCP server if not static. #define MY_HOSTNAME "ESP32_GW_LoRa" // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP) //#define MY_IP_ADDRESS 192,168,1,100 // If using static ip you can define Gateway and Subnet address as well //#define MY_IP_GATEWAY_ADDRESS 192,168,1,1 //#define MY_IP_SUBNET_ADDRESS 255,255,255,0 // The port to keep open on node server mode #define MY_PORT 5003 // How many clients should be able to connect to this gateway (default 1) #define MY_GATEWAY_MAX_CLIENTS 2 #include <MySensors.h> void setup() { // Setup locally attached sensors } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attached sensors data here }