Noob : Cant get Sensor talking to gateway
-
Hey all,
This is my first Mysensors adventure and I cant seem to get things working..
I have a trivially simple sketch, just to test its working but the arduino doesnt event get to my "loop".. Im baffled.. i think im doing something wrong software wise but... bafled.. Oh I know the arduino is on 2.1.1 and the Pi on 2.2.0-rc.1 but I cant work out how to burn the same version to the arduino....
thanks in advance
Angelo#include <SPI.h> #define MY_DEBUG #define CHILD_ID_TEMP 1 #define MY_RADIO_NRF24 #include <MyConfig.h> #include <MySensors.h> MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); void presentation() { // Send the sketch version information to the gateway sendSketchInfo("AngelosTesting", "1.1"); present(CHILD_ID_TEMP, S_TEMP); } void setup() { Serial.println("Init"); } void loop() { Serial.println("Sending data"); send(msgTemp.set("42!")); sleep (5000); }However the sensor just says "fail",.. what is interesting that when the sensor says its failure message the gateway does receive something but.. the sensor doesnt like it..
Arduino Mini Pro sensor
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:FPAR 16 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2025 !TSM:FPAR:NO REPLY 2027 TSM:FPAR 2029 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4038 !TSM:FPAR:NO REPLY 4040 TSM:FPAR 4042 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4636 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0 4642 TSF:MSG:FPAR OK,ID=0,D=1 6051 TSM:FPAR:OK 6051 TSM:ID 6053 TSM:ID:REQ 6057 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK: 8065 TSM:ID 8065 TSM:ID:REQ 8069 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK: 10076 TSM:ID 10076 TSM:ID:REQ 10080 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK: 12089 TSM:ID 12089 TSM:ID:REQ 12093 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK: 14102 !TSM:ID:FAIL 14104 TSM:FAIL:CNT=1 14106 TSM:FAIL:PDTRaspberry Pi Gateway
mysgw: Starting gateway... mysgw: Protocol version - 2.2.0-rc.1 mysgw: MCO:BGN:INIT GW,CP=RNNGL---,VER=2.2.0-rc.1 mysgw: TSF:LRT:OK mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: TSM:INIT:TSP OK mysgw: TSM:INIT:GW MODE mysgw: TSM:READY:ID=0,PAR=0,DIS=0 mysgw: MCO:REG:NOT NEEDED mysgw: Listening for connections on 0.0.0.0:5003 mysgw: MCO:BGN:STP mysgw: MCO:BGN:INIT OK,TSP=1 mysgw: TSF:MSG:READ,255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0: mysgw: TSF:MSG:BC mysgw: TSF:MSG:FPAR REQ,ID=255 mysgw: TSF:CKU:OK,FCTRL mysgw: TSF:MSG:GWL OK mysgw: TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0 mysgw: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: mysgw: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: mysgw: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0: mysgw: TSF:MSG:READ,255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0: mysgw: TSF:MSG:BC mysgw: TSF:MSG:FPAR REQ,ID=255 mysgw: TSF:PNG:SEND,TO=0 mysgw: TSF:CKU:OK mysgw: TSF:MSG:GWL OK mysgw: TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0 mysgw: TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:@Angelo-Santagata the log parser is useful in these situations.
https://www.mysensors.org/build/parserlink text
In your case, it calls my attention that the gw seems to be answering the requests for an ID from the node with an empty payload. I would start the investigation here.
For a check, assign an static node Id to the node and try see what happens.
-
If you have used this same sensors as a test in the past you may need to clear the eeprom data also.
Just a guess...
@manutremo thanks, I have used the parselink text utility but I should have paid more attention
mm Ive used the same hardware but never got it working. .. your right maybe its stored a dud nodeID.. Looking at the docs https://www.mysensors.org/download/sensor_api_20 I can set a nodeID manually.. I'll give that a go -
Here's the clear eeprom sketch if you need it.
https://github.com/mysensors/MySensors/blob/master/examples/ClearEepromConfig/ClearEepromConfig.ino
-
Here's the clear eeprom sketch if you need it.
https://github.com/mysensors/MySensors/blob/master/examples/ClearEepromConfig/ClearEepromConfig.ino
-
@manutremo , you hit it bang on.. The NODE_ID wasnt being sent, setting a node id to a number using
#define MY_NODE_ID 42
worked.Curious, so I can debug this myself in the future, which line indicated the NODE_ID was blank?
was it this line?
mysgw: TSF:MSG:READ,255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0: -
@manutremo , you hit it bang on.. The NODE_ID wasnt being sent, setting a node id to a number using
#define MY_NODE_ID 42
worked.Curious, so I can debug this myself in the future, which line indicated the NODE_ID was blank?
was it this line?
mysgw: TSF:MSG:READ,255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0:@Angelo-Santagata happy to know that you got it working. Yes I think that's the line which in the log parser showed an empty payload. It would be interesting to know why the gw is returning an empty payload when an ID is requested, though, since that's not usual behavior with the default settings. Let us know what you find out!
-
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?
-
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