# Failed port reading on upboard

**URL:** <https://forums.balena.io/t/failed-port-reading-on-upboard/23738>\
**Category:** Product support\
**Created:** [August 6, 2019, 11:54am UTC](https://forums.balena.io/t/failed-port-reading-on-upboard/23738 "2019-08-06T11:54:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tresink](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tresink](https://forums.balena.io/u/tresink)\
**Post date:** [August 6, 2019, 11:54am UTC](https://forums.balena.io/t/failed-port-reading-on-upboard/23738/1 "2019-08-06T11:54:21Z")

</div>

Dear All,

We are currently developing a new robot that uses some laser (SICK100), that has an ethernet connection. I am putting the drivers on an upboard that runs BalenaOS. However, the driver is unable to find the laser, whereas it can find it on my laptop from the same docker environment (without BalenaOS though). It seems as if the port cannot be read properly.

I assumed that all ports are forwarded correctly to within the container, so that no extra setup is needed. Maybe I am wrong about this?

I hope to hear from you,

Tim Resink

---

<div class="post-metadata">

**Author:** ![lucianbuzzo](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lucianbuzzo/32/615_2.png) [@lucianbuzzo](https://forums.balena.io/u/lucianbuzzo)\
**Post date:** [August 6, 2019, 2:41pm UTC](https://forums.balena.io/t/failed-port-reading-on-upboard/23738/2 "2019-08-06T14:41:05Z")

</div>

Hi @tresink, Could you please provide a little more information about your setup:

- What balenaOS version are you using?
- What port does the laser use?
- Are you seeing any error messages in your container?
- Could you provide a minimal reproduction of the issue?

---

<div class="post-metadata">

**Author:** ![tresink](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tresink](https://forums.balena.io/u/tresink)\
**Post date:** [August 7, 2019, 7:34am UTC](https://forums.balena.io/t/failed-port-reading-on-upboard/23738/4 "2019-08-07T07:34:19Z")

</div>

Hi @lucianbuzzo,  
Thanks for the quick reply! For your request:

- We use balenaOS 2.29.2

- The laser uses either port 2111 or 2112 - I am not sure which.

- There are no error messages, just a message that it cannot find the sensor.

- What would you like to see for a reproduction? The driver is an [open source](https://github.com/clearpathrobotics/lms1xx) ROS package . Below is a snippet of the code that is trying to connect to the laser

---

<div class="post-metadata">

**Author:** ![zrzka](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/zrzka/32/1612_2.png) [@zrzka](https://forums.balena.io/u/zrzka)\
**Post date:** [August 7, 2019, 8:22am UTC](https://forums.balena.io/t/failed-port-reading-on-upboard/23738/5 "2019-08-07T08:22:51Z")

</div>

Hi,

can you copy & paste the exact error message? Also what is the `host` argument value here? Is this IPv4 / IPv6 (text representation)? There shouldn’t be any limitation in terms of network communication from the container. Can you double check that the `host` value is correct here? Thanks!

---

<div class="post-metadata">

**Author:** ![tresink](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tresink](https://forums.balena.io/u/tresink)\
**Post date:** [August 7, 2019, 11:42am UTC](https://forums.balena.io/t/failed-port-reading-on-upboard/23738/7 "2019-08-07T11:42:35Z")

</div>

Hi,

Sorry but no, there is no error message. The  
`int ret = ::connect(socket_fd_, (struct sockaddr *) &stSockAddr, sizeof(stSockAddr));`  
Just returns -1 after some time, so it seems like a timeout. The host value is indeed correct! I tried this driver with this laser from within the same docker container, but on my own laptop, and everything works fine!

Sorry that i cant provide you with any more detail.

Tim

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [August 7, 2019, 2:12pm UTC](https://forums.balena.io/t/failed-port-reading-on-upboard/23738/10 "2019-08-07T14:12:32Z")

</div>

@tresink Hi, I read the information you posted and my first guess would be that you are using multi-container environment for you application. Do you have a docker-compose.yml? If it is multi-container environment, then the restrictions to the networking will be bigger. If it is a single container - then it is not restricted and it should be a different issue.

You mentioned that you are putting some drivers - are those kernel drivers? Are they compiled towards the same kernel and loading successfully?

Thanks,  
Zahari

---

<div class="post-metadata">

**Author:** ![tresink](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tresink](https://forums.balena.io/u/tresink)\
**Post date:** [August 8, 2019, 9:25am UTC](https://forums.balena.io/t/failed-port-reading-on-upboard/23738/12 "2019-08-08T09:25:13Z")

</div>

Hi @majorz,

The problem is fixed! Turns out, it was unrelated to Balena, so sorry to keep you guys busy!

So far, Balena works as we hoped it would so keep up the good work! 😉

Tim
