RS485 scheme with digi xtends
Erik Friesen
Posts: 1,071
I have a project where I am using the digi xtend radios. I will have multiple outlying devices replying back to a central computer. There may be more than one computer acting as master however. I also wish for the these digi radios to be able to talk to each other, for remote control of certain features.
I am searching for addressing ideas to allow no clash communications.
Ideas I have had -
Every device will have a rtc. I could sync them, and each one would have a specific time slot allowed to talk. However with this scheme, the top computer would have to wait for a time slot, which could be annoying to the end user.
Some how use the cts/rts to accomplish this.
Any other ideas?
I am searching for addressing ideas to allow no clash communications.
Ideas I have had -
Every device will have a rtc. I could sync them, and each one would have a specific time slot allowed to talk. However with this scheme, the top computer would have to wait for a time slot, which could be annoying to the end user.
Some how use the cts/rts to accomplish this.
Any other ideas?
Comments
If at all possible, make one computer the master. It will make your system more robust and in the end will likely make it more useable. Multiple masters increase the protocol complexity and the anti-collison algorithms use up processor time.
If you were connected by wire, you could go with a rts/cts scheme but the radios can only talk/listen alternately. Thats why if everybody defaults to "listen", they are ready to hear the master and respond properly.
Even with your desire for two listeners to communicate with each other, it should be arbitrated by the master.
You can develop your protocol so the master continually polls the listeners. If a listener has a message for either the master or another listener, the master will redirect it on its next cycle through the loop.
Can you give us a block diagram of your network?
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
This is a somewhat critical application and I do not wish to shut the systems communication down because the pc at home crashed, or one of the devices lost power, or johnny jr. shut my program down. That is why I lean toward a non total master system. Also box 1 may control an auxiliary relay on box 2.
That's one reason the master /slave setup can work. Each listener is smart enough to do local control should the master fail to contact it after some timeout period.
Also, no one says the PC that johnny jr. has access to is the master. I've done several watewater treatment plants where the "master" was another Stamp board and the operator interface PC was just another listener.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
One thing I have done on these setups is include the capability of using rts/cts.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Good basic system layout. Spend a bit of time with the radios in self-test mode to make sure you've got solid communication. Nothing more aggravating than having to stop the project to raise an antenna a few feet to get a better line of sight.
I'd make the home PC the master, taking in to account the fact that the ponds may have to fend for themselves from time to time if the master goes out for some reason. Each time it communicates, it will broadcast all data. Depending on the address included, only one slave will respond. The master receives that slaves's info then moves on.
Make the mobile unit also look like a slave. Other than being able to send back new setpoints, its the same as a pond unit. Because the master always transmits all ponds' data, the mobile unit has a quick snap-shot of the entire facility, no matter where it is in the coverage area. And, because all ponds get the whole data picture, your overlapping pond 1 and 2 can share info back and forth through the master.
In the biggest wastewater system I did (which has been running about 10 years now) there were 5 - 200 hp blowers, a control room computer, a DO meter floating in the middle of the lagoon communicating wirelessly. Each blower had a Stamp board to monitor valve position, do start-stop, measure current and emergency shut-down. The master was a BS2sx, if I recall. Individual units were BS2. For monitoring, I just plugged a spare radio into a laptop running Hyperterminal and drove around the site.
Keep us informed!
By the way, what do you use for aeration?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Each control box has total control of its pond. Essentially the controlling computer will only change setpoints and misc, and will be similar to controlling it pondside. In the case of power outage at home the system must be able to run completely on its own.
How would it work to have a sub master that would come on line after a given amount of quite time? I am not sure how that would act when the oe came back on line.
The master has been going along keeping everybody updated. (including the back-up master, which has been sitting as a listener). After not hearing from the master, the sub-master begins controlling based on...what? The last set of good data from the master? a default value? this can all be done by the individual units as well.
When the normal master comes back, its first unit to poll should be the back-up master, including setting a bit to tell it to stop being master. You'll have to get the new master to check for comm activity before broadcasting, otherwise you could get into a comm contention issue. I guess it would be easy enough for the new master to wait until the temporary master has broadcast ( based on the id in the broadcast data string) and then to broadcast its own message and re-take control.
Are you measuring the oxygen level in each pond or aerating based on experience or air temperature? If this info is available to the pond controllers, then the master is really just a nice added feature for logging data or forcing a certain pond to a higher or lower level of aeration. I'm sort of assuming the pond controllers do the stop-start on the aerators, read oxygen sensor, read temperature of air and water.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
The digi's have a 2kb input buffer that waits for the rf signal to quit before sending. I suspect that you can set the wait to send time(after last rx) to different settings.
Another thing, in api mode, you can specify the destination address.
Both could allow masterless implementation with a little carefullness it seems to me.
If all radios are set to listen as a default, the system is always ready for one radio to begin transmitting.
I usually depend on the ID transmitted back and forth in the data stream for the required interlocking. I do this so all radios are identical and no special setup is required should a replacement be needed.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·