Issues reading from serial gateway
-
Change http://www.mysensors.org/build/binary#binaryswitchsensor-example line 46
gw.begin();to
gw.begin(null, 10, false);Where 10 is in this example the Node ID
-
I see, great, thank you! Is there a way how to assign the ID of the node from outside, without a controller? Let's say, there will be a number of nodes, sensors being turned on or off and the ID's should be assigned using the serial gateway from the connected PC. I guess this is what the controllers must be doing, I just want to control it myself.
Thank you -
Thank you for the response, however it does not make sense to me. How would it be possible for a controller to assign the ID? There must be some set of commands (API) on the node that are used by the controllers to assign the node ID's, right? I basically want to write a code that will act as a controller in terms of assigning the ID's to the nodes. Is this possible?
Thanks! -
Hi, I have read the whole API documentation but still do not seem to find the way to configure the node ID. I have found this topic http://forum.mysensors.org/topic/350/problems-getting-sensorid/11 but sending the command "255;255;3;0;4;1" to the node did not help though. I would appreciate any hints on this topic. Thank you!
-
Hi, I have read the whole API documentation but still do not seem to find the way to configure the node ID. I have found this topic http://forum.mysensors.org/topic/350/problems-getting-sensorid/11 but sending the command "255;255;3;0;4;1" to the node did not help though. I would appreciate any hints on this topic. Thank you!
@pelnarp said:
Hi, I have read the whole API documentation but still do not seem to find the way to configure the node ID. I have found this topic http://forum.mysensors.org/topic/350/problems-getting-sensorid/11 but sending the command "255;255;3;0;4;1" to the node did not help though. I would appreciate any hints on this topic. Thank you!
@pelnarp you should complete each serial command with \n(indicates command completed), your command should be 255;255;3;0;4;1\n
-
I am trying to send the values, but nothing happens. I am sending "255;255;3;0;4;1\n" over serial port (USB) to the serial gateway, but this does not seem to be processed. Either it is not sent to the sensor at all, or the sensor does not react. I am trying to send this from either Serial Monitor in the Arduino Studio or from my C# code, console app. The serial port works and reads the values properly, however sending this sequence seems to be an issue.
-
Ok, I have figured this out. When sending the value via the serial port there must be a delay between the characters (3ms). Therefore I do something like this (schematically), which works:
foreach (char c in "255;255;3;0;4;1")
{
serialPort1.Write(c.ToString());
Thread.Sleep(3);
} -
Hi, to all!
My situation was exatly the same, that "pelnarps" had! My sensor couldn't get ID from gw, and gave the same results at both ends (gw, and sensor side). Changing gw.begin() as "ericdvb" suggested, solved this issue.
Thanks ericdvb, and pelnarps! I convinced, that this issue can be solved decreasing baudrate, isn't it! -
Hi, mfalkvidd! Thanks for your fast replay. I'm new in Home automation. Actually I try to build my sample system, based on serial gateway. I have my gateway connected to Openhab as controller, and now started to works finally with a temperature sensor.
I spent a lot of time trying to connect sensor to gateway, with no success. Just that piece of information needed to overcome.
Thanks for all!