You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the WiFiClient connenction API, affter a reboot of the access point the NINA module is not able to resolve the server url, defined in the sketch, the test case is:
Connect the board to the AP;
Call the WiFiclient connection API;
After the connection disable the AP and wait for module disconnection;
Enable again the AP, connect the board and call again the WiFiClient Connection.
In this last case some time the board stay connected to the access point but following the API chain called by the WiFiClient connection, the board is not able to resolve the host and get the IP address.
seems that in the f/w of the NINAthis line https://github.com/arduino/nina-fw/blob/master/arduino/libraries/WiFi/src/WiFi.cpp#L63 return NULL, i have used an arduino uno wifi rev 2 and the sketch used for the issue is:
#include <SPI.h>
#include <WiFiNINA.h>
#include <OneWire.h> //Using latest from Paul Stoffregen
//#include <Time.h>
//#include <TimeLib.h>
#include "arduino_secrets.h"
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
int status = WL_IDLE_STATUS;
WiFiClient client;
IPAddress ip(192, 168, 0, 33);
//char server[] = "www.google.com";
IPAddress server(216,58,205,132);
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
connectWiFi();
}
void loop() {
if (client.available()) {
char c = client.read();
Serial.println("client available");
}
if (WiFi.status() != WL_CONNECTED) {
Serial.println("tring to reconnect");
Serial.println(WiFi.status());
client.stop();
WiFi.disconnect();
connectWiFi();
}
delay(1000);
if (client.connected()) {
Serial.println("Connect ok");
String celsius_string = "50";
//Insert temp record into database
client.println("POST /insert.php?Value=" + celsius_string + " HTTP/1.1");
client.println("Host: www.***.***");
//client.println("User-Agent: Arduino/1.0");
client.println("Connection: close");
//client.println("Content-Type: application/x-www-form-urlencoded; charset=UTF-8");
//client.println("Content-Length: ");
client.println();
//Serial.println(WiFi.status());
} else {
Serial.println("not connected");
}
delay(5000);
}
void printWifiStatus() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your board'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");
}
void connectWiFi() {
status = WiFi.status();
//WiFi.config(ip);
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
delay(5000);
}
Serial.println("Connected to wifi");
printWifiStatus();
if (client.connect(server, 80)) {
Serial.println("Connected");
} else {
client.stop();
WiFi.disconnect();
Serial.println("Not connected");
}
}
The text was updated successfully, but these errors were encountered:
Using the WiFiClient connenction API, affter a reboot of the access point the NINA module is not able to resolve the server url, defined in the sketch, the test case is:
In this last case some time the board stay connected to the access point but following the API chain called by the WiFiClient connection, the board is not able to resolve the host and get the IP address.
seems that in the f/w of the NINAthis line https://github.com/arduino/nina-fw/blob/master/arduino/libraries/WiFi/src/WiFi.cpp#L63 return NULL, i have used an arduino uno wifi rev 2 and the sketch used for the issue is:
The text was updated successfully, but these errors were encountered: