Triggering TimeSync to end devices
-
You can't set the broadcast address of 0 on the mango UI. If you want to work with the existing code base, select another address say 1 as the "broadcast" address. Not sure what you have for modbus implementation on the arduino side but probably is minimalist and probably does not have broadcast handling capabilities. I am assuming you got what was floating around for free. I had to add modbus functions on the arduino side to do what I want. I did not do broadcast functionality but it should not be too hard to implement.
I would change the code to handle a "broadcast" address and have only one device respond to a request to the master and the others are passive listeners. That way only one entry is required on the Mango side along with a CRON event to trigger write the timestamp.
Otherwise you could probably use Mango events to fire off to write the date/time as a unix epoch timestamp or what ever format you want to send to registers in Modbus and manually configure a date/time point for each device. That would emulate a broadcast.
Not sure if that helps.
-
I'm using this library in arduino.
http://sites.google.com/site/jpmzometa/arduino-mbrt/arduino-modbus-slave
It doesn't implement broadcast messages. I was talking with the writer but he is busy to add that feature.He says that there is no reply from slaves for a broadcast message.
It's very interesting to add broadcasting to the library but my C++ knowledge isn't good enough.
-
That is the one I used and modified on my own for my own consumption last year. Even if you add a broadcast in the arduino code, the UI on the Mango side won't let you add a broadcast address of 0. So elegant changes or a hacks needs to be made, hence my suggestions.
-
The writer of the library told me to make myself the changes and add them to the official release.
If you send the changes he will add them in the web page.About Mango modifications... Is there any answer from Serotonin?
-
@mlohbihler said:
Update: the slave side of Modbus4J supported broadcasts, but there were problems on the master side. The library has been updated to fully support broadcasts now. Changed code has been checked into the CVS repo.
Modbus4J works with broadcast, Mango not. Am I right?
-
There are several options presented in thread. If you don't feel comfortable with the C++ or looking at the Mango code, as stated earlier you ca create an event to write to each of the registers in your arduiono with a UNIX epoch timestamp from Mango.
-
Yes. Send time to every slave is the way I was using in the pass. I was wandering a better way to do it.
-
It gets difficult if you don't feel comfortable changing the modus C++ code on the arduino side. The code is easy to follow and change.
-
have you made the changes in the arduino library?
-
yes but not for those you want. If I get a chance I implement the change I suggested, but don't have much in terms of cycles so can't give a time.
-
Don't worry. Sure you are faster than my C++ skills