I am running some test programs on my new wifi shield.
I ran an initial check for it to scan for available networks and that worked fine. It also connects to a network fine. For my next test I tried the Arduino example program “WifiWebClient” and I ran into trouble. There is a part of code that looks like this:
Serial.println("Connected to wifi");
printWifiStatus();
Serial.println("\nStarting connection to server...");
// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.println("connected to server");
// Make a HTTP request:
client.println("GET /search?q=arduino HTTP/1.1");
client.println("Host: www.google.com");
client.println("Connection: close");
client.println();
}
}
But my output looks like this:
[q]
Connected to wifi
SSID: twosom2F
IP Address: 192.168.0.9
signal strength (RSSI):-67 dBm
Starting connection to server...
disconnecting from server.
[/q]
So I connected to the server OK, but failed the test :
if (client.connect(server, 80)) {
I put in a println just to confirm and client.connect(server, 80) is indeed not true (0).
Any idea what I should try next to make the example program run?
OK, I admit I haven’t done the firmware upgrade yet, but it looks like a really complicated (risky!) process and I want to test for basic functionality as much as possible before trying that.
Any suggestions on how to pass the:
if (client.connect(server, 80)) {
statement?
You can click on the </> tag link which will create this for you: [ c o d e ] [ / c o d e ]
Just copy and paste your code between the two tags.
You can edit your first post and manually type "[ c o d e ]" just before the start of the code and "[ / c o d e ]" at the end of it.
Edit : Lol - sorry the forum converted my typing to actual tags.
I have retyped them with spaces to force them to display as type.
Just omit the spaces when creating the tags.
I don't mean to be illiterate and I know your reply is helpful, but I couldn't get it to work.
I tried " my code
"
and
" my code "
and even
code: [select] " my code
"
and I don't get the desired result. I'm trying to follow your instructions as best I can. Can you tell me where I am misinterpreting your instructions?
Thanks,
Drew
Have you upgraded the wifi shield firmware? If not, you will have problems if using IDE 1.0.4 and newer wifi libraries. The return vales have changed, causing the library to interpret a successful connection as a fail.
Thank you both for your replies.
I thought I was setting myself up for a flame when I couldn't interpret the code tags correctly. Thank you for a kind reply.
I didn't do the wifi shield upgrade yet as I was trying to test it as much as possible before possible bricking it, but I guess it is time to do the upgrade.
I am trying to follow the instructions here
but in fact have some questions.
Where would be the best place to ask questions about that wifi shield upgrade procedure? On any specific subforum here on the arduino forum?
You don't have to try to brick your wifi shield to test this. Download an IDE version prior to v1.0.4 and try some of those examples. It should work ok.
Actually I have 1.0.0 on there now (came installed), and I cant run the "WifiWebClient" example program as listed in the original post.
I will post my wifi firmware upgrade questions here in the next post for want of a better place.
Any help with getting the "WifiWebClient" example to work (original post) or help with the firmware upgrade (next post) will both be appreciated.
I am trying to do a firmware upgrade of my wifi module and following instructions here
I installed Atmel's flip programmer on my PC. (no problem)
I downloaded the file wifiHD.elf and just put it on my desktop for now. (OK place?)
I downloaded the AVR 32 Drivers. And I unzipped the folder and just put it on my desktop.
Question 1: What do I do with the AVG 32 Drivers folder after I unzip it? The instructions say to “install the AVG 32 Drivers” but not sure how?
Now I open a command prompt and go to inside the flip installation directory. (no problem)
Question 2: the CMD line prompt is:
batchisp.exe -device AT32UC3A1512 -hardware usb -operation erase f memory flash blankcheck loadbuffer /Arduino/hardware/avr/arduino/firmwares/wifishield/binary/wifi_dnld.elf program verify start reset 0
but /Arduino/hardware/avr/arduino/firmwares/wifishield/binary/wifiHD.elf is the directory structure on the internet www.github website. Do I need to make a directory structure on my PC that exactly matches that? I just downloaded wifiHD.elf and put it on my desktop, was that not correct?
Finally
Question 3. There are two command prompt options:
batchisp.exe -device AT32UC3A1512 -hardware
and
batchisp.exe -device AT32UC3A1256 -hardware
How do I know which to use?
Question 2: the CMD line prompt is:
batchisp.exe -device AT32UC3A1512 -hardware usb -operation erase f memory flash blankcheck loadbuffer /Arduino/hardware/avr/arduino/firmwares/wifishield/binary/wifi_dnld.elf program verify start reset 0
but /Arduino/hardware/avr/arduino/firmwares/wifishield/binary/wifiHD.elf is the directory structure on the internet www.github website. Do I need to make a directory structure on my PC that exactly matches that? I just downloaded wifiHD.elf and put it on my desktop, was that not correct?
The path must match exactly, or the upgrade will fail. I moved both upgrade files to a folder that was easier to find.
FYI: Once you complete the wifi firmware upgrade, any IDE version wifi library prior to v1.0.4 will fail to connect.
Per the instructions, I use the command line to navigate to :
c:/Program Files/Atmel/Flip 3.4.7/bin
Then in order to execute this script:
batchisp.exe -device AT32UC3A1512 -hardware usb -operation erase f memory flash blankcheck loadbuffer /Arduino/hardware/avr/arduino/firmwares/wifishield/binary/wifi_dnld.elf program verify start reset 0
Do I need to create that whole directory structure? so I create directory Arduino , then hardware, then avr, then Arduino, then firmwares, then wifishield, then binary and end up with a long directory structure named:
c:/Program Files/Atmel/Flip 3.4.7/bin/Arduino/hardware/avr/arduino/firmwares/wifishield/binary/
and then I put my wifi_dnld.elf in there?
It seems I must be misinterpreting that; it just doesn’t seem right.
Let my try my question a couple of other ways:
What is the “root” or top level of the structure:
/Arduino/hardware/avr/arduino/firmwares/wifishield/binary/wifi_dnld.elf
?
Do I make that structure in C:/ ?
Was I supposed to only download the wifi_dnld.elf file? or was I supposed to download the entire /Arduino/hardware/avr/arduino/firmwares/wifishield directory structure somehow?
--
Maybe my confusion is somehow related to your FYI?
FYI: Once you complete the wifi firmware upgrade, any IDE version wifi library prior to v1.0.4 will fail to connect.
So , how do I get the wifi library for v1.0.4? And how do I make sure that I am using that and not using an IDE version prior to that?
I cleaned up these questions and put them under the Networking, protocols and devices forums. Sorry I let this post get so distorted.
If you have any suggestions about the original question about trying to run the "WifiWebClient" example sketch with the Wifi shield with original 1.0.0 firmware, please post here.
If you have any help with my wifi shield firmware upgrade questions, please post here.