Signal KSK
Signal K11mo ago
22 replies
Simon

Simon - I would like to use a GPIO on a Raspber...

I would like to use a GPIO on a Raspberry Pi to record cumulative engine hours for a club vessel. I have some Python code that runs every 6 mins and, if the line is high, increments a value in a file. I would like to send this to the SignalK server on the same Pi. Is it as simple as adding a line similar to:
import requests
r = requests.put('http://localhost:3000/signalk/v1/api/vessels/self/engine/cumulativeHours', data ={"value": 710.1, "source": "gpio.engineFeed"})
print(r)
Was this page helpful?