No ID assigned by gateway.



  • Hi Folks,

    I am building a dimmer, I am unable to understand some of the abbreviations used in the 2.0Lib. The serial output is as below.

    TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    Starting sensor (RNNNA-, 2.0.0)
    TSM:INIT
    TSM:RADIO:OK
    TSP:ASSIGNID:OK (ID=2)
    TSM:FPAR
    TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    !TSM:FPAR:FAIL
    !TSM:FAILURE
    

    Could somebody please help me understand the terms used like TSP, TSM, FPAR.

    My code is as below, I am unable to register the node in Domoticz. Could somebody be kind enough to help me and point out if anything is wrong here.

    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #include <SPI.h>
    #include <MySensors.h>  
    #include <Dimmer.h>
    
    #define CHILD_ID_FAN 1
    #define FAN_CONTROL_PIN 7 //pin to control the fan/light
    #define EPROM_LIGHT_STATE 1
    #define EPROM_DIMMER_LEVEL 2
    
    #define LIGHT_OFF 0
    #define LIGHT_ON 1
    
    Dimmer dimmer(FAN_CONTROL_PIN, DIMMER_RAMP,2,50);
    
    #define SN "Fan Speed Controller"
    #define SV "1.0"
    
    int LastLightState=LIGHT_OFF;
    int LastDimValue=100;
    
    MyMessage lightMsg(CHILD_ID_FAN, V_STATUS);
    MyMessage dimmerMsg(CHILD_ID_FAN, V_PERCENTAGE);
    
    void setup()  
    { 
      //Retreive our last light state from the eprom
      int LightState=loadState(EPROM_LIGHT_STATE); 
      if (LightState<=1) {
        LastLightState=LightState;
        int DimValue=loadState(EPROM_DIMMER_LEVEL); 
        if ((DimValue>0)&&(DimValue<=100)) {
          //There should be no Dim value of 0, this would mean LIGHT_OFF
          LastDimValue=DimValue;
        }
      }
    
      dimmer.begin();
      
      //Here you actualy switch on/off the light with the last known dim level
      SetCurrentState2Hardware();
      
      Serial.println( "Node ready to receive messages..." );  
    }
    
    void presentation() {
      // Send the Sketch Version Information to the Gateway
      sendSketchInfo(SN, SV);
    
      present(CHILD_ID_FAN, S_DIMMER );
    }
    
    void loop()      
    {
    }
    
    void receive(const MyMessage &message)
    {
      if (message.type == V_STATUS) {
        Serial.println( "V_LIGHT command received..." );
        
        int lstate= atoi( message.data );
        if ((lstate<0)||(lstate>1)) {
          Serial.println( "V_LIGHT data invalid (should be 0/1)" );
          return;
        }
        LastLightState=lstate;
        saveState(EPROM_LIGHT_STATE, LastLightState);
        
        if ((LastLightState==LIGHT_ON)&&(LastDimValue==0)) {
           //In the case that the Light State = On, but the dimmer value is zero,
           //then something (probably the controller) did something wrong,
           //for the Dim value to 100%
          LastDimValue=100;
          saveState(EPROM_DIMMER_LEVEL, LastDimValue);
        }
        
        //When receiving a V_LIGHT command we switch the light between OFF and the last received dimmer value
        //This means if you previously set the lights dimmer value to 50%, and turn the light ON
        //it will do so at 50%
      }
      else if (message.type == V_PERCENTAGE) {
        Serial.println( "V_DIMMER command received..." );  
        int dimvalue= atoi( message.data );
        if ((dimvalue<0)||(dimvalue>100)) {
          Serial.println( "V_DIMMER data invalid (should be 0..100)" );
          return;
        }
        if (dimvalue==0) {
          LastLightState=LIGHT_OFF;
        }
        else {
          LastLightState=LIGHT_ON;
          LastDimValue=dimvalue;
          saveState(EPROM_DIMMER_LEVEL, LastDimValue);
        }
      }
      else {
        Serial.println( "Invalid command received..." );  
        return;
      }
    
      //Here you set the actual light state/level
      SetCurrentState2Hardware();
    }
    
    void SetCurrentState2Hardware()
    {
      if (LastLightState==LIGHT_OFF) {
         Serial.println( "Light state: OFF" );
         dimmer.off();
      }
      else {
         Serial.print( "Light state: ON, Level: " );
         Serial.println( LastDimValue );
         dimmer.set(LastDimValue);
      }
    
      //Send current state to the controller
      SendCurrentState2Controller();
    }
    
    void SendCurrentState2Controller()
    {
      if ((LastLightState==LIGHT_OFF)||(LastDimValue==0)) {
        send(dimmerMsg.set(0));
      }
      else {
        send(dimmerMsg.set(LastDimValue));
      }
    }
    

  • Plugin Developer

    @Suresh-Mali said:

    I am building a dimmer, I am unable to understand some of the abbreviations used in the 2.0Lib. The serial output is as below.
    Could somebody please help me understand the terms used like TSP, TSM, FPAR.

    For this you can refer, on source code or on doc page on jenkins

    I do not know about Domoticz. I never worked on this controller.

    @hek do we host this doc somewhere on mysensors.org website?


  • Admin

    @jkandasa said:

    @hek do we host this doc somewhere on mysensors.org website?

    No, I haven't found a good way of integrating it into the main site yet (with the same look and feel). There is a few links to the doc on the main site though.


  • Plugin Developer

    @hek said:

    No, I haven't found a good way of integrating it into the main site yet (with the same look and feel). There is a few links to the doc on the main site though.

    Looks like we have customize option on doxygen



  • I am still unable to figure out why the node is not getting registered on gateway.
    The Serial output of Gateway

    0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSM:RADIO:OK
    0;255;3;0;9;TSM:GW MODE
    0;255;3;0;9;TSM:READY
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.0.0
    0;255;3;0;9;No registration required
    0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
    0;255;3;0;9;TSP:MSG:READ 0-0-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSP:MSG:BC
    0;255;3;0;9;TSP:MSG:READ 0-0-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSP:MSG:BC
    0;255;3;0;9;TSP:MSG:READ 0-0-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSP:MSG:BC
    

    The serial Output of Node:

    Starting sensor (RNNNA-, 2.0.0)
    TSM:INIT
    TSM:RADIO:OK
    !TSP:ASSIGNID:FAIL (ID=0)
    !TSM:FAILURE
    TSM:PDT
    TSM:FPAR
    TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    !TSM:FPAR:FAIL
    !TSM:FAILURE
    TSM:PDT
    

    What could be the failure here. Itried clearing the EEPROM on both Gateway and Node, changed power supply on Node, but nothing is working.
    I know Gateway is fine because I had another node and it sends data and it shows up on Gateway.
    Somebody please help. Thanks



  • I tried debugging with MYSController. It seems the node and gateway are not communicating. The Gateway receives the messages but does not assigns ID to node. I tried assigning static ID to both Node and Gateway, but its fails.
    What started as Dimmer module not working has turned to no communication between nodes on 2.0lib.
    I'll probably wait until the MySensors 2.0 lib is stable and there is proper documentation. For now rolling back to 1.5lib seems the best choice I have got.

    The forum is there to help but it has mix of 1.5 and 2.0 lib its like hunting in a haystack for documentation and support. Please find a way to separate the 2.0 and below 2.0 lib. Thanks



  • After filding around a lot with the MySensor2.0 lib and spending my whole weekend, when I could not get things going I finally switched back to MySensors1.5.4. After that I made quick progress and my node was on network. Here is the link below of a working Dimmer node.

    MySensors AC 220v Dimmer with Domoticz – 01:42
    — S Kumar



Suggested Topics

61
Online

11.4k
Users

11.1k
Topics

112.7k
Posts