Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Heltec Lora32 V2 Gateway

Heltec Lora32 V2 Gateway

Scheduled Pinned Locked Moved Hardware
14 Posts 4 Posters 2.1k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • FarmerEdF FarmerEd

    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.

    T Offline
    T Offline
    toigo
    wrote on last edited by
    #5

    @FarmerEd Sleep is not implemented for the ESPs - see (also for reasons): https://github.com/mysensors/MySensors/issues/968

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pdkwork
      wrote on last edited by
      #6

      @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.

      1 Reply Last reply
      1
      • P Offline
        P Offline
        pdkwork
        wrote on last edited by
        #7

        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=2
        

        It 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.

        1 Reply Last reply
        0
        • electrikE Offline
          electrikE Offline
          electrik
          wrote on last edited by
          #8

          I have had success with this same board. Which variant of board are you using? So I mean the frequency of the Lora module.

          Also make sure you have configured and connected the IRQ pin on the node.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pdkwork
            wrote on last edited by
            #9

            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?

            electrikE 1 Reply Last reply
            0
            • P pdkwork

              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?

              electrikE Offline
              electrikE Offline
              electrik
              wrote on last edited by
              #10

              @pdkwork What is the frequency of the LoRa module you use? 434, 868 MHz?

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pdkwork
                wrote on last edited by
                #11

                It the 868-915 version. I am in the US so I thought I should use 915. 915 works using the Heltec example sketches.

                1 Reply Last reply
                0
                • electrikE Offline
                  electrikE Offline
                  electrik
                  wrote on last edited by
                  #12

                  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.

                  FarmerEdF 1 Reply Last reply
                  1
                  • electrikE electrik

                    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.

                    FarmerEdF Offline
                    FarmerEdF Offline
                    FarmerEd
                    wrote on last edited by
                    #13

                    @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()      
                    { 
                    
                      }
                    
                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      pdkwork
                      wrote on last edited by
                      #14

                      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.

                      1 Reply Last reply
                      1

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      23

                      Online

                      12.1k

                      Users

                      11.2k

                      Topics

                      113.4k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular