Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] TLS with 8266 sensor problem.

By experience, I would tell you that some "delays" in the middle of the loop makes the wifi logic to disconnect due to inactivity. I had to code some kind of non-blocking delay to let the sensors get the measurement properly without affecting the wifi subsystem (and the MQTT service on top of it)

Best regards.

El lun., 17 oct. 2022 21:45, Carlos G Mendioroz <tron@xxxxxxx> escribió:
Hi, just trying to see if this rings a bell to someone.
I'm seeing random connection errors from a sensor using certs.
(random like 10% of the time it fails)

I have a GAS meter sensor reporting to a mosquitto server via wifi.
In order to save battery, the mote sleeps and resets with a reed switch
that triggers with the meter counter '0' passing by. This works, but I
have identified times when the mote starts and does not manage to get
the messages sent.

A successful cycle logs 2 lines in mosquitto.log:
1666030079: New connection from 172.30.0.86:54975 on port 995.
1666030081: New client connected from 172.30.0.86:54975 as gas_sensor
(p2, c1, k15).

but unsucessful one just have the first line.
I noticed that the startup does get some time (2 seconds!) so I was
afraid a watchdog could be at fault here, so inserted a ESP.wdtFeed()
just before client.connect(mqtt_client), no joy.

Help, advise or experience is more tham welcome :)

--
Carlos G Mendioroz  <tron@xxxxxxx>
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev

Back to the top