Error sending switch command, check device/hardware !



  • Hi!
    I have the same behaviour on Domoticz running on a Raspberry PI type A Image v2.3530 or a Windows PC with Domoticz v2.3771.
    I've created DIY Humidity Motion and Door Sensors working fine.
    Unfortunately with Relay or Dimmer Sensors DIY, each time I try to turn ON or OFF, I have the same message: "Error sending switch command, check device/hardware !"
    I try to changed GW, sensors, ... but there is the same situation, and nothing is indicated in the Domoticz log.
    On the Sensor log, we can see only read and send from another sensor, but nothing from GW.
    I didn't implemant an inclusion button as all my sensors are listed in Domoticz; do you know where I could try to troubleshootig now please?
    Thanks for your help!


  • Hardware Contributor

    This happens to me on my switches as well if the power goes down and i need to restart Domoticz.
    Doesnt it work stright after you restart the node?
    The switch command isnt displayed in the log.


  • Admin

    The gateway code running on RPI doesn't remember routing information when restated (the EEPROM emulation is just in-memory).

    This means you have to restart the actuator nodes after RPI was restarted to fill the routing information again.

    It's on the grand TODO list. Anyone: Feel free to fix.



  • Hi,

    Despite I turn on and turn off the GW, turn on and turn off the RPI, and reinstall completely the GW, each time I reboot the RPI a new/same sensor appears:
    upload-f18eae08-3abe-40e6-ac13-851425909d7a
    If I click on Refresh, nothing happend. I try also to put the GW directly to the RPI, not through a USB port self powered for the same result. Last try is to reinstall Domoticz (already done a few days ago...but with not), or go to another interface on RPI for MySensors.


  • Hardware Contributor

    @Elfnoir Did you try to restart the sensor/actuator like Hek advised as all you have replied eith is that you have tried to restart the GW again.



  • Hi,

    I restart the sensor/actuator and the GW again without good results.
    But it appears I had 2 GW broken!

    Now I build a new one, and all is running good. Thanks!


  • Hardware Contributor

    It would have been nice to figure out the issue here so others had a solution, incase they was getting the same result.

    Glad to hear you have working gateways now though!



  • When the GW booting in Domoticz, I add no information on the Release used.
    In Domoticz, the Release was '?'
    I received all information from my sensors, but not able to send status modifications (ON/OFF).

    The GW I used was an arduino pro mini plugged in RPI with a TTL adaptator.
    Now I'm with an arduino UNO plugged directly to my RPI, and I purchased a NANO!



  • @Elfnoir @hek I see this old issue is still with us in MySensor 2.3.2 / Domoticz 4.10717.

    I am working on upgrading a couple of existing Mysensor 1.5 networks to the latest version and am again running into this behavior of getting the dreaded error message: "Error sending switch command, check device/hardware !" from the Domoticz UI when trying to send commands from the controller to Relay nodes. Even just using the relay example from the lib shows the problem. I am convinced that this is not a common HW issue as often blamed. The issue has been verified with a multitude of HW and I see no other communication issues such as range etc.

    So, the problem shows up on any message sent from the controller to a node. For testing purposes the network has only the Gateway and one Relay node. When clicking on the Lightbulb device to affect the relay most times, but not always, you see the error message after the timeout, even though the command was received and handled by the device right away. You also see that the controller sends the command a second time, when this happens ( about 90% of the times) .. No change in network frequency or phase of the moon makes a difference here.

    Now here is what I found that did make a difference:

    When I go on the Domoticz UI under "Setup/Hardware" and drill down through the Gateway "Setup" link to the Node and then select the child under scrutiny, I see at the bottom of the page an On/OFF selector labeled "ACK" together with a timeout value of 1200 . If I turn this "ACK" off then the node works flawlessly -- a million times / forth and back and even through power failures of the gateway/controller. I see only one command sent and no error messages ever.

    Upon further investigation I further found that right after initial inclusion of a node this "ACK" feature seems to be off. The node works without retires/ error messages, however only until you go and update it with a name for example, then the ACK features gets turned on by default.

    Now the question to @hek is : What is this "ACK" feature doing-to/expecting-from a node. Is this looking at the HW ACK from the NRF24 radio and that's what is getting missed by the GW most of the times. Is there some sort of TX/RX turn around time that is too short possibly? Or is this based on some response packet the node is expected to send from it's receive function? I did not see anything mentioned in the examples or the .h files to that effect.

    When checking the HW-ACK from the Node to the GW ( in the node sketch ) I find that it works as expected. I only get NACKs when I block the antenna sufficiently to suppress the transmission.

    Disabling the "ACK" feature for the node via Setup/Hardware/MyGateway/node/child on Domoticz is a workaround but probably not the desirable solution, especially as long as the problem is not fully understood.

    @hek @Yveaux ??



  • @GaryStofer said in Error sending switch command, check device/hardware !:

    Domoticz

    Consider switching to Home Assistant all along. It's easier to get help with the system someone still uses.

    @GaryStofer said in Error sending switch command, check device/hardware !:

    I see only one command sent and no error messages ever.

    Because without ACK setting, Domoticz doesn't await a confirmation from the node, and just assumes that message was delivered. It may well be that node can reliably receive, but not transmit, or rather GW can reliably transmit, but not receive. Try switching radio on GW/placing node closer to GW and see if it makes a difference.



  • @GaryStofer said in Error sending switch command, check device/hardware !:

    @Elfnoir @hek I see this old issue is still with us in MySensor 2.3.2 / Domoticz 4.10717.

    What kind of gateway do you use? Just to be sure, did you upgrade gateway node to Mysensors 2.3.2 and not just sensor nodes? BTW, Domoticz 4.10717 is quite old version (from 2019/05). I would consider about updating to the latest 2023.1.

    F.



  • @monte
    Yes --- I know why it "Works" without ACK enabled -- That's not the point. But of course one needs to have the ACK working on the GW otherwise the controller and Node can get out of sync status wise.

    Yes -- all of the above you mentioned was tried -- It's not a HW problem, nor a RF interference , nor a range problem -- Spectrum analyzer shows no other traffic on the chosen Freq.

    Like I said -- All this worked under 1.5 reliably -- with the same HW -- Flawlessly, even on a somewhat noisy RF channel.



  • @ferro The systems use the Serial Mysensor GW -- some connect via USB some connect directly to the serial port on a Pi.

    I cant change the Controller to anything else , not that I think is controller related -- The customer is happy with Domo and has many man hours invested in scripts and interfacing.

    ACK, when transmitting from node to GW/controller, seems to work fine, both HW-ACK and "protocol" ack. ACK from GW/Controller to node seems to be flat out broken, but I can't tell yet if the node is not sending out, or the GW is not receiving it properly.

    Also noticed that the GW code is not using the IRQ line from the radio, I see the SPI clock running on the GW constantly.

    Thanks

    Also



  • @GaryStofer said in Error sending switch command, check device/hardware !:

    I cant change the Controller to anything else , not that I think is controller related -- The customer is happy with Domo and has many man hours invested in scripts and interfacing.

    Sure, I'm happy with Domoticz too 🙂 it wasn't me suggesting you to move to other controller. I suggested just to keep Domoticz, just upgrade it new version 😉. But I can understand the upgrade may be difficult, if customer has developed many stuff around currently installed version and most of them is working fine...



  • @GaryStofer well, in that case you have to look at actual integration, and what Domoticz does not like with ack sent from node.

    What debug outputs of a GW and a node show, when you send commands from Domoticz?

    @GaryStofer said in Error sending switch command, check device/hardware !:

    Also noticed that the GW code is not using the IRQ line from the radio, I see the SPI clock running on the GW constantly.

    That's rather standard behavior.



  • @ferro , @monte, @hek , @Yveaux
    I guess I have not mentioned this before :
    When turning on MY_DEBUG or MY_DEBUG_VERBOSE_RF the ACK problem goes away . The Debug trace looks as expected and the GW is happy with what it gets back from the node in terms of ACK. No error message .... turn Debug off and the problem reappears.

    This is why I think that there is a timing issue, with the RX/TX change over time. By adding the Serial prints it slows the RX/TX change over down enough for the GW to be able to catch the ACK package and be happy.

    If Hek or Yveaux is not going to put his hat in the ring here I guess I have to either run with debug permanently on -- Heck a messy -- or dive down and debug the library myself.

    GS



  • @GaryStofer well, if this is a timing issue, that's has to be on the Domoticz side. Probably it can't read fast enough?



  • Solved by adding a short delay between the RX/TX turnaround when replying with an ACK message.

    In file MyTransport.cpp at line 706 in the "if (msg.getRequestEcho) block, right after the debug message "TSF:MSG:"ECHO REQ" added a 2ms delay to allow the caller to switch from TX to RX mode.

    GS


Log in to reply
 

Suggested Topics

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts