davidzof / wattzap-ce

Wattzap Virtual Cycle Training Community Edition
http://www.wattzap.com/
21 stars 16 forks source link

I want to add support for GPIO sensors on a Raspberry pi #107

Open michael-barrow opened 1 year ago

michael-barrow commented 1 year ago

Great project! I want to use it to upgrade an old spinner bike with dumb sensors connected to a raspberry pi by running wattzap to replace the old computer. The sensors are just switches, not bluetooth devices. I can write an IO driver for the Pi ok, but what is the best way to register said driver with the wattzap sensor IO code? I would prefer something simple rather than trying to create a virtual ANT device if that can be avoided.

davidzof commented 1 year ago

Switches make a lot of sense really. I guess the io driver would be written in 'C'. I wonder if starting Wattzap with some kind of agent would be a way to implement this. Otherwise a call via a REST interface giving the current speed calculated by your driver. I guess you would give speed and cadence? Let me know if you've had any other thoughts.

michael-barrow commented 1 year ago

I had thought about emulating a BLE device using Google's bumble Bluetooth project which is a python thing. I wanted to use a pi for this and it's quite easy to write an RPM driver for a cheap switch based cadence sensor using the pi's GPIO python module. The hard part is getting bumble to work and getting wattzap to run. Wattzap It won't start on my pi, I had kind of given up on getting it going honestly