Cytron ESP8266 WiFi Shield Failed to Connect to Server

Bluetooth, XBee, RF......

Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby hadialloha » Tue Feb 02, 2016 10:57 pm

Hi Cytron Technical Team,

I'm currently doing my final year project using WiFi to control some outputs. But I have this problem where the WiFi can't connect to the server. It can be connected to my network router SSID. I can see it said connected on the Serial Monitor. When I searched the IP address on Google Chrome, the "opps this webpage is not available" thing came out. And after awhile, when I looked at the Serial Monitor again, it said failed to connect to server. I'd really appreciate for a quick respond because I'm already behind my schedule by a few weeks. Thanks in advance! :D
hadialloha
Freshie
 
Posts: 4
Joined: Tue Feb 02, 2016 10:37 pm

Re: Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby bengchet » Wed Feb 03, 2016 8:44 am

Hi,

First you need to understand which setup you need for ESPWiFi shield, server or client.
If configured as server, you can send request to this shield to obtain information or do something else. Like you open your browser and type IP address, in fact you are sending request to the shield.
If configured as client, you are making shield as client to access other servers to obtain information.
Please do understand the concepts of web servers and web clients first so that you know which one is suitable for your current application.

If you are using example sketch CytronWiFiDemo, it consists of functions which make the shield act as both server and client. Understanding which role suits your application, you can make some adjustments to your program. To disable server role, just comment serverTest(). To disable client role, comment clientTest().

hadialloha WROTE:when I looked at the Serial Monitor again, it said failed to connect to server.

It was taking the role as client and trying to connect to Adafruit server and obtain some information but apparently it failed. So of course when you searched IP address on Google Chrome, it won't work because it was not server at that time.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby hadialloha » Wed Feb 03, 2016 12:00 pm

Hi bengchet,

I already used the the SimpleWebServerWiFi example. This time around it connected to the wifi just fine and it can be seen its IP Address at the Serial Monitor. I have put an LED on pin 13 just like the program describe. But when try to run the IP Address to turn on the LED ( http://192.168.0.148/H) on Google Chrome, again the "this webpage is not available" came out.
hadialloha
Freshie
 
Posts: 4
Joined: Tue Feb 02, 2016 10:37 pm

Re: Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby bengchet » Wed Feb 03, 2016 2:37 pm

Hi,

For your case, if you cannot access the shield from Google Chrome, most likely the PC that you used doesn't connect to the WiFi same as the WiFi used by the shield. This sketch only allows access to shield within the same network. Of course, this is just hypothesis. Might have some other reasons. You can attach the photo showing the result from serial monitor.

Thank you.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Problem Solved!

Postby hadialloha » Thu Feb 04, 2016 12:01 am

Thank you so much bengchet. I just realize I didn't use the same WiFi on my laptop as the shield. But where do I make the changes in the programming to make it able to turn on the outputs without using the same WiFi. Because that's the whole point of my project. Do you have any arduino sketch for it?
Attachments
20203_234623.jpg
hadialloha
Freshie
 
Posts: 4
Joined: Tue Feb 02, 2016 10:37 pm

Re: Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby bengchet » Thu Feb 04, 2016 1:42 am

Hi,

Glad to hear that. However also sorry to say that we don't have any example sketch for your application.

In fact, your application requires more than just example sketch to complete. Here I just give your a tip and it is better for you to dig it out on your own.

Use cloud service for your application. Cloud server is basically a public server for users to make application like yours. The concept is like: your Arduino + WiFi shield send (push) information about LED status or whatever device attached to Arduino, the information is stored in cloud server. Then you can use your phone, PC or devices which support WiFi connection, to access this server to obtain (pull) these information. You can also do another way round, like your PC push the data and Arduino pull the data. In this case, these 2 devices don't need to be connected to same WiFi. Generally it requires you to make an account (usually free one) to reserve a place for storing these informations, and also security to obtain these info.

ThingSpeak is a good start for you. There are plenty of tutorials explaining how to use this service. Time to explore the world of IoT :lol:

Have fun learning.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby shack » Sat Apr 09, 2016 3:20 pm

Hi,

Regarding your Cytron Wifi shield, i can not find any code to connect your shield. when i try codes of the arduino Wifi shield it does not work as expected. So, is there any tutorial of your shield coding to sync to Thingspeak?

what i mean is, how to program using Cytron Wifi Library for ThingSpeak?
shack
Fledgling
 
Posts: 1
Joined: Thu Apr 07, 2016 5:32 pm

Re: Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby bengchet » Mon Apr 11, 2016 6:47 pm

Hi,

You can download and extract this library to My Documents->Arduino->Libraries. If you have old CytronWiFiShield library, save it as backup and move it to other place so these 2 libraries won't crash.

Additionally, you will need to install extra plugin. Open Arduino IDE, go to Sketch -> Include Library -> Manage Libraries. Look for 'ThingSpeak' Library by MathWork. Install it. After that you can restart Arduino IDE and compile example sketch named 'WiFiThingSpeak' under CytronWiFiShield. This example sketch might help you to kickstart your ThingSpeak application.
Attachments
CytronWiFiShieldv2-master.rar
(7.62 MiB) Downloaded 121 times
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am

Re: Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby lingez » Thu Jul 06, 2017 8:01 pm

My serial monitor shows Failed to connect to server. Both my shield and laptop are connected to the same network. I want the arduino to act as the server. Please help. Every step I followed exactly as were instructed in the tutorial.
lingez
Fledgling
 
Posts: 1
Joined: Thu Jul 06, 2017 7:57 pm

Re: Cytron ESP8266 WiFi Shield Failed to Connect to Server

Postby bengchet » Fri Jul 07, 2017 8:07 am

Hi,

The problem you have faced is that your shield is trying to connect to external server as client, and it requires Internet. If you are using CytronWiFiDemo sketch, you can try remove the line wifi.config(ip) in the sketch.

If you are focusing making server on Arduino, you can simply use SimpleWebServerWiFi example sketch to get started.
bengchet
Moderator
 
Posts: 237
Joined: Tue Aug 25, 2015 8:29 am


Return to Wireless Device

Who is online

Users browsing this forum: No registered users and 9 guests

cron