-
|
Hello, I'd like to put a simple TCP server socket listening at a pre-defined port for incoming connections in my Docker/ACAP application running in the camera. This would facilitate an exchange of messages between a PC and a camera. However, I'm unable to establish a connection to my ACAP app from my PC (a test script runs there) as the connection to the specified port number gets refused (at the PC's point of view). The camera is in the same subnet with my PC. Next I'll explain in more details my app and testing setup. My AppRegarding my containerized app, I have created an ACAP/EAP project in C++ that combines features from the object detection sample project (1) and the containerization example (2).
I'm able to build an EAP file, then upload it to the camera, and once completed I can start the EAP/app from the Apps tab in the web GUI. My app is built with ACAP Computer Vision SDK v1.5 and Ubuntu Runtime at 22.04, while Docker Daemon with Compose app is v1.2.5. The camera model is an Axis Q1656 with firmware 11.1.65. My (simplified) docker-compose.yml looks like the following: The environment variable The desired server functionality in my container app implementation relies on the Poco library, the following shows some of the main logic in a simplified form: Poco library version is 1.12.4. The parameter TestingSimultaneously while my Docker app runs in the camera, on my Windows command prompt I'll start a simple Python script that tries to establish a connection to the IP and port where my Docker app is (should be) awaiting. The script works like this, Almost immediately (a couple of seconds after start) appears the ConnectionRefusedError printout: There's one thing that works but it requires changing the roles of the app and the PC. I have another testing mode in my container app where it takes the initiative to connect to an external client (which is my PC running a test script awaiting connections): In this way I've managed to establish a connection from the camera to the PC. This setup requires that the docker-compose.yml defines open ports (like Relevant Docker documentationAs you see above, I've tried a few things and I wonder if the reason for this refusal error could be that the container application does not really have open ports to the outside world. Docker has following documentation:
There's another piece of Docker documentation that informs the following:
When my ACAP app is running in the camera, I can see some port information by executing QuestionsBased on the given information, is this enough of a proof that the ports setup of the docker-compose.yml is working correctly? Or could it be that my ACAP app is still not exposing ports from the container's firewall for incoming traffic properly (see the referenced Docker documentation)? What else I could try out? Would it help to get an interactive access to the live container via |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.

Hi, it seems like I found a solution after all to this connectivity problem. The problem was indeed in my docker-compose.yml at this position:
The socket started working when I changed the highlighted address to
0.0.0.0:9922. Likely the port(s) was correctly published already before, but the socket was not listening the right network interface (or something like that).