How to change sender, command, msg type, payload type, ... ?
-
Hi everyone, I'm using UNO to build a Serial Gateway and Pro mini to build a sensor node. I use GatewaySerial and AirQualitySensor in Mysensors' example to test the code. I want to send continuously a random number from the AirQualitySensor to GatewaySerial. This is what appearing on my Serial Monitor:
0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
0;255;3;0;14;Gateway startup complete.
0;255;0;0;18;2.0.0
0;255;3;0;9;No registration required
0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;Could you tell me how to change the structure of this line "0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0" like in this example:
https://www.youtube.com/watch?v=doz9mEtw_8g&feature=youtu.beThank you very much.
-
Hi everyone, I'm using UNO to build a Serial Gateway and Pro mini to build a sensor node. I use GatewaySerial and AirQualitySensor in Mysensors' example to test the code. I want to send continuously a random number from the AirQualitySensor to GatewaySerial. This is what appearing on my Serial Monitor:
0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
0;255;3;0;14;Gateway startup complete.
0;255;0;0;18;2.0.0
0;255;3;0;9;No registration required
0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
0;255;3;0;9;TSP:MSG:READ 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=255)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;TSP:MSG:SEND 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0
0;255;3;0;9;TSP:MSG:READ 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;Could you tell me how to change the structure of this line "0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=bc:0" like in this example:
https://www.youtube.com/watch?v=doz9mEtw_8g&feature=youtu.beThank you very much.
Look at the API page on the mysensors web. You'll find the command to send a message there and lots more.
I would first make sure I have comms up properly though, before creating a more complicated sketch.
The last line from your gateway log is a request for node id from the node. You need a controller connected that can hand out node ids and reply to the request. The gateway is not responsible for handing out node ids. The alternative is to specify a fixed node id in your sketch. You should find the command for this also on the api page.
Also have a look at the sticky post in the troubleshooting section. You should find links to posts explaining the debug output from the log.
-
Thank you martinhjelmare.
I have read the page https://www.mysensors.org/download/serial_api_20 and I know the format of the message frame but I don't know how to change these things in the sketch . I spent a week trading code in the library and got nothing @@
Maybe I'm so noob to fine the way to build just an example :disappointed_relieved: Could you give me a link that shows how to change the message frame ? -
Thank you martinhjelmare.
I have read the page https://www.mysensors.org/download/serial_api_20 and I know the format of the message frame but I don't know how to change these things in the sketch . I spent a week trading code in the library and got nothing @@
Maybe I'm so noob to fine the way to build just an example :disappointed_relieved: Could you give me a link that shows how to change the message frame ? -
@mfalkvidd I've read this link https://www.mysensors.org/download/sensor_api_20#message-constructor too, but I'm so confused what I have to do to change "255 - 255 - 255 - 255" to "2 - 2 - 0 - 0", I don't know what to do with the code in the link. Where do I have to change the code to configure the message frame ?
-
@mfalkvidd I've read this link https://www.mysensors.org/download/sensor_api_20#message-constructor too, but I'm so confused what I have to do to change "255 - 255 - 255 - 255" to "2 - 2 - 0 - 0", I don't know what to do with the code in the link. Where do I have to change the code to configure the message frame ?
-
@mfalkvidd I just want to use AirQualitySensor to send a random number to GatewaySerial (because I don't have an Air Sensor so I send a random number). That's exactly what I want to do now.
-
@mfalkvidd I just want to use AirQualitySensor to send a random number to GatewaySerial (because I don't have an Air Sensor so I send a random number). That's exactly what I want to do now.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login