Figuring out Serial Protocol

Do you have a question on how to do something.
Ask in here.
Post Reply
xulio
Posts: 10
Joined: Sun Mar 10, 2013 4:48 pm

Figuring out Serial Protocol

Post by xulio »

I found a few libraries to do serial communications on the Mac. I am wondering if you know of any sample code that uses serial communications to do some simple things with the RA. Doesn't have to be for the Mac. Linux or Windows is OK. I just want to see how the code interacts with the RA serially. Something like reading the state of the ports or just telling a relay to go on or off.

Thanks.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Figuring out Serial Protocol

Post by rimai »

Send "GET / " and you shall get "Reef Angel Controller Web Server"
Send "GET /sr " and you will get xml data with all the parameter and statuses.
Look at the string above carefully.... There is a space at the end. Just make sure that you send a space after your command.
For more commands, look here:
http://forum.reefangel.com/viewtopic.ph ... 41&p=23677
Roberto.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Figuring out Serial Protocol

Post by rimai »

Forgot to mention that you need to communicate at 57600 baud.
Roberto.
xulio
Posts: 10
Joined: Sun Mar 10, 2013 4:48 pm

Re: Figuring out Serial Protocol

Post by xulio »

Great. That link is what I was looking for. Hopefully I'll have some time this weekend to toy with it.
xulio
Posts: 10
Joined: Sun Mar 10, 2013 4:48 pm

Re: Figuring out Serial Protocol

Post by xulio »

Yes, this worked. I didn’t have to use the libraries I found online. I used the sample code in the Arduino website just fine. There are some bugs that I need to figure out (like closing the serial port while on a synchronous read freezes the process). Other than that, I just need some time to get dangerous. :D
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Post by binder »

xulio wrote:Yes, this worked. I didn’t have to use the libraries I found online. I used the sample code in the Arduino website just fine. There are some bugs that I need to figure out (like closing the serial port while on a synchronous read freezes the process). Other than that, I just need some time to get dangerous. :D
good luck! are you working on a mac app to control the unit?
feel free to take a look at my apps on my github account for more details with communicating to the controller.
Post Reply