# WiFi sketch upload error

**URL:** <https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393>\
**Category:** Programming\
**Created:** [November 24, 2022, 5:44am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393 "2022-11-24T05:44:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 24, 2022, 5:44am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/1 "2022-11-24T05:44:50Z")

</div>

Trying to upload AP\_Simplewebserver example - no success  
use - WiFi ESP8266M00  
board - Arduino Uno WiFi  
port - correct  
ID and PW - correct

Saw an earlier solution however cannot open it.

error - invalid library found.

copying code up until loop

#include \<SPI.h\>  
#include \<WiFi101.h\>  
#include "arduino\_secrets.h"  
///////please enter your sensitive data in the Secret tab/arduino\_secrets.h  
char ssid[] = SECRET\_SSID; // your network SSID (name)  
char pass[] = SECRET\_PASS; // your network password (use for WPA, or use as key for WEP)  
int keyIndex = 0; // your network key Index number (needed only for WEP)

int led = LED\_BUILTIN;  
int status = WL\_IDLE\_STATUS;  
WiFiServer server(80);

void setup() {  
//Initialize serial and wait for port to open:  
Serial.begin(9600);  
while (!Serial) {  
; // wait for serial port to connect. Needed for native USB port only  
}

Serial.println("Access Point Web Server");

pinMode(led, OUTPUT); // set the LED pin mode

// check for the presence of the shield:  
if (WiFi.status() == WL\_NO\_SHIELD) {  
Serial.println("WiFi shield not present");  
// don't continue  
while (true);  
}

// by default the local IP address of will be 192.168.1.1  
// you can override it with the following:  
WiFi.config(IPAddress(10, 0, 0, 1));

// print the network name (SSID);  
Serial.print("Creating access point named: ");  
Serial.println(ssid);

// Create open network. Change this line if you want to create an WEP network:  
status = WiFi.beginAP(ssid);  
if (status != WL\_AP\_LISTENING) {  
Serial.println("Creating access point failed");  
// don't continue  
while (true);  
}

// wait 10 seconds for connection:  
delay(10000);

// start the web server on port 80  
server.begin();

// you're connected now, so print out the status  
printWiFiStatus();  
}  
please help.

neil

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [November 24, 2022, 8:01am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/2 "2022-11-24T08:01:47Z")

</div>

for Arduino Uno WiFi rev 2 uses the WiFiNINA library, not the WiFi101 library.

for Robotdyn/Wemos Uno+WiFi board use my WiFiEspAT library with AT firmware 1.7 in the esp8266

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 24, 2022, 9:55am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/3 "2022-11-24T09:55:09Z")

</div>

shall try and let u know thx so much

sunil V

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 24, 2022, 10:28am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/4 "2022-11-24T10:28:19Z")

</div>

never ending problem!

i have made robots from obstacle avoiding - robot arm - chat bot - ethernet  
without any problem but always i face some issue with WiFi

i included the relevant library and now i get a compile error!

error -

In file included from C:\Users\user\Documents\Arduino\libraries\WiFiNINA-master\src/WiFiStorage.h:23:0,  
from C:\Users\user\Documents\Arduino\libraries\WiFiNINA-master\src/WiFi.h:38,  
from C:\Users\user\Documents\Arduino\libraries\WiFiNINA-master\src/WiFiNINA.h:23,  
from C:\Users\user\Documents\Arduino\AP\_SimpleWebServer\AP\_SimpleWebServer\AP\_SimpleWebServer.ino:21:  
C:\Users\user\Documents\Arduino\libraries\WiFiNINA-master\src/utility/wifi\_drv.h:293:12: error: 'PinStatus' does not name a type  
static PinStatus digitalRead(uint8\_t pin);  
^ ~~~~~~~~  
exit status 1  
Error compiling for board Arduino Uno WiFi.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [November 24, 2022, 10:43am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/5 "2022-11-24T10:43:07Z")

</div>

Hi @neilal

> [@neilal](#):
>
> Error compiling for board Arduino Uno WiFi

Are you certain your board is really an [Arduino Uno WiFi](https://docs.arduino.cc/retired/boards/arduino-uno-wifi)?

I ask because these retired boards are quite rare.

The similarly named [**Uno WiFi Rev2**](https://store.arduino.cc/products/arduino-uno-wifi-rev2) is much more common.

There are also 3rd party Chinese ESP8266-based boards advertised as "Uno WiFi".

We need to know exactly which board you have. Please post a link to where you bought the board from.

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 24, 2022, 3:16pm UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/6 "2022-11-24T15:16:49Z")

</div>

thanks so much.

its an UPLOAD error not a compilation error.

Are you certain your board is really an [Arduino Uno WiFi](https://docs.arduino.cc/retired/boards/arduino-uno-wifi)? NO

Board info under TOOLS says -  
BN: Unknown board  
VID: 1A86  
PID: 7523  
SN: Upload any sketch to obtain it

few years ago i bought this WiFi addon to wifi UNO. from CHINA  
i have no info on where i bought it, the exact vendor.

attached a photo for your perusal. (only 1 allowed)

maybe as u say its the fault of WiFi addon.

sunil V

 ![20221124_202448.jpg](https://europe1.discourse-cdn.com/arduino/original/4X/6/f/d/6fdb31b8da7165738acd9234a73253d1089d9abb.jpeg)

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [November 24, 2022, 3:25pm UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/7 "2022-11-24T15:25:53Z")

</div>

photo of the whole board would be better, but it is definitively not Arduino Uno WiFi first or second

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 25, 2022, 1:45am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/8 "2022-11-25T01:45:51Z")

</div>

thx a lot.

photo of board  
yes it maybe the board at fault.

 ![20221124_201910.jpg](https://europe1.discourse-cdn.com/arduino/original/4X/6/2/5/6253c0115bb988b48adfae3fe46724ded763c3b1.jpeg)

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 25, 2022, 4:41am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/9 "2022-11-25T04:41:13Z")

</div>

juraj,

its a WiFi shield sitting on an UNO. can't take clear pics with my mobile so sorry.

its not a WiFi board. as u say it must be a fault with the WiFi shield.

cheers!

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 25, 2022, 5:05am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/10 "2022-11-25T05:05:50Z")

</div>

i got a clear pic of WiFi shield. pl check.

 ![20221125_103243.jpg](https://europe1.discourse-cdn.com/arduino/original/4X/3/1/e/31ee8754c9b0182a497c5f23769eb801a6217b27.jpeg)

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [November 25, 2022, 5:30am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/11 "2022-11-25T05:30:53Z")

</div>

Hi,  
Have you checked the web site.

 ![wifiarduino](https://europe1.discourse-cdn.com/arduino/original/4X/e/c/7/ec774031e94e080847929c1c414a0744ba5228f1.jpeg)

Tom.. 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [November 25, 2022, 6:14am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/12 "2022-11-25T06:14:21Z")

</div>

> [@neilal](#):
>
> its a WiFi shield sitting on an UNO. can't take clear pics with my mobile so sorry.
> 
> its not a WiFi board. as u say it must be a fault with the WiFi shield.

It is not a fault with the WiFi shield. The fault is that you have selected the wrong board in the Arduino IDE. Putting a WiFi shield on an Uno doesn't magically turn it into an Uno WiFi. You must select **Tools \> Board \> Arduino AVR Boards \> Arduino Uno** from the Arduino IDE menus.

* * *

You will also not be able to use the **WiFiNINA** library. I haven't used this type of shield for some years, but at the time I was using it this was the most beginner friendly option:

> **[GitHub - bportaluri/WiFiEsp: Arduino WiFi library for ESP8266 modules](https://github.com/bportaluri/WiFiEsp)**
>
> Arduino WiFi library for ESP8266 modules

* * *

**Juraj** also has a very nice library for this configuration:

> **[GitHub - JAndrassy/WiFiEspAT: Arduino networking library. Standard Arduino WiFi...](https://github.com/JAndrassy/WiFiEspAT)**
>
> Arduino networking library. Standard Arduino WiFi networking API over ESP8266 or ESP32 AT commands.

As mentioned, the **WiFiEspAT** library requires a relatively modern version of the AT firmware to be installed on the ESP8266 on the shield. I have no idea whether your shield has the required firmware. They did not at the time I purchased mine.

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 25, 2022, 7:39am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/13 "2022-11-25T07:39:48Z")

</div>

no use - thx.  
bought from an ebay seller.

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 25, 2022, 7:59am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/14 "2022-11-25T07:59:05Z")

</div>

thanks again.

yes i tried with selecting UNO it still has the problem with LOADING.  
as you say it the shield may not be faulty but  
i am not an expert to say there's nothing wrong with the shield.  
it could be a hardware issue which is beyond me.

i have no background in electronics, and have covered all possible robots but  
no luck with wifi.

we have exhausted all possible solutions - maybe it's time to close this issue.

thank all.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [November 25, 2022, 8:37am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/15 "2022-11-25T08:37:16Z")

</div>

> [@neilal](#):
>
> i tried with selecting UNO it still has the problem with LOADING.

Please post the full and exact text of any error output you see in the Arduino IDE after you have "the problem with LOADING".

Please also tell us which version of Arduino IDE you are using so that we can provide appropriate instructions.

> [@neilal](#):
>
> we have exhausted all possible solutions - maybe it's time to close this issue.

Not even close. We are just getting started.

These shields are tricky to work with, but you can definitely achieve success if you are persistent.

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [November 25, 2022, 10:53am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/16 "2022-11-25T10:53:08Z")

</div>

the shield blocks RX/TX of Serial1 which is used by the USB.

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 25, 2022, 11:19am UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/17 "2022-11-25T11:19:33Z")

</div>

Ardunino version 1.8.13. i saw the latest as 2.0.2 - i might try that too and let u know.

these types of error msgs i have tackled before but with this WiFi one i couldn't  
in fact after two years i got back to robotics - so it's a long time!

thx a lot

trying to load an example - AP\_SimpleWebServer

error msg  
Sketch uses 26358 bytes (81%) of program storage space. Maximum is 32256 bytes.  
Global variables use 1451 bytes (70%) of dynamic memory, leaving 597 bytes for local variables. Maximum is 2048 bytes.  
An error occurred while uploading the sketch  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 1 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 2 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 3 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 4 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 5 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 6 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 7 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 8 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 9 of 10: not in sync: resp=0x85  
avrdude: stk500\_recv(): programmer is not responding  
avrdude: stk500\_getsync() attempt 10 of 10: not in sync: resp=0x85

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [November 25, 2022, 12:01pm UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/18 "2022-11-25T12:01:13Z")

</div>

Please try this:

1. Move the switch marked "1" on the shield to the Off position.
2. Upload your sketch to the Uno.
3. Move the switch marked "1" on the shield to the On position.

One of the difficult things about using this shield with the Uno is the communication between the ATmega328P microcontroller on the Uno and the ESP8266 microcontroller on the shield is done via pins 0 and 1 on the Uno. The Uno also uses those pins to communicate with your computer for things like uploads and Serial Monitor. This causes uploading a sketch to the Uno to fail.

Switches 1 and 2 on the shield are connected between the Uno's pins 0 and 1 and the ESP8266. So by putting the switches in the Off position you disconnect the ESP8266 communication with the Uno, which allows the Uno to communicate with the computer without the ESP8266 interfering.

But of course you might want to communicate between the Uno and the ESP8266 over these pins, so this is why you would change the switches back to the On position after the upload finishes. After doing that, you might also want to press the reset button on the Uno so that the sketch program will start over again with the ability to communicate with the ESP8266.

This dual use of pins 0 and 1 also means that you have to be very careful (or avoid entirely) using things like `Serial.println()` in your sketch to print debug information to the Arduino IDE Serial Monitor. Those messages would also be sent to the ESP8266. This means you lose a very valuable feedback mechanism for your sketch programs. Once you have Wi-Fi communication working, you can use that as a substitute, but we often need some debug output to figure out why the Wi-Fi communication isn't working.

* * *

This is actually the problem I ran into with that **WiFiEsp** library. After quite some struggling, I discovered the author added a bunch of Serial prints in the library source code for debugging. That is reasonable to have when doing development work on a library, but what is not reasonable is they distributed the library to the users with the debug output still enabled! That debug output broke the communication between the Uno and the ESP8266.

I assumed they just forgot to turn off the debug output before publishing the library and submitted a fix, but the library author rejected it:

> <https://github.com/bportaluri/WiFiEsp/pull/46>
>
> This allows use with ESP8266 connected to Serial without needing to edit the lib…rary, reduces memory usage and decreases execution times.

So this meant that it is necessary for the user to edit the library source code in order to use the library with a shield like this on an Uno or Mega.

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 25, 2022, 12:59pm UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/19 "2022-11-25T12:59:39Z")

</div>

Thx so much u have taken a true professional approach to solve this problem abd higjly educational too for beginners. I am so grateful for that. I shall try what u have suggested. Now i remember the common problem i had when using HC 04 where u need to disconnect 0 and 1 pins to load a program and connect them later. I sincerely feel the examples must indicate these types of hints at the top of the program on the comment area as no one will ever figure it out except people of ur calibre. Thanks again

---

<div class="post-metadata">

**Author:** ![neilal](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@neilal](https://forum.arduino.cc/u/neilal)\
**Post date:** [November 25, 2022, 1:37pm UTC](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393/20 "2022-11-25T13:37:59Z")

</div>

attached photos (two emails)

i did put off switch 1 to off and uploaded the pgm.  
i still got the same error.

actually i too expected it will upload as with the same scenario with HC04/05

mmmm wonder whats going on. i used a new cable too.

 ![20221125_185726.jpg](https://europe1.discourse-cdn.com/arduino/original/4X/7/6/f/76ff346ba36a6632916136f898e35298e8c54d71.jpeg)

[Next page](https://forum.arduino.cc/t/wifi-sketch-upload-error/1057393.md?page=2)
