Signing fail - RFM69HW



  • I'm wrestling to get my network going.
    If I remove the signing, it works perfectly. Once I add the signing, gw responses always end with "signing failed" and thus no connections.

    I'm just going to show sketches for gw (LolinV3 NodeMcu1.0) and node (ProMini3.3V) and I will change the passwords and parameters once we figure this out. I will highlight the line that when commented in, causes signing failed. Always.

    I did VERBOSE_SIGNING and _RFM69: no errors, only signature failed. Signal strength -55 - -70dBm and sig-noise -99. And no NACKs!

    GW:

    /*
     * The ESP8266 MQTT gateway sends radio network data to your MQTT broker.
     *
     * LED purposes:
     * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs in your sketch
     * - ERR (red) - fast blink on error during transmission error or receive crc error
     * UPLOAD at 57600baud!
     * Board: NodeMCU 1.0, 4M 1MSPIFFS
     */
    
    #define MY_DEBUG
    #define MY_BAUD_RATE 57600
    #define MY_RADIO_RFM69
    #define MY_RFM69_FREQUENCY RFM69_868MHZ // Set your frequency here
    #define MY_IS_RFM69HW // Omit if your RFM is not "H"
    #define MY_RFM69_NEW_DRIVER
    #define MY_RFM69_NETWORKID 102
    #define MY_RFM69_ENABLE_ENCRYPTION
    #define MY_RFM69_IRQ_PIN 5 //GPIO 5 = D1
    #define MY_RFM69_IRQ_NUM MY_RFM69_IRQ_PIN
    #define MY_RFM69_CS_PIN 15 //GPIO 15 = D8
    
    #define MY_GATEWAY_MQTT_CLIENT
    #define MY_GATEWAY_ESP8266
    
    //#define MY_SIGNING_SIMPLE_PASSWD "ollila2018" // <= PROBLEM THIS LINE
    //#define MY_DEBUG_VERBOSE_SIGNING
    
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX "domoticz/in/mysenRFM69"
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "domoticz/out/mysenRFM69"
    #define MY_MQTT_CLIENT_ID "mysenRFM69"
    #define MY_MQTT_USER "zzzz"
    #define MY_MQTT_PASSWORD "ZZZZZZZZ"
    
    #define MY_WIFI_SSID "Xxxxxx"
    #define MY_WIFI_PASSWORD "Yyyyyyyy"
    #define MY_HOSTNAME "mqtt-ESP8266-gateway"
    #define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 51  //MQTT ip
    #define MY_PORT 1883   // MQTT port
    
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    // Flash leds on rx/tx/err
    #define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin D0 (GPIO 16)
    #define MY_WITH_LEDS_BLINKING_INVERSE
    
    #include <ESP8266WiFi.h>
    #include <MySensors.h>
    
    void setup()
    

    NODE:

    #define MY_DEBUG
    #define MY_BAUD_RATE 57600
    #define MY_RADIO_RFM69
    #define MY_RFM69_FREQUENCY RFM69_868MHZ // Set your frequency here
    #define MY_IS_RFM69HW // Omit if your RFM is not "H"
    #define MY_RFM69_NEW_DRIVER
    #define MY_RFM69_NETWORKID 102
    #define MY_RFM69_ENABLE_ENCRYPTION
    
    //#define MY_SIGNING_SIMPLE_PASSWD "ollila2018"   // <== PROBLEM HERE
    //#define MY_DEBUG_VERBOSE_RFM69
    //#define MY_DEBUG_VERBOSE_SIGNING                       
    
    #define MY_NODE_ID 51
    
    #include <MySensors.h>  
    

    I'm starting to suspect a bug. I don't know what else could it be?
    Also note, I have not changed MySensors.h or any "hard code"


  • Contest Winner

    @MasMat signing works. What does not work (very well) is signing with debugging on Atmega328p. That is because memory is running low. The complexity of the library increases which require more ram. At the same time stack usage increases which take up ram in the opposite direction. The build system indicate this by warning that memory usage is high and that stability problems can occur.
    When the two ends meet, the Arduino world explodes into unspecified behavior.

    Your best bet is to disable debugging and any other features that you can live without if you want to use signing. Especially SW signing (which all the "simple" variants use) cost a lot of ram so if signing is a requirement, go for a atsha204a.



  • Once the network works or I have the issue pinned down, I'll be happy to disable all extras. I noticed the weight of the signing and did the debugs one at a time in sequential uploads (time and two computers) to look for the problem.

    So your bet is a memory problem at the core of my troubles?
    If you like that, I'll happily respect your knowledge in this. And I'll see if it works with minimal moving parts.


  • Contest Winner

    @MasMat that is my best bet, yes. Slice it all the way down and see if it makes a difference. If there is no difference with and without debug, post the debug output and I can take a look.
    Another thing thar can fail is that with signing, messages max out so the odds for NACKs increase, which the signing backend is not tolerant against.



  • Did you solve the issue? When setup signing & encryption 2 years ago I had to use Mysensors development version to get it working. I also had to remove the analog input on a node because that was to mutch for the promini.


Log in to reply
 

Suggested Topics

  • 5
  • 14
  • 9
  • 6
  • 12
  • 12
  • 5
  • 3

169
Online

9.5k
Users

10.1k
Topics

105.2k
Posts