I’m interested in developing a service with functionality akin to the following:
When I publish an MQTT message to a designated topic with specific content, I aim to receive a response from AutoPi.
Specifically, I intend to request the car’s location, but I prefer to initiate these requests manually instead of receiving periodic updates every 5 seconds.
I’m seeking guidance on the most straightforward method to establish this setup. Is it feasible, and if so, what steps would you recommend?
As part of the service you could include an obd.manage command that is triggered when the topic receives a message, the command could looks something like this:
Thank you for your prompt response. I’ve seen the documentation you shared, but I’m currently facing issues with creating the trigger when a message is sent via MQTT.
Additionally, I appreciate the command you provided; however, could you please clarify where I should insert this command in the process?
The way I would go about it based on the example MQTT listener I would replace or add to the on_message function to include the command to get the location and send it to the cloud.
I’ve also noticed I gave you the wrong command previously, as the location is in the gnss manage and not OBD and it’s also meant for the cloud terminal not custom code . when running the command from the custom code you’d need to use a slightly different syntax and should look more like this.