malaysia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« on: January 21, 2013, 10:28:45 am » |
am trying to send out messages from my arduino uno r3 to the internet through a WiFi shield v2.2 for arduino. Whenever i connect the board and send out a message, i get an error as below avrdude: stk500_getsync(): not in sync: resp=0x00
Refering to the blinking example with just the arduino connected, the leds blink and there is no error. Error occurs when i connect the wifi sheild. This issue is not due to the com ports. Could anyone out there have a reason to why this is happening?
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen, Denmark
Offline
God Member
Karma: 18
Posts: 839
Have you testrun your PDE file today?
|
 |
« Reply #1 on: January 21, 2013, 10:51:13 am » |
"avrdude" implies that you are trying to load a new program. You say "Write a message" - could you explain that a little more? What is the origin of the message, where is it supposed to go, and via which wire/network?
|
|
|
|
|
Logged
|
|
|
|
|
malaysia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #2 on: January 21, 2013, 07:29:09 pm » |
Am tries to send a message to the internet. Amusing the Wizfi2x0 sheild library for urduino. The code compiles without errors. But when i upload, i get the::: avrdude: stk500_getsync(): not in sync: resp=0x00 Here is the code: // WizFi210 communicates using SPI, so include the SPI library: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <SPI.h> #include <WizFi2x0.h> #include <WizFiClient.h> #include <TimerOne.h>
byte IsTimer1Expired = 0; uint16_t CurrentTime = 0;
#define SSID "yourSSID" // SSID of your AP #define Key "passphrase" // Key or Passphrase
unsigned char SIP[4] = {192, 168, 123, 119}; unsigned int ServerPort = 5000;
WizFi2x0Class myWizFi; WizFiClient myClient; TimeoutClass ConnectInterval;
SPIChar spichar;
// pins used for the connection with the WizFi210
boolean Wifi_setup = false; boolean ConnectionState = false; boolean Disconnect_flag = false; boolean Connect_flag = false;
/////////////////////////////// // 1msec Timer void Timer1_ISR() { uint8_t i; myWizFi.ReplyCheckTimer.CheckIsTimeout(); } // //////////////////////////////
void setup() { byte key, retval, i; byte retry_count = 0; byte tmpstr[64]; Serial.begin(9600); Serial.println("\r\nSerial Init"); myClient = WizFiClient(SIP, ServerPort); // initalize WizFi2x0 module: myWizFi.begin(); // Timer1 Initialize Timer1.initialize(1000); // 1msec Timer1.attachInterrupt(Timer1_ISR); myWizFi.SendSync(); myWizFi.ReplyCheckTimer.TimerStart(1000); Serial.println("Send Sync data"); while(1) { if(myWizFi.CheckSyncReply()) { myWizFi.ReplyCheckTimer.TimerStop(); Serial.println("Rcvd Sync data"); break; } if(myWizFi.ReplyCheckTimer.GetIsTimeout()) { Serial.println("Rcving Sync Timeout!!"); return; } }
//////////////////////////////////////////////////////////////////////////// // AP association while(1) { retval = myWizFi.associate(SSID, Key, WEP_SECURITY, true); if(retval == 1){ Serial.println("WizFi2xo AP Associated"); Wifi_setup = true; break; }else{ Serial.println("AP association Failed"); } } }
void loop() { uint8_t retval, i; byte rcvdBuf[129]; byte cmd; byte TxBuf[100]; memset(rcvdBuf, 0, 129); if(Wifi_setup) { myWizFi.RcvPacket(); if(myClient.available()){ if(myClient.read(rcvdBuf)) { Serial.print("CID["); Serial.print((char)myClient.GetCID()); Serial.print("]"); Serial.println((char *)rcvdBuf); myClient.write(rcvdBuf); } if(Disconnect_flag) { retval = myClient.disconnect(); Disconnect_flag = false; if(retval == 1) Serial.println("Disconnected! "); else Serial.println("Disconnection Failed"); } }else{ if(Connect_flag) { retval = myClient.connect(); Connect_flag = false; if(retval == 1) { Serial.println("Connected! "); }else Serial.println("Connection Failed"); } } CheckConsoleInput(); } }
void CheckConsoleInput(void) { uint8_t ch; if(Serial.available() > 0) ch = Serial.read(); switch(ch) { case 'd': case 'D': Disconnect_flag = true; break; case 'c': case 'C': Connect_flag = true; break; case 's': case 'S': if(myClient.IsConnected()) Serial.println("Connected"); else Serial.println("Disconnected"); break; } }
Any views on the cause of the error? Note: Programming the arduino alone works perfectly.
|
|
|
|
|
Logged
|
|
|
|
|
NE PA
Offline
Full Member
Karma: 5
Posts: 149
|
 |
« Reply #3 on: January 21, 2013, 07:38:55 pm » |
Edit, Nevermind, I just noticed the second part of your post.
|
|
|
|
« Last Edit: January 21, 2013, 07:41:50 pm by Quick5pnt0 »
|
Logged
|
|
|
|
|
malaysia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #4 on: January 21, 2013, 07:45:17 pm » |
I have disconnected the usb and restarted the ide. Am sure the right port is selected, since i can compile the code without error on the ide. Still experiencing the same problem: avrdude: stk500_getsync(): not in sync: resp=0x00
Any solution out there for me?
|
|
|
|
|
Logged
|
|
|
|
|
NE PA
Offline
Full Member
Karma: 5
Posts: 149
|
 |
« Reply #5 on: January 21, 2013, 07:58:47 pm » |
You don't happen to have anything connected to digital pins 0 or 1 do you?
|
|
|
|
|
Logged
|
|
|
|
|
malaysia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #6 on: January 21, 2013, 08:02:54 pm » |
Nothing is connected to digital pins 1 and 0 My hardware only includes the arduino uno r3 and the wifi sheild
|
|
|
|
|
Logged
|
|
|
|
|
NE PA
Offline
Full Member
Karma: 5
Posts: 149
|
 |
« Reply #7 on: January 21, 2013, 08:04:14 pm » |
And if you disconnect the wifi shield will it upload the sketch?
|
|
|
|
« Last Edit: January 21, 2013, 08:07:16 pm by Quick5pnt0 »
|
Logged
|
|
|
|
|
malaysia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #8 on: January 21, 2013, 08:06:35 pm » |
Yes, without the WiFi shield the arduino uploads
|
|
|
|
|
Logged
|
|
|
|
|
NE PA
Offline
Full Member
Karma: 5
Posts: 149
|
 |
« Reply #9 on: January 21, 2013, 08:11:24 pm » |
Install the wifi shield and try to upload again. This time when the ide starts uploading press the reset button on the board. I've read that some shields can cause a conflict with the reset.
|
|
|
|
|
Logged
|
|
|
|
|
malaysia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #10 on: January 21, 2013, 08:37:09 pm » |
i have done as above But still experiencing the same error
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6391
-
|
 |
« Reply #11 on: January 22, 2013, 05:25:40 am » |
Does the Arduino board actually reset when you start an upload to it?
|
|
|
|
|
Logged
|
|
|
|
|
malaysia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #12 on: January 22, 2013, 08:31:30 am » |
Yes it does The L led blinks
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen, Denmark
Offline
God Member
Karma: 18
Posts: 839
Have you testrun your PDE file today?
|
 |
« Reply #13 on: January 22, 2013, 04:39:10 pm » |
The problem has nothing to do with the program... uhm... second thoughts: When it has compiled, how large is the program?
Assuming it is not too large, when the upload does suceed, do you see the TX and RX LEDs light/blink for 10 to 30 seconds?
If the upload is correct with the Arduino on its own, then you can unplug the Arduino, plug on the WiFi shield and then power it up. There is no requirement for the WiFi shield for the program to be uploaded, only when executing.
|
|
|
|
|
Logged
|
|
|
|
|
malaysia
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #14 on: January 24, 2013, 11:40:50 pm » |
The program is not large. Yes the RX/TX leds do blink Still the error is not solved. i reinstalled the drivers for arduino to the latest one, problem not solved. Any one with a solution?
|
|
|
|
|
Logged
|
|
|
|
|
|