WiFly RN-134 board (not the sparkfun shield) problem

278 views
Skip to first unread message

trandi

unread,
Sep 20, 2011, 9:55:43 AM9/20/11
to NYCResistor:Microcontrollers
Hi guys,

I usually hate bothering others with my technical issues so I tend to
search and try by myself until I find a solution... however this time
I can't take anymore, I've already spent more than an entire week-end
on this "silly" problem ....
So here I am, maybe somebody on this group can hep... (by the way, I
couldn't find a dedicated WiFly forum, am I missing something ?)


I'll start straight away buy insisting that my question / problem is
about the WiFly RN-134 board, which contains the SAME RovingNetworks
131 module but its is NOT the Sparkfun Arduino shield.

I'm using (or trying to :) ) this with an Atmega 168 micro
controller, same as for the Arduino but programmed directly with avr-
gcc.

I bought last week a RN-134 evaluation board (from mouser
http://uk.mouser.com/Search/ProductDetail.aspx?R=RN-134virtualkey66230000virtualkey765-RN-134
) for my project (here you can have a look at various stuff I blog
about : http://trandi.wordpress.com )

It came with firmware version 2.23 and after several days of
frustration I've updated it to 2.28 which seems to be the latest, but
is has NOT changed anything to my problem(s).

I basically need to connect to a http web-service on the internet to
get some weather information: http://weather.yahooapis.com/forecastrss?w=44418

I initially connected to the board (through the TTL serial port using
a (FTDI 3.3V cable) and TeraTerm.), set up the IP protocol at 18 to
support HTTP beyond IP, configured the wireless ssid and
authentication and SAVED everything.

Everything is ok, I get into command mode (with "$$$") and I type
this:


set dns name weather.yahooapis.com \n
set comm remote GET$/forecastrss?w=44418 \n
open \n \n

And then I get the XML file AS EXPECTED.
So this proves that the whole configuration is WORKING OK! The board
is able to go on the internet and download the requested XML from
yahoo's website...


Now, here are my 2 issues, quite independent of each other, or so I
think:

1) If I do

set dns name weather.yahooapis.com \n
set comm remote 0 \n
open \n
GET /forecastrss?w=44418 \n

Then it does NOT work. It complains about "Yahoo! - 404 Not Found".
Exactly as if the actual page name sent had something added or
substracted from it...


2) If I take the snippet that does work from TeraTerm and I send the
exact same instructions from my Atmega 168 micrcontroller, all the
commands work ok (I can get the AOK back, and even the "*OPEN*") I get
again "Yahoo! - 404 Not Found" !!!

I can actually parse the 404 message on the microcontroller, so
there's no connectivity problem and there's no error from the WiFly
board coming back...



I know it's a long description... To sum it up, some how, in these 2
situations, it seems that the firmware on the WiFly is adding
something to the HTTP request which makes Yahoo not recognise it....
I have also tried in both cases:

- to play with more or less "\n" at the end of the commands or even
add "\r"
- to add "HTTP/1.0" at the end of the page name both when it's set up
in comm remote and when it's send after open

To no avail !!!


This really is becoming huuugely frustrating, as I've already spend
several entire days on this problem (yes that's how desperate I am to
get that weather information on my VFD clock
http://trandi.wordpress.com/2011/09/10/vacuum-fluorescent-display-clock-based-on-soviet-iv-18-tube/
)

I've also had a look at the WiFly arduino library for the Sparkfun
shield, and checked what they are doing in the code... it's the same
thing, no extra commands or tricks that I could see...

Many many thanks for your help,
Dan

Michael Jamet

unread,
Sep 20, 2011, 11:16:33 AM9/20/11
to nycresistormi...@googlegroups.com
Hi Dan,
 
Can you point to the programming spec for the board?  The datasheet on the Mouser page does not describe the serial protocol.
 
Thanks,
Michael


--
You received this message because you are subscribed to the Google Groups "NYCResistor:Microcontrollers" group.
To post to this group, send email to nycresistormi...@googlegroups.com.
To unsubscribe from this group, send email to nycresistormicrocon...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nycresistormicrocontrollers?hl=en.


trandi

unread,
Sep 20, 2011, 11:29:02 AM9/20/11
to NYCResistor:Microcontrollers
Of course, sorry for not having mentioned this earlier.
You can get a full user manual here:
http://www.rovingnetworks.com/Docs/WiFly-RN-UM.pdf

That contains all the commands, etc. ...

dan

On Sep 20, 11:16 am, Michael Jamet <brooklynrob...@gmail.com> wrote:
> Hi Dan,
>
> Can you point to the programming spec for the board?  The datasheet on the
> Mouser page does not describe the serial protocol.
>
> Thanks,
> Michael
>
> On 20 September 2011 09:55, trandi <robo.tra...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi guys,
>
> > I usually hate bothering others with my technical issues so I tend to
> > search and try by myself until I find a solution... however this time
> > I can't take anymore, I've already spent more than an entire week-end
> > on this "silly" problem ....
> > So here I am, maybe somebody on this group can hep... (by the way, I
> > couldn't find a dedicated WiFly forum, am I missing something ?)
>
> > I'll start straight away buy insisting that my question / problem is
> > about the WiFly RN-134 board, which contains the SAME RovingNetworks
> > 131 module but its is NOT the Sparkfun Arduino shield.
>
> > I'm using (or trying to  :) ) this with an Atmega 168 micro
> > controller, same as for the Arduino but programmed directly with avr-
> > gcc.
>
> > I bought last week a RN-134 evaluation board (from mouser
>
> >http://uk.mouser.com/Search/ProductDetail.aspx?R=RN-134virtualkey6623...
> >http://trandi.wordpress.com/2011/09/10/vacuum-fluorescent-display-clo...

g.

unread,
Sep 20, 2011, 11:34:18 AM9/20/11
to NYCResistor:Microcontrollers
Hi Dan,

I had a very similar problem. I pinned it down to the way Terra term
vs. the Arduino script sent the returns and new line commands to the
server via the Wifly module. I also did not use the shield but only
the module. It sounds similar to your issue.

Try out to use something similar like I have below:

Serial.print("$$$\r\n");
delay(1000);
Serial.print("open www.pachube.com 80\r\n");
delay(1000);
Serial.print("PUT /api/");
Serial.print(PACHUBE_FEED_ID);
Serial.print(".csv HTTP/1.1\r\nHost: pachube.com\r\nX-PachubeApiKey:
");
Serial.print(PACHUBE_API_KEY);
Serial.print("\r\nUser-Agent: Arduino");
Serial.print("\r\nContent-Type: text/csv\r\nContent-Length: ");
Serial.print(content_length);
Serial.print("\r\nConnection: close\r\n");
Serial.print("\r\n");
Serial.print(pachube_data);
Serial.print("\r\n");
return true;
}

That worked for me.

Gerhard



On Sep 20, 9:55 am, trandi <robo.tra...@gmail.com> wrote:
> Hi guys,
>
> I usually hate bothering others with my technical issues so I tend to
> search and try by myself until I find a solution... however this time
> I can't take anymore, I've already spent more than an entire week-end
> on this "silly" problem ....
> So here I am, maybe somebody on this group can hep... (by the way, I
> couldn't find a dedicated WiFly forum, am I missing something ?)
>
> I'll start straight away buy insisting that my question / problem is
> about the WiFly RN-134 board, which contains the SAME RovingNetworks
> 131 module but its is NOT the Sparkfun Arduino shield.
>
> I'm using (or trying to  :) ) this with an Atmega 168 micro
> controller, same as for the Arduino but programmed directly with avr-
> gcc.
>
> I bought last week a RN-134 evaluation board (from mouserhttp://uk.mouser.com/Search/ProductDetail.aspx?R=RN-134virtualkey6623...
> get that weather information on my VFD clockhttp://trandi.wordpress.com/2011/09/10/vacuum-fluorescent-display-clo...

Michael Jamet

unread,
Sep 20, 2011, 12:17:32 PM9/20/11
to nycresistormi...@googlegroups.com
Hi again, Dan,
 
I agree w/Gerhard.  Start by confirming you are sending the expected end of line char.  Page 9 of the programming manual says all commands end with a carriage return. Gerhard's code sends both CR and LF.  Your terminal program has an options for deciding whether CR/LF or both are sent as end of line chars.
 
You have 2 immediate debugging options:
1) Change your terminal program to just send LF's and see if you can get your formerly working set of commands to break...
2) Explicitly send \r instead of \n from your C program.
 
Looking forward to your report,
Michael

trandi

unread,
Sep 20, 2011, 1:08:16 PM9/20/11
to NYCResistor:Microcontrollers
Ok, I think I start to understand what's going on:

- I'm using the WiFly board in "HTTP" mode (set ip 18) which is
supposed to add this "HTTP/1.0 and the Host: parameter automatically)

-----------------------------------------------------------------------------------------------------------
<remote string><your data><SPACE>HTTP/1.0\nHost:<SPACE><the hostname
in config>\n\n

-----------------------------------------------------------------------------------------------------------

- something is going wrong there and I think the easiest option is to
go back into pure IP mode and construct myself the whole request as
you did ...


I'll try it tonight after work and let you know...

dan


P.S. I've also got an answer from RovingNetworks support, slightly
dry / condescendent, BUT really really quick !
It basically mentions these strings that the HTTP mode adds to the
request and how in pure IP mode the WiFly won't touch the message
sent...

I've never seen any support answering your problem in a few hours !!
Thumbs up, they seem to have a great team there and caring about their
clients !



On Sep 20, 11:34 am, "g." <gwie...@gmail.com> wrote:
> Hi Dan,
>
> I had a very similar problem. I pinned it down to the way Terra term
> vs. the Arduino script sent the returns and new line commands to the
> server via the Wifly module. I also did not use the shield but only
> the module. It sounds similar to your issue.
>
> Try out to use something similar like I have below:
>
>   Serial.print("$$$\r\n");
>   delay(1000);
>   Serial.print("openwww.pachube.com80\r\n");

trandi

unread,
Sep 20, 2011, 5:53:59 PM9/20/11
to NYCResistor:Microcontrollers
OK, after a quick test tonight it turns out that indeed going into
"pure IP" mode (so that the WiFly doesn't add anything by itself) and
sending:

"
open weather.yahooapis.com 80 \n
GET /forecastrss?w=44418 HTTP/1.1\r\n
Host: weather.yahooapis.com \r\n
\r\n
"

Does work indeed !!!


Thank you everybody for your quick replies and all your help !

dan

Fred Bayoff

unread,
Sep 21, 2011, 8:39:26 AM9/21/11
to nycresistormi...@googlegroups.com
Hi... Just found this thread and it is very interesting...

I purchased the sparkfun shield and got everything to work - but I
now want to purchase the 134 version from roving networks.

Is the wiring simply rx, tx, 3.3v and/or 5v, gnd?

Did you use the wifly library?

trandi

unread,
Sep 21, 2011, 9:18:48 AM9/21/11
to NYCResistor:Microcontrollers
Yes, the RN-134 kit is really a very nice piece of kit...! It's not
cheap, but then no WiFi device is...

Yes, as I'll show in my future post with all the details (probably
this upcoming week-end) you just need to wire 4 wires.
Be careful the TTL interface is 3.3V, so if your microcontroller is 5V
you'll have to use a level converter similar to what Sparkfun has...

And NO, I have not used any wifly library (I imagine you mean the
Arduino one, but I'm not using an arduino !) I'm simply sending
commands on the serial line... it's really simple...


dan

Fred Bayoff

unread,
Sep 21, 2011, 9:29:49 AM9/21/11
to nycresistormi...@googlegroups.com
Very cool... Looking forward to see the details...

Just in passing, I'm also looking for a WPA2 - Enterprise solution...
Roving Networks does not have
such a device..

I've looked at Quatech there abdg-se-dp501 serial device... But I
don't know if it will work.

Anyone have experience with WPA2-Enterprise... hopefully with an Arduino ??

trandi

unread,
Sep 21, 2011, 4:43:21 PM9/21/11
to NYCResistor:Microcontrollers
Actually, I'm still having some issues...
Everything works fine now (in pure TCP mode) as I've already
mentioned
if I send:
"
open weather.yahooapis.com 80\r\n
GET /forecastrss?w=44418 HTTP/1.1\r\n
Host: weather.yahooapis.com\r\n
\r\n
"
HOWEVER, and I really don't understand it, if I want to do the same
thing on another website it does NOT work:
"
open search.twitter.com 80\r\n
GET /search.json?q=arduino&rpp=1 HTTP/1.0\r\n
Host: search.twitter.com\r\n
\r\n
"
I'm getting "Http 405 method not allowed allow get, head, post"
It's IDENTICAL code, except for the host and the page, and when using
telnet it works for both !!

Maybe I'm missing something really obvious...

Thank you again for your help !
Dan

David Rorex

unread,
Sep 21, 2011, 5:07:21 PM9/21/11
to nycresistormi...@googlegroups.com
It's not completely identical, one has HTTP/1.1 and one has HTTP/1.0

trandi

unread,
Sep 22, 2011, 4:40:21 AM9/22/11
to NYCResistor:Microcontrollers
yes sorry, my copy/paste was at different moments, as I tried with
plenty of different parameters.

HOWEVER, the string that is sent is automatically generated in the
code from the host / page.

If I give ("weather.yahooapis.com" , "/forecastrss?w=44418") then it
works, and with the EXACT SAME code if I pass ("search.twitter.com", "/
search.json?q=arduino&rpp=1") it DOES NOT !


HTTP/1.1 vs 1.0 doesn't seem to change anything...

I'm really puzzled by this...! I'll probably have to sniff the
traffic to see exactly what's going on...but was hoping to avoid
it... ;(

dan

trandi

unread,
Sep 26, 2011, 5:02:04 PM9/26/11
to NYCResistor:Microcontrollers
Hi guys,

I've finally found the problem and finished my project:
http://trandi.wordpress.com/2011/09/26/vfd-clock-connects-to-the-internet/

Here's the short abstract of the issue, in case anybody on this forum
is interested or other people search it up in the future:

- the HTTP mode was working when connected to the WiFly board from the
PC but NOT when it was the AtMega micrcontroller sending the
commands.. still don't know why
- the solution was to go in TCP mode and construct the HTTP request
myself (you'll see the code in the wiFly.c file posted on my blog)
- then the problem with that was simply that when resetting the board
to its factory settings I had forgotten to clear the "com remote"
string, and the board would add "*HELLO*" to all my transmissions
(again, confusingly enough yahooapis.com would work just fine with
this, whereas search.twitter.com would complain !)

Hope this helps, let me know if you have any similar problems and need
help !

Thanks,
dan
> > > > > > > about the WiFlyRN-134board, which contains the SAME
> > > RovingNetworks
> > > > > > > 131 module but its is NOT the Sparkfun Arduino shield.
>
> > > > > > > I'm using (or trying to  :) ) this with an Atmega 168 micro
> > > > > > > controller, same as for the Arduino but programmed directly with
> > > avr-
> > > > > > > gcc.
>
> > > > > > > I bought last week aRN-134evaluation board (from mouserhttp://
Reply all
Reply to author
Forward
0 new messages