What is the real speed of the RN171 device?

I trying to drive the Cerbot robot from my iPhone via the RN171 wifi card. Crude video here: Accelerometer usage for driving the robot. - YouTube

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:

  1. What is the maximum speed that RN171 can operate at?
  2. Is 125 milliseconds too often to send data to it?
  3. Any other suggestions on how to achieve real time or near real time control.

Thanks.

I just started to do some researching on this device - the module used has a TTL UART interface. So it’s not the driver that does the conversion.

From their page:

So what does this mean? Can the speed be higher than 115 kbaud? Is it possible to set it for 460 or 921 kbaud?

Or can it be implemented as SPI slave (I admit, I know nothing of it other than some googling) to go faster?

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).

From the RN171 documentation:

,NETMF baud enum supports up to 230,400

Not sure if the Cerb + NETMF combo supports those speed though.

I tried the 230,400 baud. It didn’t work. Here is what I did - maybe I am missing something simple.

  1. 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.

  2. 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.

  3. Then I noticed that on page 9 of the spec for RN171 (http://ww1.microchip.com/downloads/en/DeviceDoc/70005171A.pdf), it says to use hardware flow control for rates of 115kbaud or higher. The code was not.


_wifly = new GTI.Serial(socket, baud, GTI.Serial.SerialParity.None,
              GTI.Serial.SerialStopBits.One, 8,GTI.Serial.HardwareFlowControl.NotRequired, this);

So I changed it to require hardware flow control:


_wifly = new GTI.Serial(socket, baud, GTI.Serial.SerialParity.None,
              GTI.Serial.SerialStopBits.One, 8,GTI.Serial.HardwareFlowControl.Required, this);

However, in this case, the Serial creation would fail with: [em]Socket 3 does not support type ‘K’ required by WiFi_RN171 module.[/em]

From this I am guessed that the using hardware flow control requires socket K, which my board does not possess (only socket U). And sure enough socket U does not provide for hardware flow control(http://gadgeteer.codeplex.com/wikipage?title=Socket%20Type%20U), but socket K (http://gadgeteer.codeplex.com/wikipage?title=Socket%20Type%20K) does.

I also looked at the driver for the 4.3 framework and found no substantive differences from the 4.2 driver.

Am I missing something?
What else can I try?
Am I basically stuck with 115 kbps?

@ 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:

set uart baud xxx
save

@ James - Can he set it faster than 115200 on an U socket?

@ 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.

Thanks for the info!

Where are you reading this? This page ( http://ww1.microchip.com/downloads/en/DeviceDoc/70005171A.pdf ) says that via UART, you can go to 230,400 baud max.

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.

That’s why I was hoping someone with access to these tools could give it a quick test.

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

Roland,

Did you connect your bluetooth module into gadgeteer port 1 or 2? Because port 2 is also a K port so presumably it has hardware flow control.

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)

Edit: The RN171 seems to work only up to 230.400