# Communication to external sensor

**URL:** <https://discuss.bluerobotics.com/t/communication-to-external-sensor/15774>\
**Category:** General Discussion\
**Created:** [January 8, 2024, 3:55pm UTC](https://discuss.bluerobotics.com/t/communication-to-external-sensor/15774 "2024-01-08T15:55:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![markusbuchholz](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@markusbuchholz](https://discuss.bluerobotics.com/u/markusbuchholz)\
**Post date:** [January 8, 2024, 3:55pm UTC](https://discuss.bluerobotics.com/t/communication-to-external-sensor/15774/1 "2024-01-08T15:55:47Z")

</div>

I have a BlueROV2 and I want to connect a Serial nanomodem / acoustic sensor to it.

[https://www.mdpi.com/2079-9292/11/9/1446](https://article_about_sensor)

I can connect the sensor to the Raspberry Pi using an interface serial/USB. I want to send a command to the sensor, which has a unique address (for example, 159). I am using a Python driver to communicate with the sensor, which works perfectly.  
[https://github.com/bensherlock/nm3-python-driver](https://python_driver)

My question is, how can I configure BlueOS to make this happen?

Please refer to the image below. I want to run my Python script on the host and ping/communicate with the sensor through BlueOS. I believe it is necessary to set up some sort of port forwarding.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/7/749157b2ea906b2b9890901566399b4755872ef2.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [January 10, 2024, 10:49pm UTC](https://discuss.bluerobotics.com/t/communication-to-external-sensor/15774/2 "2024-01-10T22:49:31Z")

</div>

Hi @markusbuchholz  
Checkout one of our newest guides, it may be able to help you!

> **[Connecting your device with Navigator and BlueOS](https://bluerobotics.com/learn/connecting-your-device-with-navigator-and-blueos/)**
>
> Get things connected to your BlueOS powered vehicle! Whether Serial, I2C, Ethernet or USB, collecting data for your application is possible!

---

<div class="post-metadata">

**Author:** ![markusbuchholz](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@markusbuchholz](https://discuss.bluerobotics.com/u/markusbuchholz)\
**Post date:** [January 11, 2024, 12:07am UTC](https://discuss.bluerobotics.com/t/communication-to-external-sensor/15774/3 "2024-01-11T00:07:12Z")

</div>

Hi @tony-white,

Thank you for your support. Your guidance has been extremely helpful since I use BlueBoat in addition to BlueROV2.

Due to the urgency of my case, I decided to use the solution presented in the following image. The software I use communicates with USB (acoustic sensors), so I easily built a Docker container with a ROS environment. The Docker container has to be built on the RPI and then run. A ROS node takes samples from the sensor /dev/ttyUSB0 and publishes them as a ROS topic.

I have not changed anything inside the BlueOS. This concept has been tested and works perfectly fine.

Thank you again and good luck!

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/6/6faffea9cad0a86e6e3781b87414a0ff4c9aee19.png)

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [January 11, 2024, 12:36am UTC](https://discuss.bluerobotics.com/t/communication-to-external-sensor/15774/4 "2024-01-11T00:36:37Z")

</div>

Hi Markus!  
Congrats on getting it working! Have you checked out the ROS extension you can find [here](https://blueos.cloud/docs/blueos/1.1/advanced-usage/#extensions-manager)?  
If you’d like to share your code, it may be super helpful for others! As it is already dockerized, it should be very easy to turn it into a BlueOS extension. A quick [pull request](https://github.com/bluerobotics/BlueOS-Extensions-Repository) and it’s listed on for all! We’re working to add capacity to even charge $ for extensions, so developers like you can benefit directly in the future.  
Checkout the extension [documentation](https://blueos.cloud/docs/blueos/1.1/development/extensions/), and let us know if you try this and get stuck.

In terms of the recent guide I shared, if you want your topside computer to receive the data from the device as if it were plugged in directly, you could convert it to a ROS topic locally using VirtualHere for the connection.

I’m curious, what sort of usb device and acoustic sensor are you using?

---

<div class="post-metadata">

**Author:** ![markusbuchholz](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@markusbuchholz](https://discuss.bluerobotics.com/u/markusbuchholz)\
**Post date:** [January 11, 2024, 12:57am UTC](https://discuss.bluerobotics.com/t/communication-to-external-sensor/15774/5 "2024-01-11T00:57:33Z")

</div>

Hi @tony-white,

I’ll do my best to contribute to this exciting project by making a pull request. I work in academia as a post-doc in marine robotics. We use nano-mode acoustic communication, which is a state-of-the-art technology for underwater communications. You can find more information about it in the links below. The software I developed is a simple ground truth vehicle estimation concept, which is displayed below:

[article](https://www.mdpi.com/2079-9292/11/9/1446)  
[documentation](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/5/566182524fd616e1781846829c20c3e4500740bc.pdf)

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/0/03da3963e11bc648a5007a7bf1f6cff520be2f18.png)

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [January 11, 2024, 1:21am UTC](https://discuss.bluerobotics.com/t/communication-to-external-sensor/15774/6 "2024-01-11T01:21:53Z")

</div>

Thanks! The links you shared before were a bit tricky, but this is super cool work to see!
