Data received by the POST method :
if (server.hasArg("SSID") && server.hasArg("SENHA")&& server.hasArg("IPESTACAO")){//enviou configurações
String _qip = server.arg("IPESTACAO");
IPAddress qip=ipFromString(_qip.c_str());
Explore... Chat... Share...
if (server.hasArg("SSID") && server.hasArg("SENHA")&& server.hasArg("IPESTACAO")){//enviou configurações
String _qip = server.arg("IPESTACAO");
IPAddress qip=ipFromString(_qip.c_str());
IPAddress ipFromString(const char *address) {
// TODO: add support for "a", "a.b", "a.b.c" formats
IPAddress _IP;
uint16_t acc = 0; // Accumulator
uint8_t dots = 0;
while (*address)
{
char c = *address++;
if (c >= '0' && c <= '9')
{
acc = acc * 10 + (c - '0');
//acc = uint8_t(acc);
if (acc > 255) {
// Value out of [0..255] range
//return false;
_IP = IPAddress(0,0,0,0);
return _IP;
}
}
else if (c == '.')
{
if (dots == 3) {
// Too much dots (there must be 3 dots)
//return false;
_IP = IPAddress(0,0,0,0);
return _IP;
}
_IP[dots++] = acc;
acc = 0;
}
else
{
// Invalid char
//return false;
_IP = IPAddress(0,0,0,0);
return _IP;
}
}
if (dots != 3) {
// Too few dots (there must be 3 dots)
//return false;
_IP = IPAddress(0,0,0,0);
return _IP;
}
_IP[3] = acc;
return _IP;
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]