Nickloas,
I may be totally wrong with my thoughts, but it works perfectly with arduino.
The more pulses or clicks we have, the more we get exact windspeed. That's why we pay more to have 8 pulses / turn (16 changes or clicks). So counting rising and falling edges double the precision compared to counting pulses. For that, the time pulse is high must be close to the time it's low. Counting pulses would give me a multiply factor of 0.5029 km vs 0.2514 km with 16 changes. Delta time being the same, precision is higher.
I understand pi is not realtime but with the way I calculate windspeed, the delay where I count windclicks (falling and rising in my case) doesn't need to be exactly one second. It could be few msec shorter or longer, it doesn't matter. What's really important is to be able to have ISR (Interrupt Sub Routine) called each time we have a level change or a pulse at the pin we monitor windspeed and keep this subroutine very short to keep exec time as short as possible.
My wind speed is in km/h and I'm using 16 clicks / turn
Here's my logic with arduino and it should work with pi:
Main Loop
-> Current_second = last_second
-> Calculate Wind Speed function
-> Calculate Rain function
-> Scan other sensors
-> update lcd screen
-> Wait till next second
- Start main loop again
Calculate Wind Speed Function (done each second)
-> Delta_time_speed = now(in msec)- start_time_speed(msec)
-> wind speed (kmh) = Wind_clicks X 0.2514605 (kmh) X (Delta_time_speed/1000)
-> wind_clicks = 0
-> start_time_speed = now(in msec)
Wind_clicks function (Interrupt Sub Routine called each time we have a windspeed click. Must be very short for reducing exec time)
-> wind_clicks ++ (add one click)
-> return
pi delay may destroy this process but if this happens, I hope being able to restore it with threads and priority. Delay between resetting windclick's count and start time to calculate windspeed should be close to zero, so no clicks should be lost.
Also, I'm pretty sure I will not run weewx. I may extract astronomical data and use what I currently have with my arduino, which is extremely less powerfull than the pi3. All I need is a local console and send data to wunderground. So keeping the load low for a pi, should also help keeping delays as short as possible and avoid delays problem. Arduino mega is currently doing this job, I expect a pi3 to do the same as there's no comparison between power for these processors. These are my hopes ....
As you've certainly seen, english is not my mother's tongue, so forgive my bad english which may send you in the wrong direction ...
J Guy
Like I said, that's my thoughts so far. I may be totally wrong but I will try.