Hi all,
Somebody alread used the RN171 wifi module with PBP?
I am working with this module but using a C code for while. I would like of to use basic to config it. I will apreciate some example code about it to use as basis.
Thanks
Pimentel
Hi all,
Somebody alread used the RN171 wifi module with PBP?
I am working with this module but using a C code for while. I would like of to use basic to config it. I will apreciate some example code about it to use as basis.
Thanks
Pimentel
a search with "rn-171 " gets a few hits
Rather than starting a new thread, I'll tack on to the bottom of this one.
I have a RN 171 connected to a 18F2550. I can receive commands via usb and serout them to the RN 171 but I'm not getting a response. I can see data to and from the RN 171 but I cant get it to load in to a variable using serin. I've seen a few examples of this issue on the forum but no one documented how they fixed it.
Note that I used mode 2 for serout and mode 6 for serin. If I use mode 2 for serin, it times out and jumps to my "didnt get any data" routine at main1. Currently, using mode 6, wifi is full of 0's and it repeats the loop sending text1, text2, text3 again.Code:serout PORTC.6,2,[text, text1, text2] serin PORTC.7,6,2000, main1, [wifi] WRITE 50, wifi.0 write 51, wifi.1 write 52, wifi.2 write 53, wifi.3 write 54, wifi.4 write 55, wifi.5 write 56, wifi.6 write 57, wifi.7 ARRAYWRITE USBTXBuffer, [wifi] GOSUB WaitToSend
Do not include [ ] for serin item as these are used around a qualifier.
Steve Earl www.datageo.co.uk
Nice catch.
However I only get 1 byte so in looking at the manual I need to use SERIN2 with the STR qualifier. Awesome I think, then I modify the code to the following and now I get nothing again. It hangs at SERIN2 until the time is up then it jumps to my loop again. Wifi is defined as BYTE[16]
Code:serin2 portc.7,84,250, main1, [STR wifi\16] WRITE 50, wifi.0 write 51, wifi.1 write 52, wifi.2 write 53, wifi.3 write 54, wifi.4 write 55, wifi.5 write 56, wifi.6 write 57, wifi.7 write 58, wifi.8 write 59, wifi.9 write 60, wifi.10 write 61, wifi.11 write 62, wifi.12 write 63, wifi.13 write 64, wifi.14 write 65, wifi.15
Code:serin2 portc.7,84, [STR wifi\16] 'wait here till 16 total bytes rcvd 'now, 16 bytes are in wifi array starting at wifi[0] 'toggle led or something to tell you got 16 new bytes continue on....................
Serin2 is waiting for 16 characters to be received if you do not send 16 characters it will eventually time out. This is a common issue with serial communication however SERIN2 gives you the "tools" to overcome this.
I use a start character to indicate the start of a command string and an end character as a termination, which is not unusual. A commonly used start character is "!" and end character is $0D (CR). You could follow the LCDOUT protocol and use $FE as the start character the choice is yours.
Having decided which start and end characters to use modify your code and obviously include the start and end characters in the string you are sending.
Code:serin2 portc.7,84,250, main1, [WAIT("!"),STR wifi\16\%0D] WRITE 50, wifi.0 write 51, wifi.1 write 52, wifi.2 write 53, wifi.3 write 54, wifi.4 write 55, wifi.5 write 56, wifi.6 write 57, wifi.7 write 58, wifi.8 write 59, wifi.9 write 60, wifi.10 write 61, wifi.11 write 62, wifi.12 write 63, wifi.13 write 64, wifi.14 write 65, wifi.15
Steve Earl www.datageo.co.uk
Bookmarks