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.
-
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.
-
@FarmerEd Thanks for the information. Sorry I was traveling and just saw your posts. I did try a node but I think I was still in my setup confusion so it may not have been transmitting correctly. I will check and set one up. It is also a Heltec device but is not sleeping right now.
@toigo Thanks for the information on no sleep yet. I was going to use it with batteries so now I will need to rethink this. -
I have now tried a sensor node based on the same Heltec chip and it is stuck in a Find Parent loop. I have the gateway setup matching @FarmerEd post.
The serial output is below
67 TSM:INIT 68 TSF:WUR:MS=0 69 RFM95:INIT 76 RFM95:INIT:PIN,CS=18,IQP=26,IQN=26,RST=14 92 RFM95:PTX:LEVEL=13 94 TSM:INIT:TSP OK 96 TSM:FPAR 97 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0 149 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2157 !TSM:FPAR:NO REPLY 2159 TSM:FPAR 2160 RFM95:SWR:SEND,TO=255,SEQ=1,RETRY=0 2212 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4220 !TSM:FPAR:NO REPLY 4222 TSM:FPAR 4223 RFM95:SWR:SEND,TO=255,SEQ=2,RETRY=0 4275 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6283 !TSM:FPAR:NO REPLY 6285 TSM:FPAR 6286 RFM95:SWR:SEND,TO=255,SEQ=3,RETRY=0 6338 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 8346 !TSM:FPAR:FAIL 8347 TSM:FAIL:CNT=1 8349 TSM:FAIL:DIS 8351 TSF:TDI:TSL 8352 RFM95:RSL 18354 TSM:FAIL:RE-INIT 18356 TSM:INIT 18357 RFM95:INIT 18364 RFM95:INIT:PIN,CS=18,IQP=26,IQN=26,RST=14 18379 RFM95:PTX:LEVEL=13 18381 TSM:INIT:TSP OK 18383 TSM:FPAR 18384 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0 18437 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 20444 !TSM:FPAR:NO REPLY 20446 TSM:FPAR 20447 RFM95:SWR:SEND,TO=255,SEQ=1,RETRY=0 20500 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 22507 !TSM:FPAR:NO REPLY 22509 TSM:FPAR 22510 RFM95:SWR:SEND,TO=255,SEQ=2,RETRY=0 22563 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 24570 !TSM:FPAR:NO REPLY 24572 TSM:FPAR 24573 RFM95:SWR:SEND,TO=255,SEQ=3,RETRY=0 24626 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 26633 !TSM:FPAR:FAIL 26634 TSM:FAIL:CNT=2It seems that the chip is not transmitting. I have been using Home Assistant for 3 years but just now I am trying MySensors. I have added the integration in HA and connected it the gateway.
I did try to set a Parent but it just continues in another endless loop. I don't know where to go from here.
-
I am using the Heltec LoRa32 V2 of the board. IRQ number is set to 26 and IRQ pin is also 26. I don’t understand why the code is reporting no acknowledgement from the radio. I see ?TSF and ?TSM in the log. Is that normal for you?
-
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.@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() { } -
Success! In all my testing and trying new settings, I missed that I had commented out on the gateway the frequency setting. It was noobie mistake and I want to thank all of you for your help. I ended up using @FarmerEd's sketches to get my gateway and sensor to work.
Thanks again.