[SOLVED] Arduino WiFi Shield can't connect to any server

Hi, murilopicanco,
I have try it on another network, but I have the same problem with disconection. I have tryied in this network C3000 WiFi Shield and it is working well, also I have tryied Arduino Ethernet Shield (with wire) and it is too working well.
@Dmitriy Arduino WiFi Shield works fine without Blynk.

Hi @Janis

I’m afraid I’ve run out of options on what to try.
I can just tell you the exact versions of what I am running here where everything is working fine, so that you can compare:

On my home router I had to open ports 8441 to 8443 for the specific IP address of my shield to get it to connect.
The Sketch I’m using is the example one that comes with the Blynk library but with that small modification I sent to you earlier, since the standard sketch does not work properly with the WiFi due to the “Connecting to … **?**loud.blynk.cc” where a weird question mark appears out of nowhere on the serial monitor instead of the “c” for “cloud”.

Hope you manage to find the problem.
Cheers

This kind of weird stuff usually happend when there is a lot of radio interference in the air. However, since it works fine by itself it is a bit unlikely, but still possible. What kind of area do you live? Does it have lots of other wifi networks? Especially 2.4Ghz is nasty. You could check with tools like inssider.

It could be a difference in handleing connections from one library to another that causes this, but then again, the hardware probably is ok. Wifi is really hard to diagnose ( I manage about 700 accesspoints and well over 1500 wifi clients per day on average at work … ).

I have test it in non populated place, so there is just one my WiFi router. Also I have WiFi C3000 and it’s works fine. It have ping about 150ms
but if I connect with Arduino WiFi shield it show ping more than 950ms and if I start slide a slider on blynk app then it was disconnects very fast!

Dear @Janis

This may not be your particular issue with connections dropping frequently, but since this topic is discussing connectivity issues, I thought I should add something I came across this week that does affect the stability of some (if not most) boards. USB cables!

I started playing around with the Arduino Yun about 2 weeks ago. With a high quality USB cable it is steady as a rock with Blynk. :smile: One day I needed to use the cable for something else as it was the correct length, so I replaced it temporarily with a shorter (and cheaper looking) cable. With this setup I started losing my connection every couple of minutes. Swapped the cables back and the problem was gone.

With that in mind a did some tests with my Arduino Uno and the original WiFi shield, trying a few cables I had lying around. The same happens. Some cables could transport the correct amount of current for the boards and some could not.

So for each board that you use (Uno, Mega, Yun, etc.) and each model of shield you select to connect to them without an additional cable (i.e. the shield is stacked on top of the board being powered by the same USB cable), the system will draw a total amount of current to keep both the board and shield running properly.

If a particular cable offers too much electrical resistance, the system may be unstable/erratic and in the case of a board + WiFi shield configuration, the first thing that would fail would be your connection as the chip requires a reasonable amount of current to operate properly.

If the cable is good, the last thing to check is if the power supply being used (of the correct output voltage) is actually capable of supplying the required current for the board and the shield(s) considering the losses caused by the cable.

3 Likes

Thank you murilopicanco !! You was right, I was tested with good one now, and it is helps! Now connection is stable! I found the same problem with diferent PC’s. Some of PC can give as mutch power as others on USB.

2 Likes

:clap: I’m glad it is working @Janis.

As per my experience you must check the library of your code and the address which you are using for your router.
What are the specifications of your router that you are using with the Arduino?
Also which interface you are using between both of your devices?
Does router contain any firmware and is it compatible with the Arduino code?

assembling pcb

Hi,

I had the same problem as Janis, except my serial monitor wrote Connecting to ÿloud.blynk.cc:8442. I’m using the arduino wifi shield on an arduino mega.

The problem has been fixed by following murilopicanco’s steps.

Thanks a lot!

3 Likes

SAME STORY HERE! Fixed using IP address instead of domain name, but when Blynk came out everything was fine, I guess something got messed up by last updates. No need to open ports on router.

Hi Murilo,

I have come back to this after a few weeks working on other stuff.
Just wanted to ask you something else if thats ok?

I have this ethernet shield (without POE) below sitting on top of the Arduino Uno.

https://store.arduino.cc/product/A000072

It is just to get Blynk talking to the board so have a basic flashing LED Arduino sketch set up. I have set up the Blynk button etc…when I upload the arduino sketch with the blynk authorisation code in it is ok, no errors.
but when I press play in the Blynk app, I get an error saying ‘Arduino UNO is offline’.
I think it is just some basic cable or port error?

- Is my Arduino UNO below the shield meant to be connected to the usual power supply cable OR is it meant to be connected to my imac via USB?

- Is my shield (sitting on top of the UNO) at the same time meant to be also connected to the imac via CAT 5 cable (with RJ45 connector going from shield to imac?)

- my port setting on the uno says ‘/dev/cu.usbmodem641 (Arduino Uno)’ does this sound correct?

Would you say it is a port issue or cable issue that is stopping Blynk talking to the board?

any help appreciated.

Hello @stackr

You only need to power up the Uno board.
The Ethernet shield will obtain power from the Uno.

To power up the Uno you can use anything within its voltage & current working range. A USB cable connected to your Mac or an external power source (for instance 5V, 1000mA) will both work.

Your port setting sounds correct.

I have not seen your code so no idea why you can’t connect to Blynk. It could be a bad cable, it could be the type of cable (twisted pair vs direct), or configurations in your local router, etc. but the standard example that comes with the Blynk library should work perfectly fine if everything is correct.

Try using any of the internet examples that comes with the Arduino software and forget Blynk for now. If they work, there is no reason why Blynk should not work other than port settings as far as I see it.

hI Murilo,

ok forgetting about using blynk for time being until I make sure the shield is getting online.
I have a power supply now running into the UNO board only.

The initial Arduino sketch with LED as pin 7 was working on the UNO board locally.

after setting up as pin 7 as Blynk I am running the default ethernet sketch as suggested below but get his error in the serial monitor window.

[0] Blynk v0.3.1
[1] Gewtting IP…
[60460] DHCP failed!

am I meant to put in other info in the sketch below or missing something really basic?


/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno it is attached to digital pin 13.

*/

char auth[] = “MY TOKEN GOES HERE”; // Put your Auth Token here.

void setup()
{
Serial.begin(9600); // See the connection status in Serial Monitor
Blynk.begin(auth); // Here your Arduino connects to the Blynk Cloud.
}

void loop()
{
Blynk.run(); // All the Blynk Magic happens here…

// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}


Please edit your post. Code should be formatted.
Wrap the code by pressing this magic button (Backtick`) 3 times (before the code and after it):**

This makes your code beautiful with highlighted syntax, like this:

//comment goes here 
void helloWorld() { 
   String message =  "hello" + "world"; 
}

You can also select the code and press </> button in the top menu:

Can you get the ethernet shield working without Blynk? Does it run any example sketches that come with the library?

Dear @stackr

Please connect your shield to the Uno board, run a network cable from the shield to your router, power up the Uno from your computer USB and upload this code: https://www.arduino.cc/en/Tutorial/WebClient

Replace the MAC address you see in the code with your shield’s MAC address.
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; \\ Keep the 0x and replace the other digits with your shield's MAC

Replace the ip address in the code with a local address that makes sense to your network.
IPAddress ip(192, 168, 0, 177); \\ check other devices in your network and assign an unique address here

Run the sketch. If it does not work you have a cable, shield, router and or connection problem.
If it works, Blynk should work.

Cheers

ok thanks. I don’t have my own router, I’m in an office building on a network.Ill try various cable/power combinatiuons. Also the IP address in my network settings are different to my machines IP address, so use the network ones? and the shields MAC address, where is this, the newer shields have it on a sticker on the shield, mine is an old one.

I got blynk to work, many many thanks for your help. A bit of cable experimenation and reinstall of the blynk library did it.

1 Like

Nice work @stackr !!

Hi,

i am working in .net oriented project and i am totally not aware about the electrical circuits and diagrams. now i am working with the project related to Arduino board, now i am facing problem on connecting the Arduino wifi shield with available wifi network.

While testing, the board does not finding the available wifi network. always showing no connection found.

i have not provided any external power supply to the UNO board. i was connected the USB cable with my LAP to Arduino board.

Kindly suggest me is i need to provide the external power supply for the board to work with WIFI shield.

Regards
Gopi K