Heltec Lora32 V2 Gateway



  • I have been trying for days now to get this chip to work as a gateway. I have two of the same chip and have tested the Lora with the Heltec example sketches and both will send and receive so the hardware works.
    I have also done extensive searches on the forum and I did find settings that are stated to work but don't seem to work for me.
    One posting that looked promising is https://forum.mysensors.org/topic/10654/my-sensors-with-heltec-v2?_=1642102471786&lang=en-US

    I continue to get this output:
    34 MCO:BGN:INIT GW,CP=RLNGF---,FQ=240,REL=255,VER=2.3.2
    40 TSF:LRT:OK
    41 TSM:INIT
    42 TSF:WUR:MS=0
    43 RFM95:INIT
    50 RFM95:INIT:PIN,CS=18,IQP=26,IQN=26,RST=14
    65 RFM95:PTX:LEVEL=13
    67 TSM:INIT:TSP OK
    69 TSM:INIT:GW MODE
    70 TSM:READY:ID=0,PAR=0,DIS=0
    73 MCO:REG:NOT NEEDED
    1204 GWT:TIN:CONNECTING...
    2207 GWT:TIN:CONNECTING...
    3210 GWT:TIN:CONNECTING...
    3212 GWT:TIN:IP: 192.168.3.62
    3217 MCO:BGN:STP
    3689 MCO:BGN:INIT OK,TSP=1
    3691 TSM:READY:NWD REQ
    3693 RFM95:SWR:SEND,TO=255,SEQ=0,RETRY=0
    3746 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    900043 TSF:SAN:OK

    I think the problem is the 3746 line which shows no acknowledgement from the local radio. It does not appear to be transmitting.

    My settings are:
    #include <Arduino.h>
    #include "secrets.h"

    // ******************** HELTEC Lora32 Defines ****************************
    #include "heltec.h"
    #define HELTEC
    #define BAND 915E6 //you can set band here directly,e.g. 868E6,915E6
    String networkIP(IPAddress ip);

    // ************************* Display Defines *****************************
    #include "display_oled.h"
    using namespace display_OLED;
    displayOLED display;

    // ************************ MySensors Defines ****************************
    #define MY_DEBUG //!< Enable debug prints to serial monitor

    // Enable and select radio type attached
    //#define MY_RADIO_RF24 //!< nRF24L01 radio driver
    //#define MY_RADIO_NRF5_ESB //!< nRF5 radio driver (RF24 compatible)
    //#define MY_RADIO_RFM69 //!< RFM69 radio driver
    #define MY_RADIO_RFM95 //!< RFM95 radio driver
    #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_RFM95_IRQ_NUM digitalPinToInterrupt(26)
    //#define MY_SOFT_SPI_MOSO_PIN 19
    #define MY_SOFT_SPI_MOSI_PIN 27
    #define MY_SOFT_SPI_SCK_PIN 5
    #define MY_RFM95_FREQUENCY (RFM95_915MHZ)
    #define MY_TRANSPORT_STATE_TIMEOUT_MS (3*1000ul)
    #define RFM95_RETRY_TIMEOUT_MS (3000ul)
    #define MY_RFM95_MODEM_CONFIGURATION RFM95_BW125CR45SF128

    #define MY_GATEWAY_ESP32

    #define MY_WIFI_SSID SECRET_SSID
    #define MY_WIFI_PASSWORD SECRET_PASS

    // Set the hostname for the WiFi Client. This is the hostname
    // it will pass to the DHCP server if not static.
    #define MY_HOSTNAME "LoRa32_Gateway"

    // 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()
    {
    Heltec.begin(true /DisplayEnable Enable/, false /LoRa Enable/, true /Serial Enable/);

    // Setup screen
    display.init();
    display.displayPrint("Gateway", 0, 0, 2);
    display.displayPrint(networkIP(WiFi.localIP()), 128, 16, 2, TEXT_ALIGN_RIGHT);

    }

    void loop()
    {
    display.updateDisplay();
    }

    String networkIP(IPAddress ip)
    {
    String LocalIP;
    //IPAddress ip = WiFi.localIP();
    for (int i = 0; i < 4; i++)
    {
    LocalIP += i ? "." + String(ip[i]) : String(ip[i]);
    delay(10);
    }
    return LocalIP;
    }

    Does anyone have setting that work and what do you get at least initially at startup to see if it is working?

    Thanks



  • 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
    }```


  • 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
    


  • 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 Sleep is not implemented for the ESPs - see (also for reasons): https://github.com/mysensors/MySensors/issues/968

    micropet created this issue in mysensors/MySensors

    closed Please support ESP32 #968



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



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



  • 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?



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



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



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


Log in to reply
 

Suggested Topics

  • 7
  • 3
  • 19
  • 7
  • 6
  • 13
  • 1
  • 4

97
Online

10.6k
Users

10.9k
Topics

111.3k
Posts