These are chat archives for esp8266/Arduino

18th
Nov 2017
bidyutper
@bidyutper
Nov 18 2017 07:06
I am facing problem with Mqtt reconnect Loop ..It's reconnected with Mqtt but failed to publish data..How to solve this
brutzler
@brutzler
Nov 18 2017 09:04
Is there any "Minimum-Basic-Sketch" for the ESP-AsyncWebServer? The Sketch provided with the library looks a little bit more than needed.
Me No Dev
@me-no-dev
Nov 18 2017 09:04
what should a minimal sketch look like?
brutzler
@brutzler
Nov 18 2017 09:12
Hmmm... good question. Like the HelloServer? Was only a little bit worried because of additional OTA/FS/SPIFFS....
Thought than its easier for me to understand the way of working of the AsyncModus. In comparing to the "normal" handle...
brutzler
@brutzler
Nov 18 2017 13:08
@me-no-dev Do you think, this sketch is already minimal? Then I have to work on my abilities ;-)
Me No Dev
@me-no-dev
Nov 18 2017 13:09
well... i can write a really minimal sketch but I doubt it will be of any use to anyone
brutzler
@brutzler
Nov 18 2017 13:11
Ok, I will try to get clearly with the provided.
Maybe I will hit here with some questions ...
Me No Dev
@me-no-dev
Nov 18 2017 13:14
maybe hit the AsyncWebServer room?
brutzler
@brutzler
Nov 18 2017 13:16
oh... good idea. didn't kow there is one.
xbary
@xbary
Nov 18 2017 17:50
Helou
i find problem
I have such a code:
'''

include <WiFiUdp.h>

include <WiFiServer.h>

include <WiFiClientSecure.h>

include <WiFiClient.h>

include <ESP8266WiFiType.h>

include <ESP8266WiFiSTA.h>

include <ESP8266WiFiScan.h>

include <ESP8266WiFiMulti.h>

include <ESP8266WiFiGeneric.h>

include <ESP8266WiFiAP.h>

include <ESP8266WiFi.h>

typedef enum {

sfSetup,
sfWaitForWiFiConnect,
sfIterate

}TSUPLA_func;

TSUPLA_func SuplaFunc = sfSetup;

define WIFI_STATICIP

void SUPLA_DoEvent(void)
{

switch (SuplaFunc)
{
case sfWaitForWiFiConnect:
{
    if (WiFi.status() == WL_CONNECTED)
    {
        SuplaFunc = sfSetup;
        break;
    }
    break;
}
case sfSetup:
{
    if (WiFi.status() == WL_CONNECTED)
    {
        SuplaFunc = sfIterate;
        break;
    }
    else
    {
        WiFi.mode(WIFI_STA);

ifdef WIFI_STATICIP

        WiFi.config(IPAddress(192,168,1,32), IPAddress(192, 168, 1, 1), IPAddress(255, 255, 255, 0), IPAddress(8, 8, 8, 8), IPAddress(8, 8, 4, 4));
        Serial.println("Set Static IP.");

else

        Serial.println("Set DHCP IP.");

endif

        WiFi.begin("xb_HUAWEI", "0987654321");
        SuplaFunc = sfWaitForWiFiConnect;
        break;
    }
}
case sfIterate:
{
    if (WiFi.status() == WL_CONNECTED)
    {

    }
    else
    {
        SuplaFunc = sfWaitForWiFiConnect;
    }
    break;
}
default:
{
    SuplaFunc = sfSetup;
    break;
}

}

}

void setup()
{
Serial.begin(115200);
delay(10);
Serial.setDebugOutput(true);
SuplaFunc = sfSetup;
Serial.println("Start");
}

void loop()
{
SUPLA_DoEvent();
}

xbary
@xbary
Nov 18 2017 17:56
ESP nicely combines statically with rounter
The problem is that when the router restarts, it's ESP to wait for WIFI availability, but something stops it popping WDT reset ....
Interestingly, if we connect to an address with a DHCP router, then when the rounter restart does not pop up my WDR Reset ... what could be the problem?
xbary
@xbary
Nov 18 2017 18:50

Start
STUB: dhcp_stop
Set Static IP.
scandone
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt

connected with xb_HUAWEI, channel 11
ip:192.168.1.32,mask:255.255.255.0,gw:192.168.1.1
ip:192.168.1.32,mask:255.255.255.0,gw:192.168.1.1
pm open,type:2 0
bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
no xb_HUAWEI found, reconnect after 1s
reconnect
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt

connected with xb_HUAWEI, channel 11

ets Jan 8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v00000000
~ld
Start
STUB: dhcp_stop
Set Static IP.
scandone
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt

connected with xb_HUAWEI, channel 11
ip:192.168.1.32,mask:255.255.255.0,gw:192.168.1.1
ip:192.168.1.32,mask:255.255.255.0,gw:192.168.1.1