-
Notifications
You must be signed in to change notification settings - Fork 86
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
Further rain issues (now in 0.0.8) #70
Comments
The rainfall reading is returned in millimetres per hour - therefore it has to use the previous hours worth of data to determine that value - I think that for most users this is the most convenient way for it to work since they can simply log that data to a graph or dashboard. You could quite easily customise the firmware to return readings in the format you prefer though. Count the number of lines in |
I've dug through the code around the second again, and yes, I can see what's happening now. None of the other readings are cumulative, and the Met Office requests that they are per reading, I don't want to create a more permanent fork until the code is a bit more stable than currently, so I'll work on how to do it later. That the rainfall stops the device from waking at the expected time is more of an issue :) |
Can you link to the Met Office documentation for that please? We'll take a look. What do you mean by it "stops waking the device at the expected time"? |
Met Office WOW data page - https://wow.metoffice.gov.uk/support/dataformats under the "Weather Data:" heading From my log file: 18:00 all good wake expected at 18:05
|
So, I've just had a period of "organic" rainfall, and once again, as soon as rain was detected, the wake sequence failed, and so uploads stopped. The below logs show I'm running on my fork with more verbose logging (see #68) at the moment, hence the extra log lines.
I'm going to try and look at the alarm setting code, and seem if it can be added to the rainfall sleep. |
I think I'm seeing shenanigans with rain also - our weather station (running v0.0.8) has stopped reporting in overnight rain, just after a couple of |
Just went out to check on our non-responsive Weather (I really need a testing setup that's not at the top of a tall pole!) and like @MrDrem 's, the board hadn't crashed, it was just asleep and was revived with a press of the poke button. So I agree that it looks like the wake up timer is not being set correctly after a rain trigger event? |
New to this but if in sleep() I set a global variables for hour and minute of the alarm that is calculated last before it goes ot sleep like this:
Then in weather.py add this to the end of the startup() if statement where it goes back ot sleep
just before Just wanted your thoughts before I go up my pole to test it? |
@MrDrem @lowfatcode @helgibbons - Has anyone managed to get this to work understand what execatly needs to be done. I am happy to try it out but tried the above and did not work. |
@dave-ct I have looked into this and can reproduce the error. The past discussion is correct that the rain detection code path does not set the RTC alarm again, however it never unsets the RTC alarm either, so the previously set alarm should still be active in between multiple rain detections. Clearly that is not happening and I would like to understand why first before doing what you propose. Also, I think the code path can be neatened up so that if that avenue is needed, the code can call the regular sleep() which would set the RTC with a newly calculated time. |
@ZodiusInfuser thanks for the update, see you are doing some changes in the patch branch, let me know if you would like any help testing any of the changes you make. |
@dave-ct if you could test the patch branch that would be great! There's still much I need to do, but I would be curious if any of my changes so far help resolve some of people's issues. No rush though, as I've got plenty to be getting on with still. Currently I'm trying to improve the execution order of the code so that rain detection happens quicker, as at the moment it will under report with heavy rainfall, at least in my simulated tests of filling the bucket to the top (equates to 2 ticks per second). I have no idea if that is representative of real rainfall though, so perhaps this isn't worth my time to fix? |
2 ticks per second is pretty unrealistic as that would be about 0.6mm per second (0.2794 mm per tick) with the size of the one in the kit, if someone uses a smaller bucket on their sensor say an accuracy of 0.1mm per Tik that , for violent rain would be about 50mm per hour so 500 ticks per hour or 1 Tik roughly every 10 seconds. I think if you can get a Tik every 10 seconds recorded it should be fine. |
Currently it takes about 3-4 seconds for the board to wake up, process a rain event and go back to sleep. That seems awfully long to me, but is well within the 10 seconds you say so not important to address now. I'll raise this as a new issue to revisit at some point in the future. |
I have pushed some changes to the |
Been offline, will test it out tomorrow |
@ZodiusInfuser I've just tried loading the patch branch, and there are now issues around uploads. MicroPython 9dfabcd-dirty on 2022-08-10; Raspberry Pi Pico W with RP2040
Looking around row 370, it's:
There's a load of code commented out before it, but not replaced, so I think it may be in this, as I've poked around the influxdb.py file (which is what I'm using) and I can't see what the issue is there, and it's not been touched for 2 months. Any ideas? |
@MrDrem That's my bad. I haven't looked at the influxdb destination file yet and it seems that have Btw. Going forward I think it would be useful to have comments about the patch testing go on the draft pull request #113 |
@MrDrem Have a go with the enviro |
Now we get:
Which is at least a new error :) I might try to look at it to work it out later. |
Ah, that error. That's because the file format the |
That's grand, and seems to be back uploading. I'll get it back outside and see how it goes, |
Cool. I've added a check for that error now, so it shouldn't catch others out in future. |
Hmm, well that's progress at least. I'm not sure how much liquid the rain tipper can actually store. The fact there's 10 minute periods without a reading suggests its not heavy rain though. |
updated all the files yesterday, been running ok overnight indoors with no sensors. just taking weather station out side and connected sensors. its raining now. Dont think bucket stores the rain. its tip and release. heavy rain might make it rattle lol Some minor observations: Running on LiPo but voltage is reading as Zero. I use Adafruit-io can see youve created a new rainfeed i.e weather-stat-1-rain-per-second. Waiting on first rain report |
Thanks for testing. Battery voltage measuring is currently disabled as the way that was done previously caused issues with the WiFi and boards locking up. Yes, there's |
All good for about 2 hours then no further reporting. Went out to recover weather station when rainstopped! Have added log_usb file when connecected via USB. Shows halt at 12:19 and USB restart at 16:23 Attempted restart then "add new rain trigger" looped. see shell.log Further restart failed, so removed rain.txt looks like might have to flash the Enviro-Weather!! |
Sorry about this! It looks like there's three separate issues going on here, though it's not obvious at first glance why. I'll investigate when I'm next working. |
So yes, multiple rain triggers in the same 5 minutes are working too! (4 tips in one 5 minute period at one point!) I think that @daved38 may be using an MQTT based upload method (adafruit.io?) which may be causing the halts. Switching to a local InfluxDB instance solved this for me (not suggesting everyone should do this, just that I don't think their issues are related to the rain code). |
I connect to wfi successfully using what I believe to be the latest patched
version. However I'm not to sure what the proper process is to copy the
files across so could easily make a mistake. I have queried best practice
with ZodiusInfuser <https://github.com/ZodiusInfuser>
Dave
…On Fri, 18 Nov 2022, 15:54 David Edwards, ***@***.***> wrote:
Hi @ZodiusInfuser <https://github.com/ZodiusInfuser> Have just tried the
latest patch release, unfortunatley it wont allow me connect to wifi with
this version. I get the following log entries with the current patch
version:
- -- ---- -----=--==--=== hey enviro, let's go! ===--==--=----- ---- -- -
2022-11-18 15:26:01 [debug / 127kB] > performing startup
2022-11-18 15:26:01 [info / 118kB] - wake reason: unknown
2022-11-18 15:26:01 [debug / 116kB] - turn on activity led
2022-11-18 15:26:02 [info / 106kB] > 8 cache files need uploading
2022-11-18 15:26:02 [info / 103kB] > connecting to wifi network 'VM2878914'
2022-11-18 15:26:44 [debug / 100kB] - connecting
2022-11-18 15:27:14 [error / 125kB] ! failed to connect to wireless network VM2878914
2022-11-18 15:27:14 [error / 123kB] ! reading upload failed
2022-11-18 15:27:14 [info / 121kB] > going to sleep
2022-11-18 15:27:14 [debug / 119kB] - clearing and disabling timer and alarm
2022-11-18 15:27:14 [info / 117kB] - setting alarm to wake at 15:30pm
2022-11-18 15:27:14 [info / 115kB] - shutting down
2022-11-18 15:27:14 [debug / 112kB] - on usb power (so can't shutdown) halt and reset instead
To ensure it was not something else I switched back to the 0.0.8 release
and connects fine to the wifi
2000-01-01 00:09:21 [debug / 118kB] > performing startup
2000-01-01 00:09:21 [info / 124kB] - wake reason: unknown
2000-01-01 00:09:21 [debug / 122kB] - turn on activity led
2000-01-01 00:09:21 [info / 121kB] > clock not set, synchronise from ntp server
2000-01-01 00:09:21 [info / 119kB] > connecting to wifi network 'VM2878914'
2000-01-01 00:09:23 [debug / 112kB] - connecting
2000-01-01 00:09:26 [info / 99kB] - ip address: 192.168.0.90
2022-11-18 15:50:45 [info / 96kB] - rtc synched
2022-11-18 15:50:46 [info / 87kB] > going to sleep
2022-11-18 15:50:46 [debug / 124kB] - clearing and disabling timer and alarm
2022-11-18 15:50:46 [info / 121kB] - setting alarm to wake at 16:00pm
2022-11-18 15:50:46 [info / 119kB] - shutting down
2022-11-18 15:50:46 [debug / 117kB] - on usb power (so can't shutdown) halt and reset instead
2022-11-18 15:51:06 [debug / 122kB] > performing startup
2022-11-18 15:51:27 [debug / 118kB] > performing startup
2022-11-18 15:51:27 [info / 124kB] - wake reason: unknown
2022-11-18 15:51:27 [debug / 122kB] - turn on activity led
2022-11-18 15:51:28 [info / 113kB] > going to sleep
2022-11-18 15:51:28 [debug / 111kB] - clearing and disabling timer and alarm
2022-11-18 15:51:28 [info / 109kB] - setting alarm to wake at 16:00pm
2022-11-18 15:51:28 [info / 107kB] - shutting down
2022-11-18 15:51:36 [debug / 118kB] > performing startup
2022-11-18 15:51:36 [info / 124kB] - wake reason: unknown
2022-11-18 15:51:36 [debug / 122kB] - turn on activity led
2022-11-18 15:51:37 [info / 113kB] > 3 cache files need uploading
2022-11-18 15:51:37 [info / 110kB] > connecting to wifi network 'VM2878914'
2022-11-18 15:51:39 [debug / 104kB] - connecting
2022-11-18 15:51:42 [debug / 91kB] - connecting
2022-11-18 15:52:05 [info / 101kB] - ip address: 192.168.0.90
2022-11-18 15:52:06 [info / 116kB] - uploaded 2022-11-18T15:50:46Z.json to mqtt
2022-11-18 15:52:06 [info / 109kB] - uploaded 2022-11-18T15:51:28Z.json to mqtt
2022-11-18 15:52:07 [info / 102kB] - uploaded 2022-11-18T15:51:37Z.json to mqtt
2022-11-18 15:52:07 [info / 100kB] > going to sleep
2022-11-18 15:52:07 [debug / 98kB] - clearing and disabling timer and alarm
2022-11-18 15:52:07 [info / 96kB] - setting alarm to wake at 16:00pm
2022-11-18 15:52:07 [info / 94kB] - shutting down
2022-11-18 15:52:17 [debug / 118kB] > performing startup
2022-11-18 15:52:17 [info / 124kB] - wake reason: unknown
2022-11-18 15:52:17 [debug / 122kB] - turn on activity led
—
Reply to this email directly, view it on GitHub
<#70 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3L6OIZBIYMSCD7ZENPX6BTWI6REPANCNFSM6AAAAAAQFHNMRY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I have been testing this evening on the latest patch branch. @daved38 I just copied my config file (did not want to reprovison) and then deleted everything on the PICO, flashed with the latest pimoroni picoW firmware (not enviro one), synced enviro repo with GitHub Desktop and switched to patch branch then just copied over (using Thonny) the synced enviro and phew folder plus the main.py file. Finally added my config file back. So far all good for rain readings running outside on battery, just tipped a little water in two ticks each time which gets recorded correctly. This is using mqtt for the destination but to a local mqtt broker I have setup. Will monitor over the next few days to see if any other issues pop up. |
@daved38 I have just pushed a fix to the patch branch for the spamming of |
There is a new release that may fix this issue: https://github.com/pimoroni/enviro/releases/tag/v0.0.9 |
I've been playing with the rain detection, with "manually" generated rainfall, and have identified another issue with the code as it stands.
When the system is put into sleep having woken from a rain event, no wake timer is set (I suspect), and so the board doesn't start logging again for normal logging afterwards. If the 'Poke' button is pressed, this does restart logging. I think that this can be seen in 2022-09-05b log.txt.
The initial wake also recorded the 3 quick tips, but the later 2 only recorded a single tip each, despite there being more than one (this may be due to how close together the tips were though). This can be seen in 2022-09-05 rain.txt.
Hope this makes sense!
The text was updated successfully, but these errors were encountered: