Thinger.handle hangs wither Ethernet


#1

thing.handle(); doesn’t work correctly with arduino Ethernet, if router disconnected, device appears as connected but there is no data coming from arduino to cloud

other thing how to add a static ip to the ethernet shield instead of using DHCP server?


#2

i solved the problem by replacing

at file ThingerEthernet.h

virtual bool connect_network(){
    if(connected_) return true;
    byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
    unsigned long ethernet_timeout = millis();
    THINGER_DEBUG("NETWORK", "Initializing Ethernet...");
    while(Ethernet.begin(mac)==0){
        THINGER_DEBUG("NETWORK", "Getting IP Address...");
        if(millis() - ethernet_timeout > 30000) {
            delay(1000);
            return false;
        }
    }
    THINGER_DEBUG_VALUE("NETWORK", "Got IP Address: ", Ethernet.localIP());
    delay(1000);
    connected_ = true;
    return connected_;
}

by

virtual bool connect_network(){
connected_ = true;
return connected_;
}

and used

IPAddress ip(192, 168, 1, 177);
IPAddress myDns(8, 8, 8, 8);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);

Ethernet.begin(mac, ip, myDns);

at my code