Nothing on serial monitor on MySensor sketches
-
If the issue was a bad radio would there still be some kind of output on the serial monitor or would the failure to connect to the gateway cause an issue that prevents the remainder of the code from executing and giving an output?
-
If I replace gw.begin() with the below line of code and continue to comment out the remainder of the gw lines I can get the light output on the serial monitor.
void begin(void (* msgCallback)(const MyMessage &)=NULL, uint8_t nodeId=AUTO, boolean repeaterMode=false, uint8_t parentNodeId=AUTO, rf24_pa_dbm_e paLevel=RF24_PA_LEVEL, uint8_t channel=RF24_CHANNEL, rf24_datarate_e dataRate=RF24_DATARATE);
My understanding is the gw.begin() and that line of code should be equivalent. I've coded in the past with Fortran but not for years so I may be missing something obvious here.
-
Sorry meant you could edit begin() (not setup) in MySensor.cpp to lower the serial baudrate above if you have problem with the serial line at high speeds.
You should at least get a startup message if you have DEBUG enabled in MyConfig.h.
Remve Serial.begin(9600); from your sketch and use the baudrate you use /set in begin().
-
#define BAUD_RATE 9600 is already placed in mysensors.h.
I don't see any reference to baud rate or starting the serial output in the begin function in mysensors.h
That is why I added serial.begin(9600) to the sketch to see if that helped. It didn't but I left it in so that it would be started when I commented out the gw.begin
-
-
I forgot about the .cpp files. Did I tell you I was new to this?
So by placing serial.println commands in my mysensors.cpp file I have identified where things seem to get stuck:
Within the findparentnode routine:
Serial.println("FPN1");
sendWrite(BROADCAST_ADDRESS, msg, true);
Serial.println("FPN1");I'll keep investigating when I get time. Thanks for your help
-
I turned on failure_handling within the rf24 config. Now I get the following messageon my serial output:
send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
as well as:
sensor started, id 255
req node idThis happens three times before it appears to give up and runs the rest of the parent sketch which starts a serial output of A0.
-
send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
Seems like your node is requesting a id from a controller, see for example http://forum.mysensors.org/topic/531/using-an-uno-for-sensor-with-negative-results
-
I added capacitors to my radios to see if that would help. I'm also testing with a serial gateway without much difference. I tried assigning a node id of 1. Didn't seem to change much.
The debug output goes to the serial monitor correct? I'm wondering why I'm not getting any debug messages.
-
Ok. My primary problem was the radios I purchased form Ebay weren't the correct type. I've purchased new ones. Still got some problems to work through but I'll put in a seperate thread.
For others reading later:
Other references to these radios:
http://forum.mysensors.org/topic/878/no-debug-data-from-sensors-or-gateway-bad-radios
http://forum.mysensors.org/topic/728/radio-setup-give-check-wires/17
And specifically mentioned on the troubleshooting page as well.