Many thanks, nice work. I’m also interested in the hardware, especially which 
pressure sensor you’re using and the distances from the river to your WeeWx 
install and network.

> On 7 Jul, 2020, at 00:35, Graham Eddy <[email protected]> wrote:
> 
> happy to share. haven’t put in github because (a) i need to learn git; and 
> (b) controller i use is now obsolete (but is a useful example). copy of data 
> service code attached
> 
> i have an ‘aquagauge' controller with serial interface to host and wireless 
> connections to up to 8 sensors. i am using just one sensor at present, a 
> pressure sensor secured to river bottom that is connected to a box that 
> converts water column pressure to water depth with wireless transmitter to 
> the controller (in principle much the same as ultrasonic sensor fixed above 
> river measuring distance to water)
> 
> it follows the weewx acquisition data service pattern:
> external port (interface to controller) firewalled on other side of a thread 
> to protect main weewx thread
> service starts by spawning acquisition thread and then binding a callback 
> from weewx for arriving LOOP packets
> acquisition thread opens port and loops through reading measurements from 
> port and putting them on a queue
> callback gets any measurements from queue and writes them into current LOOP 
> packet
> i could have jammed the measurements into an existing data_type in LOOP 
> packet (e.g. ‘soilMoist3’) and interpreted that data_type downstream (e.g. 
> soilMoist3 graph has label River Level) but instead i created a new data_type 
> ‘riverLevel’ (i.e. a new database column)
> 
> some interesting design considerations:
> open/read failure on port - robustly retry? when to give up, and what to do 
> then?
> multiple measurements waiting on queue - take last? average them?
> sensor measurement range - accurately covers [min,max]?
> g-eddy
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/638DA29F-AFC3-431E-8743-518ED26D4899%40gmail.com
>  
> <https://groups.google.com/d/msgid/weewx-user/638DA29F-AFC3-431E-8743-518ED26D4899%40gmail.com?utm_medium=email&utm_source=footer>.
> <aqua.py>
> 
>> On 7 Jul 2020, at 10:29 am, weather list <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> I’d be very interested in the details of your setup for the depth sensor if 
>> you’re willing to share.
>> 
>>> On 5 Jul, 2020, at 23:16, Graham Eddy <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> i have added external river depth sensor (pressure not ultrasonic but same 
>>> principle) - wrote a data service that inserts its readings into weewx loop 
>>> records; defined new database column for it to persist.
>>> g-eddy
>>> 
>>>> On 6 Jul 2020, at 9:25 am, Wes Witt <[email protected] 
>>>> <mailto:[email protected]>> wrote:
>>>> 
>>>> Is there an extension for adding snow data to weewx? i'm considering 
>>>> adding an ultrasonic sensor to my weather station which would provide snow 
>>>> depth data. how have people implemented this before? just add a database 
>>>> field for snowdepth? what about snowrate?
>>>> 
>>>> just thinking that i may not need to reinvent the wheel if someone has 
>>>> already done this.
>>>> 
>>>> -Wes
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/638DA29F-AFC3-431E-8743-518ED26D4899%40gmail.com
>  
> <https://groups.google.com/d/msgid/weewx-user/638DA29F-AFC3-431E-8743-518ED26D4899%40gmail.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/173ABA34-309B-4D89-A8A5-7C2C4CEC14D3%40gmail.com.

Reply via email to