08-30-2019, 05:28 PM
Would really love to see a way to 'live stream' the data that OA gathers out to something else. My main thing I'd love to see if data it gets from GPS and ODBII.
I have a bluetooth ODBII reader that'd I'd be happy to connect to OA, but I really want that data logged elsewhere. I already have a dashboard and a tuner that shows me that engine info, but nothing that logs it.
In the 'home automation' space, I really want to stream some of the data from my truck back home for alerts/maintenance reminders etc. (saw fuel jump to full? send a notification to add fillup details to the log. Just rolled another 15k miles? reminder to change oil. Etc). Additionally, by streaming GPS info now we can let the house know if we're about to be home
Its very common in the IOT world to use MQTT. Its very widely used, is very lightweight and can be used to stream data out (and in) quite easily.
In python, its relatively trivial to send a value (online) to a broker:
I have a bluetooth ODBII reader that'd I'd be happy to connect to OA, but I really want that data logged elsewhere. I already have a dashboard and a tuner that shows me that engine info, but nothing that logs it.
In the 'home automation' space, I really want to stream some of the data from my truck back home for alerts/maintenance reminders etc. (saw fuel jump to full? send a notification to add fillup details to the log. Just rolled another 15k miles? reminder to change oil. Etc). Additionally, by streaming GPS info now we can let the house know if we're about to be home
Its very common in the IOT world to use MQTT. Its very widely used, is very lightweight and can be used to stream data out (and in) quite easily.
In python, its relatively trivial to send a value (online) to a broker:
import paho.mqtt.client as mqttClient
client = mqttClient.Client(client_name) #create new mqtt client
client.username_pw_set(user, password=password) #set username and password
client.tls_set(ca_certs=TLS_CA_PATH,tls_version=ssl.PROTOCOL_TLSv1_2) #enable SSL
client.will_set("openauto/server/status", payload = "offline", qos = 0, retain = True) # Set the LWT for the client. Lets server auto-publish
# Connect and do things
client.connect(broker_address,port,60) # Connect to the broker
client.publish(topic, payload="online", qos=0, retain=True) # Publish something