Failed port reading on upboard

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

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?

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 ROS package . Below is a snippet of the code that is trying to connect to the laser

      void LMS1xx::connect(std::string host, int port)
        if (!connected_)
          logDebug("Creating non-blocking socket.");
          socket_fd_ = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
          if (socket_fd_)
            struct sockaddr_in stSockAddr;
            stSockAddr.sin_family = PF_INET;
            stSockAddr.sin_port = htons(port);
            inet_pton(AF_INET, host.c_str(), &stSockAddr.sin_addr);
            logDebug("Connecting socket to laser.");
            int ret = ::connect(socket_fd_, (struct sockaddr *) &stSockAddr, sizeof(stSockAddr));
        if (ret == 0)
          connected_ = true;
          logDebug("Connected succeeded.");

    Hope to hear from you!


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!


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.


@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?


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! :wink: