XBEE/Wifi with Uno, optiboot STK_READ_PAGE problem

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mxa
 
Posts: 9
Joined: Sun Mar 18, 2012 10:00 pm

XBEE/Wifi with Uno, optiboot STK_READ_PAGE problem

Post by mxa »

I'm attempting to download a sketch from my host computer to an UNO/wireless shield/XBEE Wifi with optiboot bootloader but I'm having some problems with the STK_READ_PAGE command in that I never get any data back. I"m using the STK_READ_PAGE first and not attempting to program at this time in order to debug my program on my host computer. I figure if I can reliably read data successfully, I'll go to the next step of actually flashing a sketch over Wifi. I don't think it's an XBEE/wifi issue, because I can send two STK_GET_SYNC,SPACE characters and get the valid x14/x10 characters back. I also can set the address with STK_LOAD_ADDRESS and get the proper x14/x10 back. And I've sent other STK commands and get the proper x14/x10 response. So here is a summary sequence of where I'm at:

1) I have a sketch running on my UNO that is listening for characters from the XBEE. The XBEE is programmed in transparent mode, and using TCP/IP.

2) I send a character from my computer to the XBEE using TCPIP that the currently running sketch interprets as a hardware reset. The sketch drives an I/O pin low which fires off a timing reset circuit to hardware reset the UNO.

3) my computer program then waits a little and then sends STK_GET_SYNC,SPACE ('1 ') and listens for the x14/x10 response. I wait for two of these exchanges before I continue.

4) my computer then sends the STK_LOAD_ADDRESS like 'U\x00\x00 ' and waits for the x14/x10 response before I continue.

5) my computer program then sends the STK_READ_PAGE like 't\x00\x80F ' and waits for a response but this is when I timeout waiting for the data. I get nothing. I've tried different count values but still no luck.

I've used wireshark to trace the TCPIP packets to and from the XBEE and I know that the STK_READ_PAGE is getting accepted. So I'm at a loss for ideas on what to try next. Any suggestions? Am I missing some STK command that needs to be sent before reading data?

I've tired this with the stock optiboot loader with the same results, so I modified the optiboot loader, in order to make the timeout longer by changing the watchdog timer to timeout at 8 seconds thinking maybe I was not sending the STK commands fast enough before timeout but that didn't work ether.

I'm rather new with working with arduino's so I could have easily overlooked something so looking for any ideas. I've read a little on the internet of people attempting this with success. Some have used virtual com ports over TCPIP and using avrdude but I'm not really ready to try that right now.

User avatar
mxa
 
Posts: 9
Joined: Sun Mar 18, 2012 10:00 pm

Re: XBEE/Wifi with Uno, optiboot STK_READ_PAGE problem

Post by mxa »

I hooked up a usb cable to the Uno to see the serial characters that the Uno is transmitting to the XBEE, and I see the data requested being returned from the STK_READ_PAGE request. This means for some reason the XBEE is not sending this data across the Wifi interface because my software times out, and I don't see the data packets using wireshark.

At least I've identified where the problem is and it has nothing to do with the bootloader STK commands that I'm sending. I guess I have to fiddle some more with XBEE settings using X-CTU from digi.

Maybe this has something to do with the arduino sending the data back to fast, or there are times when the XBEE can't accept the data. I don't think there is any flow control being used on the Wifi shield between the XBEE and Arduino. Maybe slowing down the baud rate from 115200 to something slower might be better.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”