pcbway

Arduino-Wifi-Interfacing-with-Online-Server1In today’s post, as the name suggests, we will see how to get data from online web server in simple steps. Getting data from web server using Arduino Wifi Shield has always remained a problem for the engineers. Its not much difficult task as its usually considered to be. In today’s post, I will create a small project in which I will control two simple LEDs via online web server. It’s really a very interesting project and when I completed it, I felt like Hurrah!!!

Arduino Wifi Shield is used to connect Arduino board with Wifi. After connectivity with Wifi, one can perform many tasks using this shield. We can built a complete server on it and can also use it as a client. Server designed on an Arduino Wifi Shield are usually quite simple as it doesn’t have much processing power to support heavy server. Arduino Wifi Shield is mostly used in home automation projects where home appliances are controlled by Wifi or can also be used for security purposes. In short, it has numerous applications and is widely used.

In today’s project, we will use Arduino UNO board for programming purposes, and will interface two leds with it and then we will control these leds via an online web server. Using that online web server, we will ON and OFF these leds on command. For controlling leds from an online server, we have to design two things:

  • Online Web Server.
  • Arduino Web Client.

Note:

  • The complete project has been sent to all the subscribed members. If you want this project code, then Subscribe to our mailing list, and it will be automatically emailed to you as well.

Project Description

First of all, I will explain what we are doing and what we want to achieve. In hardware, we will use:

  • Arduino UNO
  • Arduino Wifi Shield
  • LEDs x 2
  • 10k ohm x 2

Their arrangement and pin configuration is shown in the Arduino Web Client section. We will arrange them in such a way that two leds will be mounted on the Arduino UNO shield. In web server, we will design a simple page, which will be having four buttons on it, which will be:

  • LED 1 ON
  • LED 1 OFF
  • LED 2 ON
  • LED 2 OFF

When someone will open this web page and will pres any of these buttons, respective task will be performed on the Leds. i.e. if someone pressed the LED 1 ON button then Led 1 present on the Arduino board will get ON and when someone press LED 1 OFF button, that Led will go OFF and same function will be performed for second led. There won’t be any connection between the hardware and that web server, the only connection will be the Wifi. The Arduino Shield must have a Wifi connection available and one sitting from across the world can control them. Now let’s discuss these two parts, one by one.

Online Web Server

I have designed the online web server on my own site The Engineering Projects. This is a php page which I have uploaded on my web server. In order to make this page, simply follow the below steps:

  • Create a notepad and rename it to ArduinoWifi.php and save it somewhere, from where you can easily access it.
  • The webserver code is for sale and you can buy it just for $50. We have input a lot of effort to accomplish this project that’s why we have placed a very small amount on it. You can easily buy it by clicking the below button.

Buy WebServer Code

  • Save the file again and our web page is now ready to be uploaded. This web page will act as a web server for the Arduino device and will send commands to it.
  • Now we need to upload this web page on some website so that it can start working. In order to do so, you must have some web domain and hosting as I have mine on Godaddy or you can also use some free web hosting service.
  • What this code is doing, its actually using a file system. Whenever any button on this web page is pressed, it simply create a txt file with a letter. In this code, when someone pressed LE 1 ON button, character “1″ is saved in the txt file. Similarly character “2″ is saved in the txt file when LED 1 OFF is pressed and so on.

Note:

  • When you upload the webpage on the web server, then hit any button and check your web location where this page is uploaded, you must find a data.txt file in the same location.
  • If you can’t find the data.txt then generate it by yourself because in some web servers, generation of such files automatically is not granted.

We are done with the Web Server part, now let’s come to the Arduino Web Client part.

 

Arduino Web Client

  • First of all, place the Arduino Wifi Shield over the Arduino UNO shield, as shown in the below figure:

Arduino-Wifi-Interfacing-with-Online-Server1

  • Now, you need to place the two leds on two your Arduino UNO. The pin configuration for these LEDs are shown in the below figure:

Getting Data From Webserver using Arduino Wifi

  • Two leds are connected to pin no 3 and 4 of Arduino UNO board and are pulled down.
  • Now connect your Arduino UNO board with the computer and burn the below sketch into it.

#include <SPI.h>

#include <WiFi.h>

char ssid[] = “EvoWingle-12F3“; // your network SSID (name)

char pass[] = “093B3453“; // 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 status = WL_IDLE_STATUS;

char server[] = “www.theengineeringprojects.com“; // name address for Google (using DNS)

String location = “/Examples/data.txt HTTP/1.0“;

char inString[500]; // string for incoming serial data

int stringPos = 0; // string index counter

byte statusLed = 0;

char c;

int led1 = 3;

int led2 = 4;

WiFiClient client;

unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds

boolean lastConnected = false; // state of the connection last time through the main loop

const unsigned long postingInterval = 10*1000; // delay between updates, in milliseconds

void setup() {

//Initialize serial and wait for port to open:

Serial.begin(9600);

pinMode(led1,OUTPUT);

pinMode(led2,OUTPUT);

digitalWrite(led1, LOW);

digitalWrite(led2, LOW);

// check for the presence of the shield:

if (WiFi.status() == WL_NO_SHIELD) {

Serial.println(“WiFi shield not present”);

// don’t continue:

while(true);

}

// attempt to connect to Wifi network:

while ( status != WL_CONNECTED) {

Serial.print(“Attempting to connect to SSID: “);

Serial.println(ssid);

// Connect to WPA/WPA2 network. Change this line if using open or WEP network:

status = WiFi.begin(ssid, pass);

// wait 10 seconds for connection:

delay(10000);

}

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.print(“GET “);

client.println(location);

client.println(“Host: theengineeringprojects.com”);

// client.println(“Connection: close”);

client.println();

//readPage();

}else{

Serial.println(“connection failed”);

}

}

void loop(){

while (client.available()) {

c = client.read();

Serial.write(c);

CheckingStatus();

}

if (!client.connected() && lastConnected) {

Serial.println();

Serial.println(“disconnecting.”);

client.stop();

}

if(!client.connected() && (millis() – lastConnectionTime > postingInterval)) {

PingRequest();

}

lastConnected = client.connected();

}

void PingRequest(){

if (client.connect(server, 80)) {

// Serial.println(“connected to server”);

// Make a HTTP request:

client.print(“GET “);

client.println(location);

client.println(“Host: theengineeringprojects.com”);

client.println(“Connection: close”);

client.println();

//readPage();

lastConnectionTime = millis();

}else{

//Serial.println(“connection failed”);

client.stop();

}

}

void CheckingStatus(){

inString[stringPos] = c;

if(c == ‘*’)

{

statusLed = inString[stringPos – 1];

stringPos = 0;

// Serial.write(statusLed);

delay(500);

UpdatingStatus();

// delay(500);

// client.flush();

// delay(10000);

//PingServer();

}

stringPos ++;

}

void UpdatingStatus(){

if(statusLed == ’1′)

{

digitalWrite(led1, HIGH);

// Serial.write(‘OK’);

}

if(statusLed == ’2′)

{

digitalWrite(led1, LOW);

}

if(statusLed == ’3′)

{

digitalWrite(led2, HIGH);

}

if(statusLed == ’4′)

{

digitalWrite(led2, LOW);

}

}

void printWifiStatus() {

// print the SSID of the network you’re attached to:

Serial.print(“SSID: “);

Serial.println(WiFi.SSID());

// print your WiFi shield’s IP address:

IPAddress ip = WiFi.localIP();

Serial.print(“IP Address: “);

Serial.println(ip);

// print the received signal strength:

long rssi = WiFi.RSSI();

Serial.print(“signal strength (RSSI):”);

Serial.print(rssi);

Serial.println(” dBm”);

}

  • Before burning this sketch into your Arduino Shield, you need to change few things which I have written in bold style in the above code, and mentioned below:Now, everything’s done, so power up your Arduino and make sure that it has got connected with the Wifi and then hit the LED 1 ON button on your web page. If everything’s gone fine then the led on your Arduino board will get ON.
    • ssid is the name of your Wifi connection.
    • pass is the password of your wifi connection.
    • server is the server name on which the web page is uploaded, which in my case is my own site.
    • location is the location of the txt file generated by the webpage, the above web page code generated a txt file in the same location and gives it a name data.txt so I simply used that. (This part is bit confusing but read it twice and you will get it.)
  • I have added comments with the Arduino code but if still, you get into some trouble, ask in comments and I will try my best to resolve them.

Note:

  • Before starting anything, first run the demo code which comes with the Arduino Library and make sure that your Arduino Shield get connected with your Wifi connection.
  • Give the link of txt file generated by the web page, not the the web page itself.

That’s all for today, Stay Blessed, take care. :))

13 Comments

  1. Hey,

    In Project Description, using 2 x 10Kohm resistors and on Circuit-Diagram.jpg, it is 2 x 1kohm…
    What is the right?

    Happy nex year 2015…

  2. Hi I tried using the arduino code, but the ide displays a ton of errors could you possibly upload the code to github or email it to me? I am subscribed to the mailing list but haven’t received the product details

  3. Hi , I just wanted to know how how to send the bssid and signal strength of the wifi connected to to the central server from arduno uno & WiFi shield ?

  4. Hello,

    I put the sketch in the editor and I changed
    char ssid[] = “EvoWingle-12F3“; // your network SSID (name)
    char pass[] = “093B3453“; // your network password (use for WPA, or use as key for WEP)

    After proceeding the verification I got many errors messages

    Arduino: 1.6.7 (Windows 7), Board: “Arduino/Genuino Uno”

    sketch_WIFI_control:5: error: stray ‘\342’ in program

    char ssid[] = XXXXXXXXXXXX; // your network SSID (name)

    ^

    sketch_WIFI_control:5: error: stray ‘\200’ in program

    sketch_WIFI_control:5: error: stray ‘\234’ in program

    sketch_WIFI_control:5: error: stray ‘\342’ in program

    sketch_WIFI_control:5: error: stray ‘\200’ in program

    sketch_WIFI_control:5: error: stray ‘\234’ in program

    sketch_WIFI_control:7: error: stray ‘\342’ in program

    char pass[] = XXXXXXXXXX; // your network password (use for WPA, or use as key for WEP)

    ^

    sketch_WIFI_control:7: error: stray ‘\200’ in program

    sketch_WIFI_control:7: error: stray ‘\234’ in program

    sketch_WIFI_control:7: error: stray ‘\342’ in program

    sketch_WIFI_control:7: error: stray ‘\200’ in program

    sketch_WIFI_control:7: error: stray ‘\234’ in program

    sketch_WIFI_control:13: error: stray ‘\342’ in program

    char server[] = “www.theengineeringprojects.com“; // name address for Google (using DNS)

    ^

    sketch_WIFI_control:13: error: stray ‘\200’ in program

    sketch_WIFI_control:13: error: stray ‘\234’ in program

    sketch_WIFI_control:13: error: stray ‘\342’ in program

    sketch_WIFI_control:13: error: stray ‘\200’ in program

    sketch_WIFI_control:13: error: stray ‘\234’ in program

    sketch_WIFI_control:15: error: stray ‘\342’ in program

    String location = “/Examples/data.txt HTTP/1.0“;

    ^

    sketch_WIFI_control:15: error: stray ‘\200’ in program

    sketch_WIFI_control:15: error: stray ‘\234’ in program

    sketch_WIFI_control:15: error: stray ‘\342’ in program

    sketch_WIFI_control:15: error: stray ‘\200’ in program

    sketch_WIFI_control:15: error: stray ‘\234’ in program

    sketch_WIFI_control:55: error: stray ‘\342’ in program

    Serial.println(“WiFi shield not present�);

    ^

    sketch_WIFI_control:55: error: stray ‘\200’ in program

    sketch_WIFI_control:55: error: stray ‘\234’ in program

    sketch_WIFI_control:55: error: stray ‘\342’ in program

    sketch_WIFI_control:55: error: stray ‘\200’ in program

    sketch_WIFI_control:55: error: stray ‘\235’ in program

    sketch_WIFI_control:67: error: stray ‘\342’ in program

    Serial.print(“Attempting to connect to SSID: “);

    ^

    sketch_WIFI_control:67: error: stray ‘\200’ in program

    sketch_WIFI_control:67: error: stray ‘\234’ in program

    sketch_WIFI_control:67: error: stray ‘\342’ in program

    sketch_WIFI_control:67: error: stray ‘\200’ in program

    sketch_WIFI_control:67: error: stray ‘\234’ in program

    sketch_WIFI_control:81: error: stray ‘\342’ in program

    Serial.println(“Connected to wifi�);

    ^

    sketch_WIFI_control:81: error: stray ‘\200’ in program

    sketch_WIFI_control:81: error: stray ‘\234’ in program

    sketch_WIFI_control:81: error: stray ‘\342’ in program

    sketch_WIFI_control:81: error: stray ‘\200’ in program

    sketch_WIFI_control:81: error: stray ‘\235’ in program

    sketch_WIFI_control:85: error: stray ‘\342’ in program

    Serial.println(“\nStarting connection to server…�);

    ^

    sketch_WIFI_control:85: error: stray ‘\200’ in program

    sketch_WIFI_control:85: error: stray ‘\234’ in program

    sketch_WIFI_control:85: error: stray ‘\’ in program

    sketch_WIFI_control:85: error: stray ‘\342’ in program

    sketch_WIFI_control:85: error: stray ‘\200’ in program

    sketch_WIFI_control:85: error: stray ‘\246’ in program

    sketch_WIFI_control:85: error: stray ‘\342’ in program

    sketch_WIFI_control:85: error: stray ‘\200’ in program

    sketch_WIFI_control:85: error: stray ‘\235’ in program

    sketch_WIFI_control:91: error: stray ‘\342’ in program

    Serial.println(“connected to server�);

    ^

    sketch_WIFI_control:91: error: stray ‘\200’ in program

    sketch_WIFI_control:91: error: stray ‘\234’ in program

    sketch_WIFI_control:91: error: stray ‘\342’ in program

    sketch_WIFI_control:91: error: stray ‘\200’ in program

    sketch_WIFI_control:91: error: stray ‘\235’ in program

    sketch_WIFI_control:95: error: stray ‘\342’ in program

    client.print(“GET “);

    ^

    sketch_WIFI_control:95: error: stray ‘\200’ in program

    sketch_WIFI_control:95: error: stray ‘\234’ in program

    sketch_WIFI_control:95: error: stray ‘\342’ in program

    sketch_WIFI_control:95: error: stray ‘\200’ in program

    sketch_WIFI_control:95: error: stray ‘\234’ in program

    sketch_WIFI_control:99: error: stray ‘\342’ in program

    client.println(“Host: theengineeringprojects.com�);

    ^

    sketch_WIFI_control:99: error: stray ‘\200’ in program

    sketch_WIFI_control:99: error: stray ‘\234’ in program

    sketch_WIFI_control:99: error: stray ‘\342’ in program

    sketch_WIFI_control:99: error: stray ‘\200’ in program

    sketch_WIFI_control:99: error: stray ‘\235’ in program

    sketch_WIFI_control:109: error: stray ‘\342’ in program

    Serial.println(“connection failed�);

    ^

    sketch_WIFI_control:109: error: stray ‘\200’ in program

    sketch_WIFI_control:109: error: stray ‘\234’ in program

    sketch_WIFI_control:109: error: stray ‘\342’ in program

    sketch_WIFI_control:109: error: stray ‘\200’ in program

    sketch_WIFI_control:109: error: stray ‘\235’ in program

    sketch_WIFI_control:131: error: stray ‘\342’ in program

    Serial.println(“disconnecting.�);

    ^

    sketch_WIFI_control:131: error: stray ‘\200’ in program

    sketch_WIFI_control:131: error: stray ‘\234’ in program

    sketch_WIFI_control:131: error: stray ‘\342’ in program

    sketch_WIFI_control:131: error: stray ‘\200’ in program

    sketch_WIFI_control:131: error: stray ‘\235’ in program

    sketch_WIFI_control:137: error: stray ‘\342’ in program

    if(!client.connected() && (millis() – lastConnectionTime > postingInterval)) {

    ^

    sketch_WIFI_control:137: error: stray ‘\200’ in program

    sketch_WIFI_control:137: error: stray ‘\223’ in program

    sketch_WIFI_control:155: error: stray ‘\342’ in program

    client.print(“GET “);

    ^

    sketch_WIFI_control:155: error: stray ‘\200’ in program

    sketch_WIFI_control:155: error: stray ‘\234’ in program

    sketch_WIFI_control:155: error: stray ‘\342’ in program

    sketch_WIFI_control:155: error: stray ‘\200’ in program

    sketch_WIFI_control:155: error: stray ‘\234’ in program

    sketch_WIFI_control:159: error: stray ‘\342’ in program

    client.println(“Host: theengineeringprojects.com�);

    ^

    sketch_WIFI_control:159: error: stray ‘\200’ in program

    sketch_WIFI_control:159: error: stray ‘\234’ in program

    sketch_WIFI_control:159: error: stray ‘\342’ in program

    sketch_WIFI_control:159: error: stray ‘\200’ in program

    sketch_WIFI_control:159: error: stray ‘\235’ in program

    sketch_WIFI_control:161: error: stray ‘\342’ in program

    client.println(“Connection: close�);

    ^

    sketch_WIFI_control:161: error: stray ‘\200’ in program

    sketch_WIFI_control:161: error: stray ‘\234’ in program

    sketch_WIFI_control:161: error: stray ‘\342’ in program

    sketch_WIFI_control:161: error: stray ‘\200’ in program

    sketch_WIFI_control:161: error: stray ‘\235’ in program

    sketch_WIFI_control:183: error: stray ‘\342’ in program

    if(c == ‘*’)

    ^

    sketch_WIFI_control:183: error: stray ‘\200’ in program

    sketch_WIFI_control:183: error: stray ‘\230’ in program

    sketch_WIFI_control:183: error: stray ‘\342’ in program

    sketch_WIFI_control:183: error: stray ‘\200’ in program

    sketch_WIFI_control:183: error: stray ‘\231’ in program

    sketch_WIFI_control:187: error: stray ‘\342’ in program

    statusLed = inString[stringPos – 1];

    ^

    sketch_WIFI_control:187: error: stray ‘\200’ in program

    sketch_WIFI_control:187: error: stray ‘\223’ in program

    sketch_WIFI_control:213: error: stray ‘\342’ in program

    if(statusLed == ’1′)

    ^

    sketch_WIFI_control:213: error: stray ‘\200’ in program

    sketch_WIFI_control:213: error: stray ‘\231’ in program

    sketch_WIFI_control:213: error: stray ‘\342’ in program

    sketch_WIFI_control:213: error: stray ‘\200’ in program

    sketch_WIFI_control:213: error: stray ‘\262’ in program

    sketch_WIFI_control:223: error: stray ‘\342’ in program

    if(statusLed == ’2′)

    ^

    sketch_WIFI_control:223: error: stray ‘\200’ in program

    sketch_WIFI_control:223: error: stray ‘\231’ in program

    sketch_WIFI_control:223: error: stray ‘\342’ in program

    sketch_WIFI_control:223: error: stray ‘\200’ in program

    sketch_WIFI_control:223: error: stray ‘\262’ in program

    sketch_WIFI_control:231: error: stray ‘\342’ in program

    if(statusLed == ’3′)

    ^

    sketch_WIFI_control:231: error: stray ‘\200’ in program

    sketch_WIFI_control:231: error: stray ‘\231’ in program

    sketch_WIFI_control:231: error: stray ‘\342’ in program

    sketch_WIFI_control:231: error: stray ‘\200’ in program

    sketch_WIFI_control:231: error: stray ‘\262’ in program

    sketch_WIFI_control:239: error: stray ‘\342’ in program

    if(statusLed == ’4′)

    ^

    sketch_WIFI_control:239: error: stray ‘\200’ in program

    sketch_WIFI_control:239: error: stray ‘\231’ in program

    sketch_WIFI_control:239: error: stray ‘\342’ in program

    sketch_WIFI_control:239: error: stray ‘\200’ in program

    sketch_WIFI_control:239: error: stray ‘\262’ in program

    sketch_WIFI_control:253: error: stray ‘\342’ in program

    Serial.print(“SSID: “);

    ^

    sketch_WIFI_control:253: error: stray ‘\200’ in program

    sketch_WIFI_control:253: error: stray ‘\234’ in program

    sketch_WIFI_control:253: error: stray ‘\342’ in program

    sketch_WIFI_control:253: error: stray ‘\200’ in program

    sketch_WIFI_control:253: error: stray ‘\234’ in program

    sketch_WIFI_control:261: error: stray ‘\342’ in program

    Serial.print(“IP Address: “);

    ^

    sketch_WIFI_control:261: error: stray ‘\200’ in program

    sketch_WIFI_control:261: error: stray ‘\234’ in program

    sketch_WIFI_control:261: error: stray ‘\342’ in program

    sketch_WIFI_control:261: error: stray ‘\200’ in program

    sketch_WIFI_control:261: error: stray ‘\234’ in program

    sketch_WIFI_control:269: error: stray ‘\342’ in program

    Serial.print(“signal strength (RSSI):�);

    ^

    sketch_WIFI_control:269: error: stray ‘\200’ in program

    sketch_WIFI_control:269: error: stray ‘\234’ in program

    sketch_WIFI_control:269: error: stray ‘\342’ in program

    sketch_WIFI_control:269: error: stray ‘\200’ in program

    sketch_WIFI_control:269: error: stray ‘\235’ in program

    sketch_WIFI_control:273: error: stray ‘\342’ in program

    Serial.println(� dBm�);

    ^

    sketch_WIFI_control:273: error: stray ‘\200’ in program

    sketch_WIFI_control:273: error: stray ‘\235’ in program

    sketch_WIFI_control:273: error: stray ‘\342’ in program

    sketch_WIFI_control:273: error: stray ‘\200’ in program

    sketch_WIFI_control:273: error: stray ‘\235’ in program

    sketch_WIFI_control:5: error: ‘AOUDJEHANE’ was not declared in this scope

    char ssid[] = “AOUDJEHANE“; // your network SSID (name)

    ^

    sketch_WIFI_control:7: error: ‘simpleflex’ was not declared in this scope

    char pass[] = “simpleflex“; // your network password (use for WPA, or use as key for WEP)

    ^

    sketch_WIFI_control:13: error: ‘www’ was not declared in this scope

    char server[] = “www.theengineeringprojects.com“; // name address for Google (using DNS)

    ^

    sketch_WIFI_control:15: error: expected primary-expression before ‘/’ token

    String location = “/Examples/data.txt HTTP/1.0“;

    ^

    sketch_WIFI_control:15: error: ‘Examples’ was not declared in this scope

    String location = “/Examples/data.txt HTTP/1.0“;

    ^

    sketch_WIFI_control:15: error: ‘data’ was not declared in this scope

    String location = “/Examples/data.txt HTTP/1.0“;

    ^

    C:\Users\amine\Documents\Arduino\sketch_WIFI_control\sketch_WIFI_control.ino: In function ‘void setup()’:

    sketch_WIFI_control:55: error: expected ‘)’ before ‘shield’

    Serial.println(“WiFi shield not present�);

    ^

    sketch_WIFI_control:55: error: no matching function for call to ‘HardwareSerial::println(WiFiClass&)’

    Serial.println(“WiFi shield not present�);

    ^

    C:\Users\amine\Documents\Arduino\sketch_WIFI_control\sketch_WIFI_control.ino:55:45: note: candidates are:

    In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

    from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

    from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,

    from sketch\sketch_WIFI_control.ino.cpp:1:

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: size_t Print::println(const __FlashStringHelper*)

    size_t println(const __FlashStringHelper *);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:70:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘const __FlashStringHelper*’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: size_t Print::println(const String&)

    size_t println(const String &s);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:71:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘const String&’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: size_t Print::println(const char*)

    size_t println(const char[]);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:72:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘const char*’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: size_t Print::println(char)

    size_t println(char);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:73:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘char’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:74:12: note: size_t Print::println(unsigned char, int)

    size_t println(unsigned char, int = DEC);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:74:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘unsigned char’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:75:12: note: size_t Print::println(int, int)

    size_t println(int, int = DEC);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:75:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘int’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:76:12: note: size_t Print::println(unsigned int, int)

    size_t println(unsigned int, int = DEC);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:76:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘unsigned int’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:77:12: note: size_t Print::println(long int, int)

    size_t println(long, int = DEC);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:77:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘long int’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:78:12: note: size_t Print::println(long unsigned int, int)

    size_t println(unsigned long, int = DEC);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:78:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘long unsigned int’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:79:12: note: size_t Print::println(double, int)

    size_t println(double, int = 2);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:79:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘double’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:80:12: note: size_t Print::println(const Printable&)

    size_t println(const Printable&);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:80:12: note: no known conversion for argument 1 from ‘WiFiClass’ to ‘const Printable&’

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:81:12: note: size_t Print::println()

    size_t println(void);

    ^

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:81:12: note: candidate expects 0 arguments, 1 provided

    sketch_WIFI_control:67: error: ‘Attempting’ was not declared in this scope

    Serial.print(“Attempting to connect to SSID: “);

    ^

    sketch_WIFI_control:81: error: ‘Connected’ was not declared in this scope

    Serial.println(“Connected to wifi�);

    ^

    sketch_WIFI_control:85: error: ‘nStarting’ was not declared in this scope

    Serial.println(“\nStarting connection to server…�);

    ^

    sketch_WIFI_control:91: error: ‘connected’ was not declared in this scope

    Serial.println(“connected to server�);

    ^

    sketch_WIFI_control:95: error: ‘GET’ was not declared in this scope

    client.print(“GET “);

    ^

    sketch_WIFI_control:99: error: found ‘:’ in nested-name-specifier, expected ‘::’

    client.println(“Host: theengineeringprojects.com�);

    ^

    sketch_WIFI_control:99: error: ‘Host’ has not been declared

    client.println(“Host: theengineeringprojects.com�);

    ^

    sketch_WIFI_control:109: error: ‘connection’ was not declared in this scope

    Serial.println(“connection failed�);

    ^

    C:\Users\amine\Documents\Arduino\sketch_WIFI_control\sketch_WIFI_control.ino: In function ‘void loop()’:

    sketch_WIFI_control:131: error: ‘disconnecting’ was not declared in this scope

    Serial.println(“disconnecting.�);

    ^

    sketch_WIFI_control:131: error: expected unqualified-id before ‘)’ token

    Serial.println(“disconnecting.�);

    ^

    sketch_WIFI_control:137: error: expected ‘)’ before ‘lastConnectionTime’

    if(!client.connected() && (millis() – lastConnectionTime > postingInterval)) {

    ^

    sketch_WIFI_control:143: error: expected ‘)’ before ‘lastConnected’

    lastConnected = client.connected();

    ^

    C:\Users\amine\Documents\Arduino\sketch_WIFI_control\sketch_WIFI_control.ino: In function ‘void PingRequest()’:

    sketch_WIFI_control:155: error: ‘GET’ was not declared in this scope

    client.print(“GET “);

    ^

    sketch_WIFI_control:159: error: found ‘:’ in nested-name-specifier, expected ‘::’

    client.println(“Host: theengineeringprojects.com�);

    ^

    sketch_WIFI_control:159: error: ‘Host’ has not been declared

    client.println(“Host: theengineeringprojects.com�);

    ^

    sketch_WIFI_control:161: error: found ‘:’ in nested-name-specifier, expected ‘::’

    client.println(“Connection: close�);

    ^

    sketch_WIFI_control:161: error: ‘Connection’ has not been declared

    client.println(“Connection: close�);

    ^

    C:\Users\amine\Documents\Arduino\sketch_WIFI_control\sketch_WIFI_control.ino: In function ‘void CheckingStatus()’:

    sketch_WIFI_control:183: error: expected primary-expression before ‘)’ token

    if(c == ‘*’)

    ^

    sketch_WIFI_control:187: error: expected ‘]’ before numeric constant

    statusLed = inString[stringPos – 1];

    ^

    sketch_WIFI_control:187: error: expected ‘;’ before numeric constant

    C:\Users\amine\Documents\Arduino\sketch_WIFI_control\sketch_WIFI_control.ino: In function ‘void printWifiStatus()’:

    sketch_WIFI_control:253: error: ‘SSID’ was not declared in this scope

    Serial.print(“SSID: “);

    ^

    sketch_WIFI_control:261: error: ‘IP’ was not declared in this scope

    Serial.print(“IP Address: “);

    ^

    sketch_WIFI_control:269: error: ‘signal’ was not declared in this scope

    Serial.print(“signal strength (RSSI):�);

    ^

    sketch_WIFI_control:273: error: ‘dBm’ was not declared in this scope

    Serial.println(� dBm�);

    ^

    exit status 1
    stray ‘\342’ in program

    This report would have more information with
    “Show verbose output during compilation”
    enabled in File > Preferences.

  5. Hie. Can you please do a tutorial of sending a text file from arduino to a webserver using sim800 FTP and PHP or do you have one already?

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment