Replies: 1 comment 1 reply
-
I think you forgot to mention the duplicate at 256dpi/arduino-mqtt repo Specific to the esp8266 code
@@ -960,9 +971,7 @@ void MQTT_connect() {
debugI("Found MQTT CA file");
file = LittleFS.open(FILE_MQTT_CA, "r");
#if defined(ESP8266)
- char caStr[MAX_PEM_SIZE];
- file.readBytes(caStr, file.size());
- BearSSL::X509List *serverTrustedCA = new BearSSL::X509List(caStr);
+ BearSSL::X509List *serverTrustedCA = new BearSSL::X509List(file);
mqttSecureClient->setTrustAnchors(serverTrustedCA);
#elif defined(ESP32)
mqttSecureClient->loadCACert(file, file.size()); btw Espsoftwareserial is already included in the esp8266 Core distribution https://github.com/esp8266/Arduino/tree/master/libraries/ |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If I let my device connect to MQTT and deauth the device from my WiFi, it will not reconnect. If I run the same code, but to not connect to MQTT, WiFi reconnect works just fine. I have tried two different MQTT libraries with the same result, so I suspect it is something other than the MQTT lib itself.
Code with the problem is here:
https://github.com/gskjold/AmsToMqttBridge/tree/dev-1.6.0
Master brach is ok, see difference here:
UtilitechAS/amsreader-firmware#154
ESP WiFi debugging enabled, output from start:
SDK:2.2.2-dev(38a443e)/Core:3.0.2=30002000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
connected with no23-han, channel 1
dhcp client start...
wifi evt: 0
ip:192.168.233.207,mask:255.255.255.0,gw:192.168.233.1
wifi evt: 3
[hostByName] Host: 192.168.233.71 is a IP!
pm open,type:" 0
state: � -> " (!R8)
rm 0
pm close ?
wifi evt: 1
STA disconnect: 6
reconnect
state: " -> 0 (0)
scandone
state: 0 -> " (?8)
state: " -> @ (0)
state: @ -> � (i8)
add 0
aid "
cnt
state: � -> " (�R8)
rm 0
wifi evt: 1
STA disconnect: 2
reconnect
state: " -> 0 (0)
scandone
state: 0 -> " (?8)
state: " -> @ (0)
state: @ -> � (i8)
add 0
aid "
cnt
state: � -> " (�R8)
rm 0
wifi evt: 1
STA disconnect: 2
reconnect
state: " -> 0 (0)
scandone
state: 0 -> " (?8)
state: " -> @ (0)
state: @ -> � (i8)
add 0
aid "
cnt
state: � -> " (�R8)
rm 0
wifi evt: 1
STA disconnect: 2
Endless repeat of reconnect with disconnect: 2 (REASON_AUTH_EXPIRE)
Beta Was this translation helpful? Give feedback.
All reactions