Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set keepalive to 10s #86

Closed
wants to merge 1 commit into from
Closed

Conversation

jctooley
Copy link

Fixes issue #84

@jctooley
Copy link
Author

Reference to same error on the umqtt library

@Maffsie
Copy link

Maffsie commented Sep 21, 2022

Confirmed, this fixes my Enviro Weather as well.
Upgraded from the firmware it shipped with to 0.0.8, MQTT uploads broke. After an hour's digging I stumbled across this PR and, indeed, adding a keepalive parameter to connect() fixed it and all pending uploads completed.

@nopuk
Copy link

nopuk commented Sep 27, 2022

Confirmed, this fixes my Enviro Weather as well. Upgraded from the firmware it shipped with to 0.0.8, MQTT uploads broke. After an hour's digging I stumbled across this PR and, indeed, adding a keepalive parameter to connect() fixed it and all pending uploads completed.

@Maffsie I have an Eviro weather too, and experienced a similar issue, however my weather is unable to get past about 7-8hrs of uploads to mqtt - it just hangs with the log giving no new info, tap the poke button all back to normal for another 7 or 8 hours. Its maddening. Does yours works for days on end given battery? I am doing uplaods each 15min while testing it.

@Maffsie
Copy link

Maffsie commented Sep 27, 2022

Confirmed, this fixes my Enviro Weather as well. Upgraded from the firmware it shipped with to 0.0.8, MQTT uploads broke. After an hour's digging I stumbled across this PR and, indeed, adding a keepalive parameter to connect() fixed it and all pending uploads completed.

@Maffsie I have an Eviro weather too, and experienced a similar issue, however my weather is unable to get past about 7-8hrs of uploads to mqtt - it just hangs with the log giving no new info, tap the poke button all back to normal for another 7 or 8 hours. Its maddening. Does yours works for days on end given battery? I am doing uplaods each 15min while testing it.

@nopuk Mine has been doing exactly the same, though it goes silent after about 6 hours. I'm doing uploads every 15m with data collection every 5m. I just assumed it's related to the RTC bug (I forget the bug number and I'm on my phone so can't look it up) and have been waiting for a fix on that.

Curiously, the 0.0.2 firmware worked fine, and I would just go back to that, but I switched the battery out for a LiIon battery and a LiPo Amigo, so I need the voltage reporting from 0.0.8 to know when to recharge it!

@helgibbons is this an example of the RTC wake-up issue, or should a new issue be opened for this?

@helgibbons
Copy link
Contributor

@Maffsie - adding the keepalive parameter did seem to improve uptime for me, but my Weather is still crashing every day or so with mqtt. Feel free to open another issue or contribute to an existing one as appropriate - @lowfatcode is back next week so we should hopefully see some fixes soon :)

@jctooley
Copy link
Author

Mine runs longer than 6 hours although I have to admit, the connection to WiFi is flaky as it doesn't get a connection every time. I currently log every 5 mins and upload every reading. I know this is power hungry but it is currently sat in my office where I can easily charge the battery.

@nopuk
Copy link

nopuk commented Sep 28, 2022 via email

@MrDrem
Copy link

MrDrem commented Sep 28, 2022

Perhaps a silly question to ask, but does anyone run their enviro weather in such a way that they don't have to worry about it giving up a few hours later. I kinda feel I purchased a product that doesn't do its one basic function. The pimoroni product page sells this.

The firmware is clearly in a alpha state (hence being 0.0.8) which I think should be a lot clearer on all of the new Enviro product pages.

That having been said, the biggest issue that I now have is the rain bucket recordings stopping the normal wake cycles (and a debate around what it should record). With the rain bucket disconnected, I'm currently happy with how I'm now getting things.

My experiences so far are that logging to io.adafruit.com is unreliable & I know that @helgibbons has had issues with the cloud influxDB too (see #79).
Logging locally to the unit is fine, and logging to a self hosted influxDB instance is fine. I think that the common factor in both of those is that there are no limits on uploads. I've been logging readings every minute, and uploading them to my local influxDB instance for around 72 hours now, and had local logging going well for a few days prior to that.

temp
Temperature graph from Grafana looking at my local influxDB instance.

@ZodiusInfuser
Copy link
Member

Hi All. I've been writing a patch for enviro that fixes a lot of the issues, and one thing I noticed was that v0.0.2 had keepalive=60 set, which was removed in v0.0.8. I have reverted this change in patch but just wanted to check that 60 is a sensible number, since 10 is mentioned here. Thanks

@MrDrem
Copy link

MrDrem commented Nov 15, 2022

Switching to 10 resolved the uploads failing issue, 60 may make it more stable. It was certainly better under 0.0.2, but I don't know if that was the difference.

Its certainly worth testing (maybe with a pair of devices, once set to 10 and one to 60). Easier for you than us :)

@ZodiusInfuser
Copy link
Member

As of v0.0.9 the keepalive value is 60 seconds, so I will close this PR. If you feel it should be 10 seconds, please re-open it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants