bonbonbaron
USA
Asked
— Edited
Hi all,
Is there a way to get sensor readings from an MPU9150 directly in Python? I've tried writing its values to a file and then reading from that file as it's being written into (to develop a live interface), but that crashes when both ARC and Python are trying to access the same file at once.
Python was able to get the camera image data just fine. Figure there must be a way to grab sensor data as well.
Thanks, Michael
I would use the Mqtt broker and client plugins to have ARC push the data to an MQ topic, and then use a Python mqtt client to read the topic (dozens of sample clients if you search python mqtt client).
Alan
If you are using Python there are few options available.
If is something simple i would go with a Http Client / Server solution.
ARC side (Http Client):
you can use HttpGet function.
Client calling a server mydesktop on port 8899
Python side (Server)
The Python 2.x code runs both on Linux and Windows, creates a web server on port 8899 (PORT_NUMBER) and handles two requests:
you can create a thread to handle the server requests:
once you get the values you have a lot options.