Thanks for some extra explanation.
So port 3050 is used, that’s fine, but I wasn’t sure if that was the problem.
If you want to connect from your PC to the Raspberry Pi, than you need the local IP address of that Raspberry Pi. If you connect to localhost:3050 from your PC, your PC is trying to connect to itself on port 3050. That’s the use of localhost.
Your code looks fine. Is it correct that you can connect with the Raspberry Pi if you use the local IP address of your Raspberry Pi right (Like 192.168.X.X:3050)? Because otherwise, you’ll need to open the ports from Docker. Like this. But in BalenaOS, this is done automatically for single docker containers (Correct me if I’m wrong).
So if what’s you’re trying to do is connect to the Raspberry Pi with “localhost:3050”, that’s not possible. You can use the hostname of the Raspberry Pi. You can find the hostname by ssh’ing into the machine and simply type:
hostname. Then, you can use that hostname to connect from the PC to the Raspberry Pi like this:
If something else is failing or this is not the answer you’re looking for, I’m pleased to answer your other questions! But share as much as possible, so that I, and others, can help you!