I am trying to upload data from arduino to a local server using Arduino wifi shied.But the code never reaches the line "connected".I am using WAMP server.The IP address ping of the arduino wifi shield is okay.The wifi shield connects to the network.The code is below:
#include <TinkerKit.h>
#include <WiFi.h>
#include <SPI.h>
char ssid[] = "Connectify-moloi"; // your network SSID (name)
char pass[] = "1234567890"; // your network password
int status = WL_IDLE_STATUS;
//WiFiServer server(80);
long previousMillis = 0;
unsigned long currentMillis = 0;
long interval = 250000; // READING INTERVAL
int sensor;
int analog_val;
String data;
String Hall;
String Temp;
WiFiClient client;
IPAddress server(192,168,164,101);
void setup() {
Serial.begin(9600);
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
// wait 10 seconds for connection:
delay(10000);
}
// you're connected now, so print out the status:
printWifiStatus();
Hall = "50";
Temp = "50";
data = "";
}
void loop(){
currentMillis = millis();
if(currentMillis - previousMillis > interval) { // READ ONLY ONCE PER INTERVAL
previousMillis = currentMillis;
Hall ="50"; //String(analog_val);
Temp ="50"; //String(sensor);
}
data = "temp1=" + Hall + "&hum1=" + Temp;
client.flush();
if (client.connect(server,80)) { // REPLACE WITH YOUR SERVER ADDRESS
Serial.println("Connected");
client.println("POST project/add.php HTTP/1.1");
client.println("Host: 192.168.164.101"); // SERVER ADDRESS HERE TOO
client.println("Content-Type: application/x-www-form-urlencoded");
client.print("Content-Length: ");
client.println(data.length());
client.println();
client.print(data);
}
if (client.connected()) {
client.stop(); // DISCONNECT FROM THE SERVER
client.flush();
}
delay(7000); // WAIT FIVE MINUTES BEFORE SENDING AGAIN
}
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");
}
Instead of a POST command, try using a GET request.
Change POST project/add.php to GET /project/add.php?
Related
Here what I try to do I have quickapp in HC3 that have some buttons I want to call from ESP8266 with it's URL All buttons API is working fine in browser
the project consist of {ESP8266, IR Receiver} that is it
I want to make conditions for the buttons that IR receive I will get it's code from serial monitor
and every button it's condition come true is calling Certain button in fibaro quickapp through API
How can I make API call under every (condition) OR (case) from arduino
I am trying to call button in quick app, if IR receive any code from AC remote it will call the API of this button
the arduino code is this
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRutils.h>
#define ssid "Name"
#define password "Passsword"
const char * servername = "http://User:Password#IPAdress/api/plugins/callUIEvent?deviceID=1639&elementName=Cool22&eventType=onReleased";
int MyData;
IRrecv irrecv(14);
decode_results results;
void setup()
{
MyData = 0;
WiFi.mode(WIFI_STA);
WiFi.begin(ssid,password);
Serial.begin(9600);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("connected to ");
Serial.println(ssid);
Serial.print("IP Adress: ");
Serial.println(WiFi.localIP());
irrecv.enableIRIn(); // Start the receiver
}
/*while (!Serial){ // Wait for the serial connection to be establised.
delay(50);
Serial.println();
Serial.print("IRrecv is now running and waiting for IR message on Pin ");
Serial.println(14);
}*/
void loop()
{
HTTPClient http;
WiFiClient client;
if (irrecv.decode(&results)) {
Serial.println("You Receive This:");
MyData = (results.value);
Serial.println(MyData);
if (MyData == 11714416 ){
http.begin(client, servername);
http.addHeader("Content-Type", "application/json");
int httpcode = http.POST(servername);
String payload =(http.getString());
Serial.println(payload);
Serial.print("HTTP Response code: ");
Serial.println(httpcode);
// Disconnect
http.end();
}
else {
Serial.println("No HTTP");
}
irrecv.resume();
}
}
the output tell me
You Receive This:
11714416
HTTP Response code: -1
and sometimes it give me Exception(28)
I need to ring the buzzer within the range of 1 meter only, my esp8266 is connected to a buzzer but the buzzer will ring on and off within the range of 1 meter using two esp8266, or sometimes it does not ring at all. The project is social distancing, what else should I do? Here is the code I am using:
#include <ESP8266WiFi.h>
const char* APssid = "Social Distancing"; //acess point of the device
const char* APpassword = "qwertyuiop";
const int RSSI_MAX = -37;//maximum strength of signal in dBm
const int RSSI_MIN =-100;//minimum strength of signal in dBm
void setup()
{
WiFi.mode(WIFI_OFF);
WiFi.disconnect();
delay(50); //this part turns off the wifi and resets it if it was already on
Serial.begin(115200);
pinMode(14,OUTPUT);
Serial.println();
WiFi.mode(WIFI_AP_STA); //configuring the board in hybrid mode
Serial.print("Configuring access point...");
WiFi.softAP(APssid, APpassword);
Serial.println(WiFi.softAPIP());
}
void loop()
{
Serial.println("Wifi is scanning");
int n = WiFi.scanNetworks();
Serial.println("Wifi scan ended");
if (n == 0)
{
Serial.println("no networks found");
}
else
{
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i)
{
//Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(") ");
Serial.print(WiFi.SSID(i));//SSID
Serial.print(WiFi.RSSI(i));//Signal strength in dBm
Serial.print("dBm (");
if(WiFi.SSID(i) == "Social Distancing")
{
if(WiFi.RSSI(i) > -37)//THIS -37 (RSSI) is the threshold value, this value is set
according to the distance of 1m
{
digitalWrite(14,HIGH);//(Generic esp8266 : (14,HIGH) , NodeMCU : (D5,HIGH) )
Serial.println("Social Distancing");
break;
}
}
else
{
digitalWrite(14,LOW);
}
}
delay(50);
}
Serial.println("");
delay(50);
WiFi.scanDelete();
}
Hi Lisa I have modified your code and I have added a 64x48 OLED display connected to the I2C connections, to visualize the results and it works beautifully. Moreover I have used the built in led (see: LED_BUILTIN) instead of the buzzer.
You have had a great idea. Now it works great and you can interrogate any Access point.
Please find attached the code:
//OLED
#include <Arduino.h>
#include <U8g2lib.h>
#include <U8x8lib.h> //this one in use
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
U8X8_SSD1306_64X48_ER_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // EastRising 0.66" OLED breakout board, Uno: A4=SDA, A5=SCL, 5V powered
// End of constructor list
#define U8LOG_WIDTH 16
#define U8LOG_HEIGHT 8
uint8_t u8log_buffer[U8LOG_WIDTH*U8LOG_HEIGHT];
U8X8LOG u8x8log;
//OLED end
#include <ESP8266WiFi.h>
const char* APssid = "My_SSID"; //acess point of the device
const char* APpassword = "My_Password";
//const char* myconstcharstarstring = "------------------------------";
const int RSSI_MAX = -37;//maximum strength of signal in dBm
const int RSSI_MIN =-100;//minimum strength of signal in dBm
void setup()
{
//OLED
u8x8.begin();
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8log.begin(u8x8, U8LOG_WIDTH, U8LOG_HEIGHT, u8log_buffer);
u8x8log.setRedrawMode(1); // 0: Update screen with newline, 1: Update screen for every char
//OLED end
WiFi.mode(WIFI_OFF);
WiFi.disconnect();
delay(50); //this part turns off the wifi and resets it if it was already on
Serial.begin(115200);
pinMode(LED_BUILTIN,OUTPUT);
Serial.println();
WiFi.mode(WIFI_AP_STA); //configuring the board in hybrid mode
Serial.print("Configuring access point...");
WiFi.softAP(APssid, APpassword);
Serial.println(WiFi.softAPIP());
}
void loop()
{
digitalWrite(LED_BUILTIN,LOW);
Serial.println("Wifi is scanning");
int n = WiFi.scanNetworks();
Serial.println("Wifi scan ended");
if (n == 0)
{
Serial.println("no networks found");
}
else
{
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i)
{
//Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(") ");
Serial.print(WiFi.SSID(i));//SSID
Serial.print(WiFi.RSSI(i));//Signal strength in dBm
Serial.print("dBm (");
if(WiFi.RSSI(i) > -37)//THIS -37 (RSSI) is the threshold value, this value is set according to the distance of 1m
{
digitalWrite(LED_BUILTIN,HIGH);//(Generic esp8266 : (14,HIGH) , NodeMCU : (D5,HIGH) )
Serial.println("Social Distancing");
delay(500);
}
//OLED
u8x8log.print(WiFi.SSID(i));
u8x8log.print("\n");
u8x8log.print(WiFi.RSSI(i));
u8x8log.print("\n");
u8x8log.print("-------------");
u8x8log.print("\n");
delay(2000);
}
Serial.println("");
delay(50);
WiFi.scanDelete();
}
}
Hope this answers All the best
Hi Lisa please add digitalWrite(14,HIGH); at the beginning of the loop, it will work:
void loop()
{
digitalWrite(14,HIGH);
/... rest of your code...
I don't know how you have wired your buzzer, try forcing your ouput pin HIGH or LOW depending on your circuit.
Hope this helps All the best
I'm trying to stream voice to the MQTT broker. I'm using esp8266(NodeMCU1.0) and it's ADC to sampling the audio signal at 4KHz and 8-bit PCM audio format. I used Pubsubclient.h library to publish audio packets to the broker but on the other side when I receive packets and play them I have the interrupted voice and I have a delay between playing packets as long as my buffer size. please help me to have continues voice.
I have 2 main problems:
1) delay between playing packets as long as my buffer size
example of what i received: ;D ;D ;D .....|||||..........|||||||...........|||||||||............||||||||
2) Quality of voice: I receive a noisy voice.
Please help me! Thanks.
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char* ssid = "Knight";
const char* password = "****";
const char* mqtt_server = "104.21.218.224";
WiFiClient espClient;
PubSubClient client(espClient);
unsigned long lastMsg = 0;
#define MSG_BUFFER_SIZE (4096)
int i;
byte voice[MSG_BUFFER_SIZE];
void setup_wifi() {
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
randomSeed(micros());
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void reconnect() {
// Loop until we're reconnected
while (!client.connected()) {
Serial.print("Attempting MQTT connection...");
// Create a random client ID
String clientId = "ashkan";
// Attempt to connect
if (client.connect(clientId.c_str())) {
Serial.println("connected");
// Once connected, publish an announcement...
if (!client.publish("doorphone/connected", "true")) {
Serial.println("publish failed, either connection lost, or message too large");
}
else {
Serial.println("publish succeeded");
}
// ... and resubscribe
// client.subscribe("doorphone/open");
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}
void setup() {
pinMode(BUILTIN_LED, OUTPUT); // Initialize the BUILTIN_LED pin as an output
Serial.begin(115200);
setup_wifi();
client.setServer(mqtt_server, 1883);
}
void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();
for (i = 0; i < MSG_BUFFER_SIZE; i++) {
voice[i] = analogRead(A0);
// client.write(voice[i]);
delayMicroseconds(125);
}
client.publish("doorphone/connected", voice, MSG_BUFFER_SIZE);
}
I am trying to display Temperature and Humidity reading of SHT31 sensor on the HTML page,
but whenever I am trying to write the IP in the web browser and searching, the Error - "This site can not be reached" has been displayed.
I am working on code(mentioned below) to connect and Interfacing I2C module of Temperature sensor with Adafruit Huzzah ESP8266 using Library "ESP8266WiFi.h", "Wire.h"
#include <ESP8266WiFi.h>
#include <Wire.h>
// SHT31 I2C address is 0x44(68)
#define Addr 0x44
// Replace with your network credentials
const char* ssid = "SSID";
const char* password = "Password";
float Ctemp,Ftemp,humid;
// Set web server port number to 80
WiFiServer server(80);
// Variable to store the HTTP request
String header;
void setup()
{
Wire.begin(2,14);
Serial.begin(115200);
// Connect to Wi-Fi network with SSID and password
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// Print local IP address and start web server
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
}
void loop(){
temptask();
WiFiClient client = server.available(); // Listen for incoming clients
if (client)
{ // If a new client connects,
Serial.println("New Client."); // print a message out in the serial port
String currentLine = ""; // make a String to hold incoming data from the client
while (client.connected()) { // loop while the client's connected
if (client.available()) { // if there's bytes to read from the client,
char c = client.read(); // read a byte, then
Serial.write(c); // print it out the serial monitor
header += c;
if (c == '\n') { // if the byte is a newline character
// if the current line is blank, you got two newline characters in a row.
// that's the end of the client HTTP request, so send a response:
if (currentLine.length() == 0) {
// HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
// and a content-type so the client knows what's coming, then a blank line:
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println("Connection: close");
client.println();
// Display the HTML web page
client.println("<!DOCTYPE html><html>");
client.println("<head><meta charset=\"utf-8\">");
client.println("<meta name = \"viewport\" content = \"width = device-width, initial-scale = 1.0\">");
client.println("<body style= \"background-color:#EDEEF2\">");
client.println("<h1 style= \"color:blue\">Temperature and Humidity</h1>");
client.println( "<h3 style= \"font-family:verdana; color:blue\">Temperature in Celcius:</h3>");
client.println("<p style=\"font-size:160%; font-family:Lucida Console\">"+String(Ctemp,1)+"</p>");
client.println("<h3 style= \"font-family:verdana; color:blue\">Temperature in Fahrenheit:</h3>");
client.println("<p style=\"font-size:160%; font-family:Lucida Console\">"+String(Ftemp,1)+"</p>");
client.println("<h3 style= \"font-family:verdana; color:blue\">Humidity:</h3>");
client.println("<p style=\"font-size:160%; font-family:Lucida Console\">"+String(humid,1)+"</p>");
client.println("</body>");
client.println("</html>");
break;
}
}
}
// Clear the header variable
header = "";
// Close the connection
client.stop();
Serial.println("Client disconnected.");
Serial.println("");
}
}
}
void temptask(){
unsigned int data[6];
// Start I2C Transmission
Wire.beginTransmission(Addr);
// Send 16-bit command byte
Wire.write(0x2C);
Wire.write(0x06);
// Stop I2C transmission
Wire.endTransmission();
delay(300);
// Start I2C Transmission
Wire.beginTransmission(Addr);
// Stop I2C Transmission
Wire.endTransmission();
// Request 6 bytes of data
Wire.requestFrom(Addr, 6);
// Read 6 bytes of data
// temp msb, temp lsb, temp crc, hum msb, hum lsb, hum crc
if (Wire.available() == 6)
{
data[0] = Wire.read();
data[1] = Wire.read();
data[2] = Wire.read();
data[3] = Wire.read();
data[4] = Wire.read();
data[5] = Wire.read();
}
// Convert the data
int temp = (data[0] * 256) + data[1];
float cTemp = -45.0 + (175.0 * temp / 65535.0);
float fTemp = (cTemp * 1.8) + 32.0;
float humidity = (100.0 * ((data[3] * 256.0) + data[4])) / 65535.0;
Ctemp = cTemp;
Ftemp = fTemp;
humidity = humid;
Serial.print("Temperature in C:\t");
Serial.println(String(cTemp,1));
Serial.print("Temperature in F:\t");
Serial.println(String(fTemp,1));
Serial.print("Humidity:\t ");
Serial.println(String(humidity,1));
}
Any advice about what causing this issue will very grateful.
I have updated your code and is working fine now kindly take a look.
#include <ESP8266WiFi.h>
#include <Wire.h>
#include <ESP8266WebServer.h>
// SHT31 I2C address is 0x44(68)
#define Addr 0x44
// Replace with your network credentials
const char* ssid = "DcubeAirtel";
const char* password = "D#Airtel190";
float Ctemp,Ftemp,humid;
// Set web server port number to 80
WiFiServer server(80);
// Variable to store the HTTP request
String header;
void setup()
{
Wire.begin(2,14);
Serial.begin(115200);
// Connect to Wi-Fi network with SSID and password
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// Print local IP address and start web server
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
}
void loop(){
temptask();
WiFiClient client = server.available(); // Listen for incoming clients
if (client)
{ // If a new client connects,
Serial.println("New Client."); // print a message out in the serial port
String currentLine = ""; // make a String to hold incoming data
from the client
while (client.connected()) { // loop while the client's connected
if (client.available()) { // if there's bytes to read from the
client,
String c = client.readStringUntil('\r'); // read a byte, then
Serial.println(c);
} // print it out the serial monitor
// if the current line is blank, you got two newline characters in a row.
// that's the end of the client HTTP request, so send a response:
// HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
// and a content-type so the client knows what's coming, then a blank line:
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println("Connection: close");
client.println();
String PAGE2 =
"<!DOCTYPE html>"
"<html>"
"<head>"
"<meta charset=\"utf-8\">"
"<meta name = \"viewport\" content = \"width = device-width, initial-scale = 1.0\">"
"<title> My first HTML page</title>"
"</head>"
"<body style= \"background-color:#EDEEF2\">"
"<h1 style= \"color:blue\">Temperature and Humidity</h1>"
"<h3 style= \"font-family:verdana; color:blue\">Temperature in Celcius:</h3>"
"<p style=\"font-size:160%; font-family:Lucida Console\">"+String(Ctemp,1)+
"</p>"
"<h3 style= \"font-family:verdana; color:blue\">Temperature in Fahrenheit:</h3>"
"<p style=\"font-size:160%; font-family:Lucida Console\">"+String(Ftemp,1)+
"</p>"
"<h3 style= \"font-family:verdana; color:blue\">Humidity:</h3>"
"<p style=\"font-size:160%; font-family:Lucida Console\">"+String(humid,1)+
"</p>"
"</body>"
"</html>";
// Display the HTML web page
client.println(PAGE2);
}
}
// Clear the header variable
// Close the connection
client.stop();
Serial.println("Client disconnected.");
Serial.println("");
}
void temptask(){
unsigned int data[6];
// Start I2C Transmission
Wire.beginTransmission(Addr);
// Send 16-bit command byte
Wire.write(0x2C);
Wire.write(0x06);
// Stop I2C transmission
Wire.endTransmission();
delay(300);
// Start I2C Transmission
Wire.beginTransmission(Addr);
// Stop I2C Transmission
Wire.endTransmission();
// Request 6 bytes of data
Wire.requestFrom(Addr, 6);
// Read 6 bytes of data
// temp msb, temp lsb, temp crc, hum msb, hum lsb, hum crc
if (Wire.available() == 6)
{
data[0] = Wire.read();
data[1] = Wire.read();
data[2] = Wire.read();
data[3] = Wire.read();
data[4] = Wire.read();
data[5] = Wire.read();
}
// Convert the data
int temp = (data[0] * 256) + data[1];
float cTemp = -45.0 + (175.0 * temp / 65535.0);
float fTemp = (cTemp * 1.8) + 32.0;
float humidity = (100.0 * ((data[3] * 256.0) + data[4])) / 65535.0;
Ctemp = cTemp;
Ftemp = fTemp;
humidity = humid;
Serial.print("Temperature in C:\t");
Serial.println(String(cTemp,1));
Serial.print("Temperature in F:\t");
Serial.println(String(fTemp,1));
Serial.print("Humidity:\t ");
Serial.println(String(humidity,1));
}
This works as follows:
First read the char sent by server till next line
Now flush the server
Now write your content to the server.
I'm trying to get data from a txt file through my website to turn the LED on or off, the connection to the website works and the data from a txt file is printed on the serial as the code shows, but on the loop condition when I read a txt file with '1' it should light on the LED, but that does not work
can you please help me
this is my code
#include <SPI.h>
#include <WiFi.h>
char ssid[] = "HomeBroadband"; // your network SSID (name)
char pass[] = "h12345678"; // 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;
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128); // numeric IP for Google (no DNS)
char server[] = "daffostore.com"; // name address for Google (using DNS)
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
WiFiClient client;
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
}
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while (true);
}
String fv = WiFi.firmwareVersion();
if (fv != "1.1.0") {
Serial.println("Please upgrade the firmware");
}
// 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) == 1) {
Serial.println("connected to server");
// Make a HTTP request:
client.println("GET /ard/ledstatus.txt HTTP/1.1");
client.println("Host: daffostore.com");
client.println("Connection: keep-alive");
//client.println("Content-Length: 1845");
client.println("Keep-Alive: timeout=10, max=20");
client.println();
}
}
void loop() {
// if there are incoming bytes available
// from the server, read them and print them:
while (client.available()) {
char c = client.read();
Serial.write(c);
if(c=='1'){
digitalWrite(13, HIGH);
}
else{
digitalWrite(13, LOW);
}
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting from server.");
client.stop();
// do nothing forevermore:
while (true);
}
}
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");
}