Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
U

ukaszyk

@ukaszyk
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Unblocking loop when DHCP fails
    U ukaszyk

    @electrik said in Unblocking loop when DHCP fails:

    MQTT_SOCKET_TIMEOUT

    Thanks for your suggestion. Unfortunately it was not enough, but I manipulated in ethernet library and right now I have enough CPU time in my main loop (reading 16 buttons state and control 15 GPIO outputs).
    Here is what I changed so far. I'm not sure about it long time stability, but it works on my desk:

    diff --git a/.pio/libdeps/megaatmega2560/Ethernet/src/Ethernet.h b/.pio/libdeps/megaatmega2560/Ethernet/src/Ethernet.h
    index 376e6c5..9d5e6b4 100644
    --- a/.pio/libdeps/megaatmega2560/Ethernet/src/Ethernet.h
    +++ b/.pio/libdeps/megaatmega2560/Ethernet/src/Ethernet.h
    @@ -213,8 +213,8 @@ public:
     
     class EthernetClient : public Client {
     public:
    -	EthernetClient() : sockindex(MAX_SOCK_NUM), _timeout(1000) { }
    -	EthernetClient(uint8_t s) : sockindex(s), _timeout(1000) { }
    +	EthernetClient() : sockindex(MAX_SOCK_NUM), _timeout(5) { }
    +	EthernetClient(uint8_t s) : sockindex(s), _timeout(5) { }
     
     	uint8_t status();
     	virtual int connect(IPAddress ip, uint16_t port);
    diff --git a/.pio/libdeps/megaatmega2560/MySensors/core/MyGatewayTransportMQTTClient.cpp b/.pio/libdeps/megaatmega2560/MySensors/core/MyGatewayTransportMQTTClient.cpp
    index 12cfd67..754ae03 100644
    --- a/.pio/libdeps/megaatmega2560/MySensors/core/MyGatewayTransportMQTTClient.cpp
    +++ b/.pio/libdeps/megaatmega2560/MySensors/core/MyGatewayTransportMQTTClient.cpp
    @@ -155,7 +155,7 @@ bool reconnectMQTT(void)
     
     		return true;
     	}
    -	delay(1000);
    +	delay(1);
     	GATEWAY_DEBUG(PSTR("!GWT:RMQ:FAIL\n"));
     	return false;
     }
    @@ -190,7 +190,7 @@ bool gatewayTransportConnect(void)
     	              Ethernet.localIP()[0],
     	              Ethernet.localIP()[1], Ethernet.localIP()[2], Ethernet.localIP()[3]);
     	// give the Ethernet interface a second to initialize
    -	delay(1000);
    +	delay(10);
     #endif
     	return true;
     }
    
    
    Troubleshooting w5510 dhcp fail block
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular