Page 1 of 1

wifi / mqtt instability

Posted: Wed Sep 11, 2019 3:18 pm
by yanosz
Hello folks,

I'm running a small test network of 8 ESP32 devices on desk. ESP-IDF is release/v3.3 (branch), project is https://github.com/fieldtracks/JellingStone . The devices to BLE scannning + beaconing. Results are transfered over wifi / mqtt.

Every couple of minutes some devices loose their connectivity to the broker. Log:

Code: Select all

W (628325) TRANS_SSL: Poll timeout or error, errno=Bad file number, fd=59, timeout_ms=10000
E (628325) MQTT_CLIENT: Error write data or timeout, written len = 0
E (628325) MQTT_CLIENT: Error to public data to topic=JellingStone/b4:e6:2d:a9:42:df, qos=0
During this, ICMP-Echos take very long (> 1000ms) or do not get back at all. The wifi itself is not overloaded; airtime is available and SINR-levels are excelent (the AP is close by). Non-concerned devices can be reached faster (~ 100 - 200ms). That's slow, still, but I don't know what to expect from an esp32, here.

Do you know what's wrong here?

Thanks,
yanosz

Re: wifi / mqtt instability

Posted: Wed Sep 11, 2019 4:43 pm
by chegewara
BLE and wifi are using the same radio. You need to change ble scan window and interval to give more radio time to wifi or stop scanning when publish mqtt data.

Re: wifi / mqtt instability

Posted: Wed Sep 11, 2019 6:12 pm
by yanosz
Heiho,
chegewara wrote:
Wed Sep 11, 2019 4:43 pm
BLE and wifi are using the same radio. You need to change ble scan window and interval to give more radio time to wifi or stop scanning when publish mqtt data.
Thanks for your help! That sound's reasonable. Do you have some concerete values / parameters in mind?
What window / interval can you recommend?

Afaik, an esp32 doing ble mesh and wifi could be in the same sitation. Unfortunatly, the code and docs is a little hard to digest. Do you know what parameters are used here (also for advertising).

Thanks,
Greetz, yanosz

Re: wifi / mqtt instability

Posted: Thu Sep 12, 2019 9:07 am
by yanosz
Heiho,

I added an non-scan-period of 1s. It appears to be more stable.

Greetz, yanosz