Noob : Cant get Sensor talking to gateway
-
Hi all,
ok this is the embarrassing bit, no the controller wasnt attached.. Im using home assistant and what I didnt realise that was that a) the controller sends the IDs and b) the controller couldnt talk to the Gateway..
BTW Why do we need a controller to assign the unique sensor IDs? I thought the Gateway would do this?
@Angelo-Santagata the gateways are designed to be stateless. The stateless design makes it easy to implement a gateway on low-power hardware. It also makes it easier to correctly implement and verify the gateway functionality, and to troubleshoot if there are problems. If gateways had to remember which ids had been assigned, they would no longer be stateless.
-
@Angelo-Santagata the gateways are designed to be stateless. The stateless design makes it easy to implement a gateway on low-power hardware. It also makes it easier to correctly implement and verify the gateway functionality, and to troubleshoot if there are problems. If gateways had to remember which ids had been assigned, they would no longer be stateless.
@mfalkvidd thanks, very impressive this mySensors stuff BTW
-
@mfalkvidd thanks, very impressive this mySensors stuff BTW
-
Does anyone have suggestions on a clearer log message? One that would make it easy to understand what is happening? If we could make the log clearer, other people could understand the reason quicker, saving time and frustration.
@mfalkvidd In my case I think if the log had said, No Controller provided SensorID, that would have been my first clue
-
@mfalkvidd In my case I think if the log had said, No Controller provided SensorID, that would have been my first clue
-
@angeloS Fully agree - a warning instead of just sending a message with an empty payload would have been easier to spot. Maybe something to propose in Github?
-
@manutremo which message are you referring to?
@mfalkvidd Without being an specialist in the MySensors protocol, it could be something like
-
a debug message at some point in the gateway log when a node ID is requested and there is no ID to provide (no controller available),
-
something similar in the node log when an empty ID is provided form the gw
-
additionally, a warning in the log parser to check the controller when the payload is empty.
-
-
We could add a sample message, in the troubleshooting guide, when the node has no Node ID and the gateway is responding an empty message, so a Node ID must be defined in the sketch
-
@gohan and @manutremo when does the gateway respond with an empty message? I am not able to find that in the logs posted earlier in this thread.
@mfalkvidd Just reviewed the gw log and you're right, the gw just doesn't answer... I guess in this case it's just not possible to separate the cases when the gateway doesn't have a controller, or is off, or communication didn't arrive, or... in all cases, the node seems to end up with a ID=255.
As I said, not familiar with the protocol...
-
@mfalkvidd Without being an specialist in the MySensors protocol, it could be something like
-
a debug message at some point in the gateway log when a node ID is requested and there is no ID to provide (no controller available),
-
something similar in the node log when an empty ID is provided form the gw
-
additionally, a warning in the log parser to check the controller when the payload is empty.
@manutremo the gateway is just a dumb forwarder. When the ID request is received from the sensor node, the gateway forwards that message to it's configured interface (mqtt, ethernet, serial, ...). If the controller responds, the gateway will forward the response.
To do your suggested no 1, the gateway would have to keep track of all ID requests and set some time to know when the response from the controller is deemed too slow. That could probably be done, but would require quite a lot of work to get right and to keep compact enough to still fit the gateway in popular constrained devices like the atmega328.
The message in no 2 doesn't exist, as we have agreed on, so this is unfortunately not viable either.
Your suggestion no 3 sounds promising I think. Whenever the node prints !TSM:ID:FAIL, the log parser should spell out that the most likely cause is that no controller is present. I'm not sure how to update the log parser, but maybe @hek can chip in here? At the moment, the log parser seems unable to parse that message at all.
https://www.mysensors.org/apidocs/group__MyTransportgrp.html#details should be updated to mention the controller on the line where TSM ID FAIL is mentioned.
It would also be nice if the !TSM:ID:FAIL message was more verbose (for people who don't immediately use the log parser), but the log messages need to be kept very short to keep the binary size small.
-
-
A suggestion for updating the documentation is available at https://github.com/mysensors/MySensors/pull/984
Feedback is welcome. -
I have been facing the same problem all day today. Actually as far as I remember my old nodes used to setup the node assignation to AUTO by default.
Was that changed during the last month ? because I was busy at that period.
-
I have been facing the same problem all day today. Actually as far as I remember my old nodes used to setup the node assignation to AUTO by default.
Was that changed during the last month ? because I was busy at that period.
-
@ahmedadelhosni auto id has been default since inception, as far as I know. It was default 2.5 years ago when I first learned about MySensors. So nothing has changed.
@mfalkvidd That's what I know but as I have said, I have been facing the same error to assign an ID for my node and it was solved when I change it to static ID... strange !
-
i was thinking about this, perhaps as part of a welcome tutorial we connect the GW to a gateway (pick one , an easy one). And whilst doing this we simply explain why the Controller is needed.. this would help newbies like me from the start..
Which controller.. well Ive been looking at openhab but settled on Homeassistant, appears more active that OH
Angelo