Signing fails with V2.1



  • Hello,

    after upgrading the Mysensors lib to 2.1 i have problems with signing. My controller is an fhem installation. The gateway is a uno + w5100 shield an fΓΌr hardware signing the sha204 chip. It works fine before upgrading!

    The log from gateway shows:

    0;255;3;0;9;TSF:MS0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGAA-,VER=2.1.0
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    IP: 10.10.1.200
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;Eth: connect
    0;255;3;0;9;Eth: 0;0;3;0;2;
    0;255;3;0;9;TSF:MSG:READ,100-100-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:BC
    0;255;3;0;9;TSF:MSG:FPAR REQ,ID=100
    0;255;3;0;9;TSF:PNG:SEND,TO=0
    0;255;3;0;9;TSF:CKU:OK
    0;255;3;0;9;TSF:MSG:GWL OK
    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    0;255;3;0;9;TSF:MSG:PINGED,ID=100,HP=1
    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0101
    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.1.0
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=11,pt=0,l=18,sg=0:Temperature Sensor
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.1
    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=OK:
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=17,pt=6,l=25,sg=0:D92604929E5EB761DCFAE3EB153D56C18FD2C48183AF74E5A4
    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=27,pt=1,l=1,sg=1,ft=0,st=OK:1
    

    The inclusion mode is activated and the personalization sketch was an both gateway and sensor installed again.

    Any ideas?

    Markus



  • Test with deactivated Signing Support is ok, works fine then! Don't know whats's going on here.... 😞


  • Mod

    @markush signing uses the full length of the radio packet, which strains the radio more than short messages.
    Seems like the same problem as the one being discussed in https://forum.mysensors.org/topic/5763/after-upgrade-to-mysensors-2-1-problems-with-radio-module-might-manifest-itself-more


  • Admin

    @markush Please upload both sketches (GW and node) I'd like to test something.




  • Admin

    @markush Can you comment MY_SIGNING_REQUEST_SIGNATURES in your GW sketch and retry?



  • I have tried - it works:

    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=OK:
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=17,pt=6,l=25,sg=0:5F5A06980FF60C862E0DE419EF37D668845FED6E7A0355160A
    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=6,pt=0,l=1,sg=1,ft=0,st=OK:M
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=11,pt=0,l=18,sg=0:Temperature Sensor
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.1
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=0,c=0,t=6,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=OK:
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=255,c=3,t=17,pt=6,l=25,sg=0:CB90575D8E5A349B0EE2F383180DB837A9F0B4B8BCBB1B02BC
    0;255;3;0;9;TSF:MSG:SEND,0-0-100-100,s=255,c=3,t=27,pt=1,l=1,sg=1,ft=0,st=OK:1
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=0,c=1,t=0,pt=7,l=5,sg=0:16.9
    0;255;3;0;9;TSF:MSG:READ,100-100-0,s=0,c=1,t=0,pt=7,l=5,sg=0:17.0```
    
    And now? I need this option, not?

  • Admin

    @markush Thanks for testing, the bug has been insolated and bug fix created: https://github.com/mysensors/MySensors/pull/740



  • Thanks! Now it works as expected! πŸ˜ƒ



  • I am using MySensors 2.1.1 and see a lot of these messages

    0;255;3;0;9;!TSF:MSG:SIGN VERIFY FAIL
    

    As a test I use 2 nodes with this same sketch:

    #include "arduino.h"
    #include <OneWire.h>
    #include <DallasTemperature.h>
    
    #define ONE_WIRE_BUS 5
    OneWire oneWire(ONE_WIRE_BUS);
    DallasTemperature sensors(&oneWire);
    
    #define MY_DEBUG 
    
    #define MY_RADIO_RFM69
    #define MY_IS_RFM69HW
    
    #define MY_NODE_ID 11     // node 1
    //#define MY_NODE_ID 12  // node 2
    
    #define MY_DEFAULT_ERR_LED_PIN 9  
    #define MY_DEFAULT_RX_LED_PIN  8  
    #define MY_DEFAULT_TX_LED_PIN  7 
    #define MY_DEFAULT_LED_BLINK_PERIOD 20
    
    #define MY_SIGNING_SOFT
    #define MY_SIGNING_SOFT_RANDOMSEED_PIN 3
    #define MY_SIGNING_REQUEST_SIGNATURES
    
    #include <MySensors.h>
    
    MyMessage msg(MY_NODE_ID, V_TEMP);
    
    void presentation()
    {
    	sendSketchInfo("Test temperature node", "1.0");
    	present(MY_NODE_ID, S_TEMP);
    }
    
    void setup()
    {
    	sensors.begin();
    }
    
    void loop()
    {
      sensors.requestTemperatures();
      send(msg.set(sensors.getTempCByIndex(0), 2));
    
      sleep(1000);
    }
    

    I use this serial gateway:

    #define MY_DEBUG
    
    #define MY_SIGNING_SOFT
    #define MY_SIGNING_SOFT_RANDOMSEED_PIN 3
    #define MY_SIGNING_REQUEST_SIGNATURES
    
    #define MY_RADIO_RFM69
    #define MY_IS_RFM69HW
    
    #define MY_GATEWAY_SERIAL
    
    #define MY_DEFAULT_LED_BLINK_PERIOD 10
    #define MY_DEFAULT_ERR_LED_PIN 5  
    #define MY_DEFAULT_RX_LED_PIN  6  
    #define MY_DEFAULT_TX_LED_PIN  7  
    
    #include <SPI.h>
    #include <MySensors.h>
       
    void setup() {}
    void presentation() {}
    void loop() {}
    

    If I comment this line in the gateway everything works fine:

    //#define MY_SIGNING_REQUEST_SIGNATURES
    

    I only see these error messages when I turn on both nodes.
    If I use either Node 1 or Node 2 and turn the other off, I don't see any of these error messages.

    The nodes and gateway are on my workbench close next to each other.
    For each I use a bare ATMEGA328P burned with bootloader Pro Mini 3.3v 8 mhz


Log in to reply
 

Suggested Topics

  • 3
  • 2
  • 3
  • 15
  • 24
  • 4

23
Online

11.2k
Users

11.1k
Topics

112.5k
Posts