SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By KamPutty
#148267
Hi all

My current setup:

RN-171 WiFly module
sparkfun XBee explorer serial
Pic24 micro connected to the xbee serial

I have it all working fine etc. :D

Okay, this is what I can do.

I can connect the rn-171 to my wireless network just fine
I can connect to the rn-171 from a browser just fine
I can pass the web requests to the pic micro just fine
I can return HTML stream back to the browser, 99% just fine

I am not doing anything "special" in regards to the configuration of the RN-171.
Code: Select all
1. set wlan phrase <string>
2. set wlan ssid <string>  
3. set join 1              
4. set ip local 80         
5. set comm idle 5   
6. set comm open 0         
7. set comm remote 0       
9. set u b 38400           
The deal is that I cannot currently disconnect the connection using the micro, but use the "idle" timeout on the RN-171

So, some questions

#1. How can I disconnect the connection via the micro in lieu of the "idle" timeout? It is not clear about this in the manual, using GPIO-5

#2. Not all browser play well...Firefox and IE I can send data back just fine, and after the timeout, it flushes it etc and renders just fine

#3. On Chrome, I can "see" the html stream in the browser as it is being pushed, but after the 5 second timeout, it complains about "connection closed" error...

#4. What should I be passing back in the stream? This is what I am passing back. Are there some other "HTML Standards" stuff I am missing?
Code: Select all
<head><meta http-equiv='refresh' content='1' /> <html><title>Test</title><style type='text/css'>.h1 {color: #F00;}</style></head><body><h1 class='h1'>Test</h1></body></html>
#5. For others that have done this, is this the way you guys did this? Am I totally missing the ball here?

Any advise/suggestions would be greatly appreciated.

~Kam
By Corentin
#149319
Hi,

I cannot answer all your questions, but I've got an answer for the first one.

#1. How can I disconnect the connection via the micro in lieu of the "idle" timeout? It is not clear about this in the manual, using GPIO-5

By default, GPIO4, 5 and 6 are used to drive LEDs. If you want to use these pins as connection status indicators (GPIO4 and 6) and to control to TCP connection (GPIO5) with your microcontroller, you first need to set the alternate functions of GPIO4, 5 and 6, using the command:

set sys iofunc 0x70

If you only want to use GPIO5:
set sys iofunc 0x20

The detail is given in WiFly 2.32-v1.0r manual, at page 43.
Hoping I was clear enough.

Corentin