I am trying a similar thing, where I want to send x,y,z values from a custom IMU sensor(connected to BlueOS-Raspberrypi via USB) to a custom widget made on the Cockpit.
I cannot just use Bridges to forward the sensor data, as sensor uses RS485 ModBus, hence I need a script to read it.
The python script to read the values from the sensor is ready, I am stuck at a point where I do not know the right URL, and the right method to send the NAMED_VALUE_FLOAT to cockpit.
I have tried sending dummy STATUSTEXT messages to QGroundControl via pymavlink, and it has worked. But as I want a custom widget, I need to use Cockpit, and from what I know, Cockpit does not communicate like QGC does(via Bare UDP).
Please help!
Thanks in advance.
Packaging your script in an extension is a great way to make it easier to setup in the future!
Also, regardless of the protocol, you can use USBIP or VirtualHere to connect any USB device plugged into your vehicleâs Pi to your topside computer - in this way any vendor software can be âtrickedâ into thinking the hardware it is intended to connect to is attached, locally.
Is there a reason youâre not connecting the external IMU to the vehicleâs autopilot, so that it can be used to improve navigation performance?
The External IMU is for a completely different reason(an underwater manipulator feedback).
Also, regardless of the protocol, you can use USBIP or VirtualHere to connect any USB device plugged into your vehicleâs Pi to your topside computer - in this way any vendor software can be âtrickedâ into thinking the hardware it is intended to connect to is attached, locally.
Yes, actually I have been using VirtualHere for testing purposes, and it has been great. Now I want to integrate my IMU with the BlueOS system instead of having multiple Software.
I understand that extension is the way to go, and I will, in the future. But currently I donât want to deal with docker.
Please check if the following idea works:
After the last post, I came to know that I can use iframe widget in cockpit, and that seems like an ideal choice for me. But instead of making a webserver as an extension, can I just deploy a small Flask-Socketio server on the Pi itself, and connect the iFrame to this URL? Wouldnât this work? Am I missing anything? No need to make an extension, just a python script, and an html page.
I tried this, and it worked. So, for testing purposes I could send data to iframe through local python script. Once all the parts of my system are up and running, and we are decided on the correct process, I will switch over to extensions.