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
E

erangaj

@erangaj
About
Posts
13
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Why I quit using MySensors for actuators
    E erangaj

    I used relays. Most commands sent to actuators resulted in NACKs. But sensors were fine. I have tested different Arduinos, nrfs, circuits with an RPi gateway as well as a serial Arduino gateway with no luck. Problem temporary goes away when the gateway is restarted. This is true for both RPi and serial gateways.

    General Discussion

  • Why I quit using MySensors for actuators
    E erangaj

    I have the exact same problem with actuators. I tried my best to resolve the issue just like parachutesj but finally gave up mysensors for actuators and replaced them with wifi connected esp8266s. MySensors is still great for sensors, especially battery powered ones.

    General Discussion

  • Pro Mini 3.3v does not receive messages
    E erangaj

    @sundberg84 said in Pro Mini 3.3v does not receive messages:

    BAT

    Thank you for asking. BAT is soldered.

    Troubleshooting

  • Pro Mini 3.3v does not receive messages
    E erangaj

    My issue appears to be same as https://forum.mysensors.org/topic/4895/strange-behaviour-with-dc-3-3v-step-up-booster/6

    Im going to try CR123 batteries instead.

    Troubleshooting

  • Pro Mini 3.3v does not receive messages
    E erangaj

    I really don't know how it happens. Here are some pictures of the node. (I have de-soldered battery sensor voltage divider while testing.)

    alt text
    alt text
    When the booster is connected to power MCU only:
    Vin of the booster was about 2.9V and Vo was 3.3V as expected.
    alt text

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    4 TSM:INIT
    4 TSF:WUR:MS=0
    12 TSM:INIT:TSP OK
    14 TSM:INIT:STATID=32
    16 TSF:SID:OK,ID=32
    18 TSM:FPAR
    53 TSF:MSG:SEND,32-32-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    86 TSF:MSG:READ,1-1-32,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    92 TSF:MSG:FPAR OK,ID=1,D=2
    2062 TSM:FPAR:OK
    2062 TSM:ID
    2064 TSM:ID:OK
    2066 TSM:UPL
    2103 !TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
    2119 TSF:MSG:READ,0-1-32,s=255,c=3,t=25,pt=1,l=1,sg=0:2
    2125 TSF:MSG:PONG RECV,HP=2
    2129 TSM:UPL:OK
    2131 TSM:READY:ID=32,PAR=1,DIS=2
    2170 !TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
    2179 TSF:MSG:READ,0-1-32,s=255,c=3,t=25,pt=1,l=1,sg=0:2
    2185 !TSF:MSG:PONG RECV,INACTIVE
    2189 TSF:MSG:READ,0-1-32,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2234 !TSF:MSG:SEND,32-32-1-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=1,st=NACK:2.1.1
    2277 !TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=2,st=NACK:1
    2367 TSF:MSG:READ,0-1-32,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    2383 TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=11,pt=0,l=12,sg=0,ft=3,st=OK:Energy Meter
    2430 !TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=NACK:1.0
    2473 !TSF:MSG:SEND,32-32-1-0,s=1,c=0,t=13,pt=0,l=0,sg=0,ft=1,st=NACK:
    2514 !TSF:MSG:SEND,32-32-1-0,s=2,c=0,t=23,pt=0,l=0,sg=0,ft=2,st=NACK:
    2523 MCO:REG:REQ
    2537 TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=3,st=OK:2
    2545 TSF:MSG:READ,0-0-32,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    2551 TSF:MSG:READ,0-1-32,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    2557 TSF:MSG:READ,0-1-32,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    4546 TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    6590 !TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=NACK:2
    8634 !TSF:MSG:SEND,32-32-1-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=NACK:2
    10643 MCO:BGN:STP
    New pulse count:1
    10645 MCO:BGN:INIT OK,TSP=1
    Requesting last pulse count from gw
    10684 !TSF:MSG:SEND,32-32-1-0,s=2,c=2,t=24,pt=0,l=0,sg=0,ft=2,st=NACK:
    15665 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    15671 TSF:MSG:BC
    17661 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    17668 TSF:MSG:BC
    19701 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    19707 TSF:MSG:BC
    21727 TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    21733 TSF:MSG:BC
    

    When the booster is powering the entire board:
    alt text

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    4 TSM:INIT
    4 TSF:WUR:MS=0
    12 TSM:INIT:TSP OK
    14 TSM:INIT:STATID=32
    16 TSF:SID:OK,ID=32
    18 TSM:FPAR
    53 TSF:MSG:SEND,32-32-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2062 !TSM:FPAR:NO REPLY
    2064 TSM:FPAR
    2101 TSF:MSG:SEND,32-32-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2961 TSF:MSG:READ,0-0-32,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    2967 TSF:MSG:FPAR OK,ID=0,D=1
    3811 TSF:MSG:READ,1-1-32,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    4108 TSM:FPAR:OK
    4108 TSM:ID
    4110 TSM:ID:OK
    4112 TSM:UPL
    4122 TSF:MSG:SEND,32-32-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    4130 TSF:MSG:READ,0-0-32,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    4136 TSF:MSG:PONG RECV,HP=1
    4139 TSM:UPL:OK
    4141 TSM:READY:ID=32,PAR=0,DIS=1
    4179 !TSF:MSG:SEND,32-32-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
    4188 TSF:MSG:READ,0-0-32,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    4200 TSF:MSG:SEND,32-32-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=1,st=OK:2.1.1
    4210 TSF:MSG:SEND,32-32-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    4259 TSF:MSG:READ,0-0-32,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    4270 TSF:MSG:SEND,32-32-0-0,s=255,c=3,t=11,pt=0,l=12,sg=0,ft=0,st=OK:Energy Meter
    4284 TSF:MSG:SEND,32-32-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    4294 TSF:MSG:SEND,32-32-0-0,s=1,c=0,t=13,pt=0,l=0,sg=0,ft=0,st=OK:
    4306 TSF:MSG:SEND,32-32-0-0,s=2,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=OK:
    4313 MCO:REG:REQ
    4319 TSF:MSG:SEND,32-32-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    4327 TSF:MSG:READ,0-0-32,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    4333 MCO:PIM:NODE REG=1
    4335 MCO:BGN:STP
    New pulse count:1
    4337 MCO:BGN:INIT OK,TSP=1
    Requesting last pulse count from gw
    4347 TSF:MSG:SEND,32-32-0-0,s=2,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=OK:
    4397 TSF:MSG:READ,0-0-32,s=2,c=1,t=24,pt=0,l=1,sg=0:0
    Received last pulse count from gw:0
    4403 MCO:SLP:MS=20000,SMS=0,I1=255,M1=255,I2=255,M2=255
    4411 MCO:SLP:TPD
    

    The sketch (modified for home-assistant):

    // Enable debug prints
    #define MY_DEBUG
    
    #define MY_NODE_ID 32
    
    //#define MY_SIGNING_SOFT
    //#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
    //#define MY_SIGNING_REQUEST_SIGNATURES
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #include <MySensors.h>
    
    #define DIGITAL_INPUT_SENSOR 3  // The digital input you attached your light sensor.  (Only 2 and 3 generates interrupt!)
    #define RESET_PIN 7
    #define PULSE_FACTOR 1000       // Nummber of blinks per KWH of your meeter
    #define MAX_WATT 10000          // Max watt value to report. This filetrs outliers.
    #define CHILD_ID_KWH 1              // Id of the sensor child
    #define CHILD_ID_PC 2              // Id of the sensor child
    
    unsigned long SEND_FREQUENCY =  20000; // Minimum time between send (in milliseconds). We don't wnat to spam the gateway.
    double ppwh = ((double)PULSE_FACTOR)/1000; // Pulses per watt hour
    bool pcReceived = false;
    volatile unsigned long pulseCount = 0;
    unsigned long oldPulseCount = 0;
    double oldKwh;
    MyMessage kwhMsg(CHILD_ID_KWH,V_KWH);
    MyMessage pcMsg(CHILD_ID_PC,V_VAR1);
    
    bool kwhInitialValueSent = true;
    bool pcInitialValueSent = true;
    
    void setup()
    {
      // Fetch last known pulse count value from gw
     // request(CHILD_ID_PC, V_VAR1);
    
      // Use the internal pullup to be able to hook up this sketch directly to an energy meter with S0 output
      // If no pullup is used, the reported usage will be too high because of the floating pin
      pinMode(DIGITAL_INPUT_SENSOR,INPUT_PULLUP);
      pinMode(RESET_PIN, INPUT_PULLUP);
    
      attachInterrupt(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), onPulse, RISING);
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Energy Meter", "1.0");
    
      // Register this device as power sensor
      present(CHILD_ID_KWH, S_POWER);
      present(CHILD_ID_PC, S_CUSTOM);
    }
    
    void loop()
    {
    
      if (digitalRead(RESET_PIN) == LOW) {
        kwhInitialValueSent = false;
        pcInitialValueSent = false;
      }
      
      if (!kwhInitialValueSent) {
        send(kwhMsg.set((double)0, 4));  // Send kwh value to gw
        request(CHILD_ID_KWH, V_KWH);
        wait(60000, C_SET, V_KWH);
      }
      
      if (!pcInitialValueSent) {
        send(pcMsg.set(0));
        request(CHILD_ID_PC, V_VAR1);
        wait(60000, C_SET, V_VAR1);
      }
      
      if (pcReceived) {
        // Pulse cout has changed
        if (pulseCount != oldPulseCount) {
          Serial.print("Sending pulse count to gw:");
          Serial.println(pulseCount);
          send(pcMsg.set(pulseCount));  // Send pulse count value to gw
          double kwh = ((double)pulseCount/((double)PULSE_FACTOR));
          oldPulseCount = pulseCount;
          if (kwh != oldKwh) {
            send(kwhMsg.set(kwh, 4));  // Send kwh value to gw
            oldKwh = kwh;
          }
        }
      } else {
        // No count received. Try requesting it again
        Serial.println("Requesting last pulse count from gw");
        request(CHILD_ID_PC, V_VAR1);
        wait(60000, C_SET, V_VAR1);
      }
    
      sleep(SEND_FREQUENCY);
    }
    
    void receive(const MyMessage &message)
    {
      if (message.type==V_VAR1) {
        pulseCount = oldPulseCount = message.getLong();
        Serial.print("Received last pulse count from gw:");
        Serial.println(pulseCount);
        pcReceived = true;
        pcInitialValueSent = true;
      }
    
      if (message.type==V_KWH) {
        kwhInitialValueSent = true;
      }
    }
    
    void onPulse()
    {
      pulseCount++;
      Serial.print("New pulse count:");
      Serial.println(pulseCount);
    }
    
    
    

    I have tried different radios and boosters without success.

    Troubleshooting

  • Pro Mini 3.3v does not receive messages
    E erangaj

    Finally managed to fix it. It was an issue with the battery booster. In the PCB battery booster is connected to the MCU only and the radio was powered directly. Fixed by removing the booster. Now both mcu and radio 3.3v pins are connected together. Battery booster can be connected externally.

    Troubleshooting

  • Pro Mini 3.3v does not receive messages
    E erangaj

    I have multiple 5V nodes running normally and I am trying to build a battery powered 3.3V node. I have assembled three 3.3V nodes (based on 'Easy/Newbie PCB') and all three of them have the same issue.

    The sketch is the pulse energy meter sketch with sleep mode activated. Node id is hardcoded to 33. The node does not receive messages from the gateway. Gateway and the node are reasonably closer. I have tested the radio with a 5V node and it is working.

    Can someone please help me to understand the issue. Thanks.

    Node log:

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    4 TSM:INIT
    4 TSF:WUR:MS=0
    12 TSM:INIT:TSP OK
    14 TSM:INIT:STATID=33
    16 TSF:SID:OK,ID=33
    18 TSM:FPAR
    53 TSF:MSG:SEND,33-33-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2062 !TSM:FPAR:NO REPLY
    2064 TSM:FPAR
    2101 TSF:MSG:SEND,33-33-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4108 !TSM:FPAR:NO REPLY
    4110 TSM:FPAR
    4147 TSF:MSG:SEND,33-33-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6154 !TSM:FPAR:NO REPLY
    6156 TSM:FPAR
    6193 TSF:MSG:SEND,33-33-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8200 !TSM:FPAR:FAIL
    8202 TSM:FAIL:CNT=1
    8204 TSM:FAIL:PDT
    18208 TSM:FAIL:RE-INIT
    18210 TSM:INIT
    18216 TSM:INIT:TSP OK
    18221 TSM:INIT:STATID=33
    18223 TSF:SID:OK,ID=33
    18225 TSM:FPAR
    18262 TSF:MSG:SEND,33-33-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    20271 !TSM:FPAR:NO REPLY
    20273 TSM:FPAR
    20310 TSF:MSG:SEND,33-33-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    20979 TSF:MSG:READ,1-1-33,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    20985 TSF:MSG:FPAR OK,ID=1,D=2
    21254 TSF:MSG:READ,0-0-33,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    21260 TSF:MSG:FPAR OK,ID=0,D=1
    22319 TSM:FPAR:OK
    22321 TSM:ID
    22321 TSM:ID:OK
    22323 TSM:UPL
    22331 TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    24340 TSM:UPL
    24344 TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    24352 TSF:MSG:READ,0-0-33,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    24358 TSF:MSG:PONG RECV,HP=1
    24363 TSM:UPL:OK
    24365 TSM:READY:ID=33,PAR=0,DIS=1
    24373 TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    26386 TSF:MSG:SEND,33-33-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
    26400 TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    28430 TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=11,pt=0,l=12,sg=0,ft=0,st=OK:Energy Meter
    28442 TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    28467 TSF:MSG:SEND,33-33-0-0,s=1,c=0,t=13,pt=0,l=0,sg=0,ft=0,st=OK:
    28487 TSF:MSG:SEND,33-33-0-0,s=2,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=OK:
    28493 MCO:REG:REQ
    28532 !TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=NACK:2
    30547 TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=OK:2
    32589 !TSF:MSG:SEND,33-33-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=NACK:2
    

    GW log (rpi):

    TSF:MSG:READ,33-33-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    TSF:MSG:BC
    TSF:MSG:FPAR REQ,ID=33
    TSF:CKU:OK,FCTRL
    TSF:MSG:GWL OK
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    TSF:MSG:READ,33-33-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    TSF:MSG:BC
    TSF:MSG:FPAR REQ,ID=33
    TSF:CKU:OK,FCTRL
    TSF:MSG:GWL OK
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    TSF:MSG:READ,33-33-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    TSF:MSG:BC
    TSF:MSG:FPAR REQ,ID=33
    TSF:CKU:OK,FCTRL
    TSF:MSG:GWL OK
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    TSF:MSG:READ,33-33-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    TSF:MSG:BC
    TSF:MSG:FPAR REQ,ID=33
    TSF:CKU:OK,FCTRL
    TSF:MSG:GWL OK
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    TSF:MSG:READ,33-33-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    TSF:MSG:BC
    TSF:MSG:FPAR REQ,ID=33
    TSF:PNG:SEND,TO=0
    TSF:CKU:OK
    TSF:MSG:GWL OK
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
    TSF:MSG:READ,1-1-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    TSF:MSG:PINGED,ID=1,HP=1
    TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    TSF:MSG:READ,33-33-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    TSF:MSG:BC
    TSF:MSG:FPAR REQ,ID=33
    TSF:CKU:OK,FCTRL
    TSF:MSG:GWL OK
    TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    TSF:MSG:READ,33-33-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    TSF:MSG:PINGED,ID=33,HP=1
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1
    TSF:MSG:READ,33-33-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    TSF:MSG:PINGED,ID=33,HP=1
    TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    TSF:MSG:READ,33-33-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
    TSF:MSG:READ,33-33-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.1.1
    Sending message on topic: mysensors-out/33/255/0/0/17
    TSF:MSG:READ,33-33-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    Sending message on topic: mysensors-out/33/255/3/0/6
    Message arrived on topic: mysensors-in/33/255/3/0/6
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=6,pt=0,l=1,sg=0,ft=0,st=NACK:M
    TSF:MSG:READ,33-33-0,s=255,c=3,t=11,pt=0,l=12,sg=0:Energy Meter
    Sending message on topic: mysensors-out/33/255/3/0/11
    TSF:MSG:READ,33-33-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    Sending message on topic: mysensors-out/33/255/3/0/12
    TSF:MSG:READ,33-33-0,s=1,c=0,t=13,pt=0,l=0,sg=0:
    Sending message on topic: mysensors-out/33/1/0/0/13
    TSF:MSG:READ,33-33-0,s=2,c=0,t=23,pt=0,l=0,sg=0:
    Sending message on topic: mysensors-out/33/2/0/0/23
    TSF:MSG:READ,33-33-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=NACK:1
    TSF:MSG:READ,33-33-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=NACK:1
    TSF:MSG:READ,33-33-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    !TSF:MSG:SEND,0-0-33-33,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=NACK:1
    
    Troubleshooting

  • Frequent !TSF:MSG:SIGN FAIL issues
    E erangaj

    @Anticimex Yes, but it is running for hours. Never saw the issue again.

    Troubleshooting

  • Frequent !TSF:MSG:SIGN FAIL issues
    E erangaj

    Thanks. I went through all the recommendations and tried different radio modules. But the result was the same. The NACKs happen when sending from node to the gateway but not in the opposite direction. Finally decided sign the messages going from the gateway to nodes only and leave node to gateway messages unsigned. It is a compromised solution, but it is enough for my needs. (recompiled the gateway with "--my-signing=software" flag but not "--my-signing-request-signatures" flag, nodes were not changed)

    Troubleshooting

  • Frequent !TSF:MSG:SIGN FAIL issues
    E erangaj

    I have a motion sensor + repeater node and a rpi gateway. rpi gateway is compiled with "--my-signing=software" and "--my-signing-request-signatures" flags. Below settings are configured in the node.

    #define MY_SIGNING_SOFT
    #define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
    #define MY_SIGNING_REQUEST_SIGNATURES

    As shown below I sometimes see seemingly random, but frequent "!TSF:MSG:SIGN FAIL" messages

    ***************** Motion:1
    268194 TSF:MSG:SEND,1-1-0-0,s=4,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=OK:
    268201 TSF:MSG:READ,0-0-1,s=255,c=3,t=17,pt=6,l=25,sg=1:837C71E827A0793D6D50A9666BE92B0DF1D500008BA9900E91
    268296 TSF:MSG:SEND,1-1-0-0,s=4,c=1,t=16,pt=0,l=1,sg=1,ft=0,st=OK:1
    ***************** Motion:0
    332350 !TSF:MSG:SEND,1-1-0-0,s=4,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=NACK:
    332356 !TSF:MSG:SIGN FAIL
    332359 TSF:MSG:READ,0-0-1,s=255,c=3,t=17,pt=6,l=25,sg=1:8974C67AA563CB9ADFF58F8B31CC4760119CAB95239CA3C4F9

    How can I get rid of this issue? Thanks in advance.

    Troubleshooting

  • Home Assistant does not recognise the switch
    E erangaj

    @martinhjelmare Thank you for taking the time to write a very informative reply. It resolved the problem. At this stage my aim is to use it as a simple on / off type switch to control the screen from automation scripts. I used delay instead of wait since wait() didn't power up the radio automatically to receive messages. But with the modified script I use wait() since it sends a status message at the end and it wakes up the radio again.

    Home Assistant

  • Home Assistant does not recognise the switch
    E erangaj

    I converted it into a standard distance sensor with the sample distance sensor sketch. Now I can see the incoming messages on hass log as below. But the new sensor is not visible in any screen.

    17-01-29 10:04:32 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    17-01-29 10:04:32 DEBUG (Thread-17) [mysensors.mysensors] Received 1;1;1;0;13;126
    
    17-01-29 10:04:32 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    17-01-29 10:04:33 DEBUG (Thread-17) [mysensors.mysensors] Received 1;1;1;0;13;127
    
    17-01-29 10:04:33 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    17-01-29 10:04:33 DEBUG (Thread-17) [mysensors.mysensors] Received 1;1;1;0;13;128
    
    17-01-29 10:04:33 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    17-01-29 10:04:33 DEBUG (Thread-17) [mysensors.mysensors] Received 1;1;1;0;13;127
    
    17-01-29 10:04:33 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    17-01-29 10:04:34 DEBUG (Thread-17) [mysensors.mysensors] Received 1;1;1;0;13;128
    
    17-01-29 10:04:34 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    17-01-29 10:04:34 DEBUG (Thread-17) [mysensors.mysensors] Received 1;1;1;0;13;127
    
    17-01-29 10:04:34 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    17-01-29 10:04:34 DEBUG (Thread-17) [mysensors.mysensors] Received 1;1;1;0;13;129
    
    17-01-29 10:04:34 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    17-01-29 10:04:35 DEBUG (Thread-17) [mysensors.mysensors] Received 1;1;1;0;13;127
    
    17-01-29 10:04:35 DEBUG (Thread-17) [homeassistant.components.mysensors] Update sensor_update: node 1
    
    Home Assistant

  • Home Assistant does not recognise the switch
    E erangaj

    I created a sketch to control a motorised projector screen of a home theatre. The sketch includes 3 relays that are connected to the up, down and stop buttons of the projector screen and a distance sensor to sense the screen. I used a rpi ethernet gateway running on the same rpi as home assistant. The sketch works correctly with MYSController. At the startup home assistant adds the node to to mysensors.json file. But I don't see the switch on Home Assistant default view / States screen / Services screen or logs. Can anyone help me.

    Thanks in advance.

    configuration.yaml

    logger:
      default: info
      logs:
        mysensors: debug
        homeassistant.components.mysensors: debug
    
    mysensors:
      gateways:
        - device: '127.0.0.1'
          persistence_file: '/home/homeassistant/.homeassistant/mysensors.json'
          tcp_port: 5003
      debug: true
      optimistic: true
      persistence: true
      #retain: true
      version: 2.0
    

    mysensors.json:

    {"0": {"sketch_name": null, "children": {}, "type": 18, "sensor_id": 0, "battery_level": 0, "sketch_version": null, "protocol_version": "2.1.1"}, "254": {"sketch_name": "ScreenController", "children": {"1": {"id": 1, "values": {}, "description": "", "type": 3}}, "type": 17, "sensor_id": 254, "battery_level": 0, "sketch_version": "1.0", "protocol_version": "2.1.1"}}
    

    hass log (mysensors related entries):

    17-01-29 07:37:41 INFO (MainThread) [homeassistant.loader] Loaded mysensors from homeassistant.components.mysensors
    17-01-29 07:38:00 INFO (MainThread) [homeassistant.bootstrap] Setting up mysensors
    17-01-29 07:38:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=mysensors>
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: discovered=, platform=mysensors, service=load_platform.sensor>
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.loader] Loaded sensor.mysensors from homeassistant.components.sensor.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: discovered=, platform=mysensors, service=load_platform.switch>
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: discovered=, platform=mysensors, service=load_platform.light>
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: discovered=, platform=mysensors, service=load_platform.binary_sensor>
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.loader] Loaded switch.mysensors from homeassistant.components.switch.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: discovered=, platform=mysensors, service=load_platform.climate>
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.loader] Loaded light.mysensors from homeassistant.components.light.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.loader] Loaded binary_sensor.mysensors from homeassistant.components.binary_sensor.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.components.switch] Setting up switch.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.loader] Loaded climate.mysensors from homeassistant.components.climate.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.components.light] Setting up light.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.components.climate] Setting up climate.mysensors
    17-01-29 07:38:24 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=switch, service=mysensors_send_ir_code>
    17-01-29 07:38:25 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: discovered=, platform=mysensors, service=load_platform.cover>
    17-01-29 07:38:25 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: discovered=name=mysensors, platform=mysensors, service=load_platform.notify>
    17-01-29 07:38:25 INFO (MainThread) [homeassistant.loader] Loaded cover.mysensors from homeassistant.components.cover.mysensors
    17-01-29 07:38:25 INFO (MainThread) [homeassistant.loader] Loaded notify.mysensors from homeassistant.components.notify.mysensors
    17-01-29 07:38:25 INFO (MainThread) [homeassistant.components.cover] Setting up cover.mysensors
    17-01-29 07:38:25 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=notify, service=mysensors>
    17-01-29 07:38:25 INFO (Thread-17) [mysensors.mysensors] Trying to connect to ('127.0.0.1', 5003)
    17-01-29 07:38:25 DEBUG (Thread-5) [homeassistant.components.mysensors] Update persistence: node 0
    17-01-29 07:38:25 INFO (Thread-5) [homeassistant.components.mysensors] No sketch_name: node 0
    17-01-29 07:38:25 INFO (Thread-5) [homeassistant.components.mysensors] No sketch_name: node 0
    17-01-29 07:38:25 INFO (Thread-17) [mysensors.mysensors] Connected to ('127.0.0.1', 5003)
    17-01-29 07:38:25 INFO (Thread-5) [homeassistant.components.mysensors] No sketch_name: node 0
    17-01-29 07:38:25 INFO (Thread-5) [homeassistant.components.mysensors] No sketch_name: node 0
    17-01-29 07:38:25 INFO (Thread-5) [homeassistant.components.mysensors] No sketch_name: node 0
    17-01-29 07:38:25 DEBUG (Thread-17) [mysensors.mysensors] Received 0;255;3;0;14;Gateway startup complete.
    17-01-29 07:38:25 INFO (Thread-5) [homeassistant.components.mysensors] No sketch_name: node 0
    17-01-29 07:38:25 INFO (Thread-5) [homeassistant.components.mysensors] No sketch_name: node 0
    17-01-29 07:38:25 DEBUG (Thread-5) [homeassistant.components.mysensors] Update persistence: node 254
    17-01-29 07:58:01 DEBUG (Thread-17) [mysensors.mysensors] Received 254;255;3;0;21;0
    17-01-29 08:18:02 DEBUG (Thread-17) [mysensors.mysensors] Received 254;255;3;0;21;0
    

    Sketch:

    // Enable debug prints to serial monitor
    //#define MY_DEBUG 
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    #include <NewPing.h>
    
    // Enable repeater functionality for this node
    //#define MY_REPEATER_FEATURE
    
    #include <SPI.h>
    #include <MySensors.h>
    
    #define CHILD_ID 1
    #define NUMBER_OF_RELAYS 3 // Total number of attached relays
    #define RELAY_UP 3         // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define RELAY_UP_ON 0      // GPIO value to write to turn on attached relay
    #define RELAY_UP_OFF 1     // GPIO value to write to turn off attached relay
    #define RELAY_DOWN 4         // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define RELAY_DOWN_ON 0      // GPIO value to write to turn on attached relay
    #define RELAY_DOWN_OFF 1     // GPIO value to write to turn off attached relay
    #define RELAY_STOP 7         // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define RELAY_STOP_ON 1      // GPIO value to write to turn on attached relay
    #define RELAY_STOP_OFF 0     // GPIO value to write to turn off attached relay
    
    // Sonar
    #define TRIGGER_PIN  6  // Arduino pin tied to trigger pin on the ultrasonic sensor.
    #define ECHO_PIN     5  // 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.
    #define SCREEN_DISTANCE 20
    unsigned long SLEEP_TIME = 500; // Sleep time between reads (in milliseconds)
    
    NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
    boolean lastVal = false;
    
    void before() { 
      pinMode(RELAY_UP, OUTPUT);
      digitalWrite(RELAY_UP, RELAY_UP_OFF);
      pinMode(RELAY_DOWN, OUTPUT);
      digitalWrite(RELAY_DOWN, RELAY_DOWN_OFF);
      pinMode(RELAY_STOP, OUTPUT);
      digitalWrite(RELAY_STOP, RELAY_STOP_OFF);
    }
    
    void setup() {
      
    }
    
    void presentation()  
    {   
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("ScreenController", "1.0");
      present(CHILD_ID, S_BINARY);
    }
    
    
    void loop() 
    {
    }
    
    boolean isOpen() {
      int dist = sonar.ping_cm();
      if (dist < 1) {
        return lastVal;
      }
      lastVal = (dist < SCREEN_DISTANCE);
      return lastVal;
    }
    
    void receive(const MyMessage &message) {
      // We only expect one type of message from controller. But we better check anyway.
      if (message.type==V_STATUS) {
        boolean val = message.getBool();
        if (val) {
          if (!isOpen()) {
            digitalWrite(RELAY_DOWN, RELAY_DOWN_ON);
            delay(SLEEP_TIME);
            digitalWrite(RELAY_DOWN, RELAY_DOWN_OFF);
    
            int x = 0;
            while(!isOpen() && x < 150) {
              x++;
              delay(SLEEP_TIME);
            }
    
            digitalWrite(RELAY_STOP, RELAY_STOP_ON);
            delay(SLEEP_TIME);
            digitalWrite(RELAY_STOP, RELAY_STOP_OFF);
          }
        } else {
            digitalWrite(RELAY_UP, RELAY_UP_ON);
            delay(SLEEP_TIME);
            digitalWrite(RELAY_UP, RELAY_UP_OFF);
        }
         // Write some debug info
         //Serial.print(message.sensor);
       } 
    }
    
    Home Assistant
  • Login

  • Don't have an account? Register

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