CODESYS iMX8M Webserver not running or port 8080 blocked

I followed:

https://developer.toradex.com/torizon/application-development/partner-containers/partner-demo-container-codesys/

which is old. I got it to work but the image names are different than described in the above link.
I get:

torizon@verdin-imx8mm-15701428:~$ docker ps
CONTAINER ID   IMAGE                                       COMMAND                  CREATED          STATUS          PORTS                                       NAMES
1abd313e4a29   codesyscontrol_virtuallinuxarm64:4.17.0.0   "/opt/codesys/script…"   43 minutes ago   Up 43 minutes   443/tcp, 4840/tcp, 8080/tcp, 11740/tcp      control
b30f483ac6f3   codesysedge_edgearm64:4.17.0.0              "/opt/codesysedge/sc…"   43 minutes ago   Up 43 minutes   0.0.0.0:1217->1217/tcp, :::1217->1217/tcp   GW
5a43ebb86829   torizonextras/easy-pairing-view             "./erosView"             46 minutes ago   Up 46 minutes                                               torizon-easy-pairing-view-1
0995ec4eade9   torizonextras/easy-pairing-server           "node out/lib/index.…"   46 minutes ago   Up 46 minutes   0.0.0.0:3030->3030/tcp, :::3030->3030/tcp   torizon-easy-pairing-server-1

However using my browser with:

http://192.168.40.41:8080/webvisu.htm

gives nothing. By the way if you don’t have a proper DNS configuration you have to use IP and not hostname.
How can I enable the port or webserver?

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


CODESYS WebVisualization Port Configuration

Based on your container output, you have the CODESYS runtime containers running, but the WebVisualization port (8080) may not be properly exposed. Let me help you troubleshoot this issue.

Container Port Configuration

From your docker ps output, I can see that the codesyscontrol_virtuallinuxarm64:4.17.0.0 container shows 8080/tcp as an internal port, but it’s not mapped to the host system like the Gateway container’s port 1217(1).

Enabling WebVisualization Access

According to the documentation, the WebVisualization feature should be accessible through port 8080. To enable proper access, you need to ensure the container port is mapped to the host(1).

The WebVisualization can be accessed using the board’s IP address and port 8080 in the format: http://<IP_address>:8080/webvisu.htm(1).

Troubleshooting Steps

  1. Check Container Port Mapping: Verify that the CODESYS runtime container has port 8080 properly exposed to the host system
  2. Restart Containers: Try stopping and restarting the CODESYS containers to ensure proper port mapping
  3. Verify Project Configuration: In your CODESYS Development System, ensure that:
    • The WebVisualization is enabled in your project(1)
    • The Visualization Manager shows WebVisualization settings(1)

Project Setup Verification

Make sure your CODESYS project includes the WebVisualization component. The documentation shows that after creating a Visualization in your project, the WebVisualization feature should automatically be available through the Visualization Manager(1).

You can verify this by checking the Visualization Manager → WebVisualization in your CODESYS project tree, where you should find the WebVisualization settings configured for port 8080(1).

If the port mapping issue persists, you may need to recreate the containers with proper port exposure or check the container configuration to ensure port 8080 is correctly mapped from the container to the host system.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Yes I suppose that is the problem.
How can I log into the image and maybe modify CODESYSControl.cfg?

Hey, @DivadBo,

I’m currently investigating this issue, and I’ll get back to you when I have updates.

Regarding your latest reply, you can get a shell inside the image with the command:

docker exec -it <your-image-name> /bin/bash

Best regards,

Hi @DivadBo

I tested the workflow here.
Indeed I’m getting the same issue as you described.

I think the method described for deployment may be outdated.
We are going to check this and update this article.


I need to check what is the recommended workflow here, but:

Codesys creates a bunch of files on the device:

root@verdin-imx8mp-15006535:/var/rootdirs/home/torizon# ls
SysFileMap.cfg	       VirtualControlAPI.py  cert				     codesyscontrol_linuxarm64_4.17.0.0_arm64.deb  codesysvisualization_visualizationarm64_4.16.0.0_arm64.deb
VirtualControlAPI.log  cds		     codemeter-lite_8.40.7120.501_arm64.deb  codesysvisualization.log			   visu

The configs are here:
/var/opt/codesysvcontrol/instances/codesys_control/VirtualInstance.cfg

There you can just add "8080:8080" to the list of ports

and restart the containers.
Apparently, you can do everything through the API now:

python3 /home/torizon/VirtualControlAPI.py --stop-all
python3 /home/torizon/VirtualControlAPI.py --run-all

It is also possible in CODESYS to set the port mapping.
In CODESYS select Tools->Deploy Control SL then select Operation. The attached file shows where to do the mapping. Don’t forget to press the button save.


But how do we ensure it always starts automatically at every boot?
Further more, the fact that you can’t install a CODESYS license, makes the use of CODESYS useless.
It does not help either that i2c and I/O Port interfaces aren’t supported by “CODESYS Virtual Control for Linux ARM64 SL” with Toradex

Hey @DivadBo,

Just to let you know, we just updated the Codesys Partner Demo Container page to include the fix through the IDE.

We are currently still investigating the issue with the license, I’ll let you know when we have any further updates.

Best regards,