One of the things I am trying to do is attempt near-real time control. To that end, the Javascript on the web page sends accellerometer information to the robot every 125 milliseconds (via Ajax). Eventually, the wireless pipe seems to get overwhelmed/overloaded and the robot either misses commands or receives them a bit too late.
In the debugging screen, I saw that the RN171 card gets initiated 115200 baud (so I am assuming that the driver is a thin wrapper that converts serial data into Tcp Stream?).
My questions:
What is the maximum speed that RN171 can operate at?
Is 125 milliseconds too often to send data to it?
Any other suggestions on how to achieve real time or near real time control.
The first thing I would do is write a very simple program that just receives messages, and see what throughput is achieved. Need to have a base sending rate to determine if the problem is with the driver or your program(s).
I tried the 230,400 baud. It didn’t work. Here is what I did - maybe I am missing something simple.
Got the RN171 gadgeteer driver off codeplex, added the project from WiFi_RN171_42 (e.g. for .net microframework 4.2) folder to my solution instead of the DLL.
In the constructor, I changed int baud = 115200 to 230400. It ran but in the Serial_Listen event, it can’t convert the incoming bytes into a string (using UTF8 encoding) - I tried other ways to decode the data - all resulted in gibberish.
@ rgelb - If you plan on using a baud rate different than the standard supported baud of 115200, you will also need to configure the RN171 to run at the desired baud rate.
You need to send this command to the RN171 after it has been put into command mode:
@ mhectorgato - I have not tested higher baud rates on the Cerb family, which will be the only limiting factor here. The RN-171 is capable of around 3MBaud IIRC.
If I did that and Cerb didn’t support 230,400 baud speed via the U socket… wouldn’t I effectively brick the RN171? I mean the RN171 would from here on out start with 230,400 baud and I’d have no way of communicating with it at that speed or even a way to reset it to 115,200.
It would be great if someone at GHI tested this as you probably have K socket laying around and I don’t.
The manual http://ww1.microchip.com/downloads/en/DeviceDoc/50002230A.pdf describes 2 types of baud rates: standard supported (max 230,400) and raw baud rates (describes up to 1.1MBaud). For the raw rates, flow control needs to be enabled, which requires a K type socket. I am not sure exactly where I remember seeing the approximate 3MBaud limit as there are more than several data sheets for this module.
So, my mistake on the command set, it will actually need to be:
set uart raw xxx
save
If you only have the Cerberus, then yes. To revert you would either need to wire a USB Serial SP Module or use a Null Modem module between the USB Serial SP and RN-171.
Hi,
I used the Serial port of Cerbuino Bee in connection with the Bluetooth module with baudrates of 230.400 and 460.800 with no problems. So I can see no reason why it should not work with Cerberus and RN171 as well.
Kind regards
Roland
I used Socket No. 2. But I think that hardware-flow-control (if it is really supported by the mainboard) only plays a role in conjunction with large chunks of data to transmit (where the internal buffer of the device gets full), not in conjunction with rather short commands to the device (but I only guess, do not really know)