Sensors node startup without gateway



  • Hi,

    I made quite a number of MySensor devices. Easy reliable and cheap. I use the NRF24 chips.

    However: sometimes my raspi sensor gateway crashes and then I am in trouble: my sensors do not start up when they do not find a gateway.

    I know what you think; whats a point of a MySensor device starting up, when the gateway is not present - the point is that I have some critical devices which would work perfectly well without the gateway and an aerial connection (I would just lack remote control and status update) e.g. light switches, RGB lights, fan control, etc.

    I am working at another city during the week .. guess what
    Any ideas ?

    thanks,
    Lars my wife tells me when my devices do stop working during my absence ... not funny 😞

    So I am looking for a way to bypass sensor initialization in case the gateway is not found. Then at least my devices would work offline using buttons.



  • @lars-deutsch This topic has come up before and I don't know what if any progress there is on it, but why not fix the crashes in the gateway for the time being. I am sure if you post more information here as far as what problems you are having with the gateway, people will probably help you figure out why it is crashing.

    What controller software are you using? I would assume because you are using nRF24 radios at your nodes that you have a serial gateway? Tell us more about your setup.


  • Hero Member

    @lars-deutsch Have a look at this post



  • I have tried to work around the node initialization process without a gateway. Set static parent ID and set check uplink to false. The log shows node initialize completed, that is as far as it gets. So there is no way to properly initialize a node without a gateway.

    RFM69 transceiver workable solution is to implement RFM69 library and MyMessage.h. This is a one way communication. You can construct a MySensors message format and send to Gateway. You cannot receive data from controller.

    See attached sketch for RFM69HW transceiver.

    #include <RFM69.h>
    #include "MyMessage.h"
    
    // Construct a MySensors Message
    MyMessage SmokeSensorMsg(MyMessage &msg, uint8_t destination, uint8_t sensor, uint8_t command, uint8_t type, bool ack = false)
    {
      msg.sender = NODEID;
      msg.destination = destination;
      msg.sensor = sensor;
      msg.type = type;
      mSetCommand(msg,command);
      mSetRequestAck(msg,ack);
      mSetAck(msg,false);
      mSetPayloadType(msg, P_BYTE);
      return msg;
    }
    
    void Loop()
    {
       // Send message to Gateway
           typedef MyMessage message;     
           message msg = SmokeSensorMsg(msg, 
                            GATEWAYID, 
                            smokeSensorId, 
                            C_SET, 
                            V_TRIPPED, 
                            false);
      msg.bValue = (smokeReading > smoke_threshold)?1:0;  
         radio.send(GATEWAYID, (const void*)(&msg), sizeof(msg));
        
         }
    


  • @andy-phan Can you please edit your post and put your code in a code block? Just highlight your code and click the </> button at the top.



  • This post is deleted!

  • Mod

    It is quite odd that the gateway crashes. I had other problems but gateway has been running pretty much all the time


Log in to reply
 

Suggested Topics

19
Online

11.4k
Users

11.1k
Topics

112.7k
Posts