CODESYS control on RPi starts, shortly runs, then exits

fajean
2024-06-13
2025-09-16
  • fajean - 2024-06-13

    I have a Raspberry Pi 4 we have been using for years to run CODESYS for development purposes.

    I recently have had to re-install the OS (Raspberry OS lite). The only change to the default configuration is not creating the "pi" user during install. I (apparently successfully) installed the 4.10.0.0 control on the Raspberry Pi. We have licences on a dongle.

    I am able to start the control. systemctl status shows it as running for a little while (exactly, precisely 30 seconds as per my tests, every time), then it becomes exited. I can restart the control, and the same thing happens again. Every time.

    In the brief moments it is running, I can log in to the PLC. Working fast and restarting the control many times, I have been able to configure users. I have been able to download my application. I have been able to run the application, and stop on a breakpoint. I have been able to connect with the licence manager and confirm the dongle is detected and licences are listed as OK. I see nothing wrong until the service just exits.

    I have found nothing in the logs. It is like the runtime just terminates with no error code or message after exactly 30 seconds.

    Any help would be appreciated.

     
  • eschwellinger

    eschwellinger - 2024-06-13

    if you use Bookworm uodate to 4.11.0.0 version please.

     
  • fajean - 2024-06-13

    4.11 appears to solve the problem. Thanks for your help.

    I had first installed the 64-bit version of RPiOS, but looking at various posts and the product's page on the store which only lists 32-bit compatibility, I downgraded to the 32-bit version. I did this before trying 4.11, and it did not solve the problem. Thus my working system is 32-bit, and I am wondering if I can go back to 64-bit or not.

    An 64-bit OS is not listed as compatible on the store's web page, but when installing there actually is a 64-bit version listed (automatically chosen when installing on 64-bit, but otherwise greyed out). Is 64-bit supported and the website is out-of-date, or is that some kind of work-in-progress?

     
  • eschwellinger

    eschwellinger - 2024-06-14

    it is supported for sure, send me the link the outdated webpage please.

     
  • gunstr - 2025-09-02

    We have been using the Codesys Control for Rasberry Pi for several years in many installations without any major issues. But during summer the problem mentioned above has blocked further deliveries. We have made some minor upgrades to the application but I do not really see why that should have any impact.

    HW is Raspberry Pi 4B, 2GB
    OS is Booworm Lite
    Codesys control is version 4.15 (have just installed a few systems lately with this version)

    The system boots OK but after exactly 30 seconds Codesys is shut down and becomes unreachable.

    We have tested several different combinations:

    Upgrade of the Codeys Control to 4.16
    Loading different Codesys applications
    Changing to 4GB version of the Raspberry Pi

    One of the test applications together with the 4GB HW seems to be stable, but all other combinations fails.

    Any suggestion what we can do to resolve is appreciated - this is a real business blocker now.

    Rgds

     
  • eschwellinger

    eschwellinger - 2025-09-02

    in case you are using latest hw revision, there have been added some mac adresses - for the 4.17.0.0
    release this might solve it.
    If not we need to investigate deeper.
    If it is application related you need to check the plclogger.

     

    Last edit: eschwellinger 2025-09-02
  • gunstr - 2025-09-02

    Thank you very much for the quick answer!

    The RPi hw were delivered last week so it's probably a resent version. I found an old scrapped board (2 years or so) with a broken GPIO that I tested with the same SD card image and with that board Codeys can run for the full 2h demo period without issues.

    Then I went back the the new board to test the 4.17.0.0 release but the installation fails...

    [INFORMATION]   Standard output: create and install daemon
    [INFORMATION]   Standard output: codesyscontrol started
    [WARNING]       Unable to detect Raspberry Pi Architecture. Setting armv6l as default, you can change this through the settings panel.
    [INFORMATION]   Standard output: codesyscontrol stopped
    [ERROR]         Expected exit value of command failed: expected 0, received 1
    [WARNING]       Error setting the Raspberry Pi Architecture
    [ERROR]         Error installing codesyscontrol
    

    Do you have any idea what could be the reason? I'm using an OS image including Python drivers for LCD and some I/O:s from last year to keep things stable, but also after upgrading with sudo apt update && sudo apt upgrade I still get the same error

    Reverting back to 4.15.00 works fine:

    [INFORMATION]   Standard output: create and install daemon
    [INFORMATION]   Standard output: codesysedge started
    [INFORMATION]   Successfully installed codesyscontrol
    [INFORMATION]   Successfully started CODESYS Edge Gateway for Linux
    [INFORMATION]   Successfully started CODESYS Control for Raspberry Pi SL
    

    but as before the Codesys services stops after 30 seconds. And I noticed that the Codesys control stops and is not reachable also if I have no application loaded.

     
  • gunstr - 2025-09-03

    I now tried to install 4.17.0.0 on a fully clean installations:

    • A brand new RPi 4B
    • Install latest Raspberry Pi OS Lite, Release date 13 May 2025, 64bit
    • run sudo apt update && sudo apt full-upgrade
    • When asked - Select to install the updated version of '/etc/initramfs-tools/initramfs.conf'
    • Install CODESYS Control for Raspberry Pi SL. version 4.17.0.0

    Log output:

    [INFORMATION]   Connected successfully!
    [INFORMATION]   Successfully connected to target (192.168.0.197)
    [WARNING]       No supported container engine found on device. You have to install a supported container engine to use Virtual Control. Please contact the Administrator of the device.
    [WARNING]       Error detecting container architecture
    [INFORMATION]   Finished reading device information
    [ERROR]         Error output: /var/lib/dpkg/info/codesyscontrol.postinst: 88: check_legacy_extensionapi_folder: not found
    [INFORMATION]   Standard output: Selecting previously unselected package codesyscontrol.
    [INFORMATION]   Standard output: (Reading database ... 76772 files and directories currently installed.)
    [INFORMATION]   Standard output: Preparing to unpack .../codesyscontrol_raspberry_4.17.0.0_all.deb ...
    [INFORMATION]   Standard output: Unpacking codesyscontrol (4.17.0.0) ...
    [INFORMATION]   Standard output: Setting up codesyscontrol (4.17.0.0) ...
    [INFORMATION]   Standard output: make config rw
    [INFORMATION]   Standard output: set folder permissions
    [INFORMATION]   Standard output: prepare permissions
    [INFORMATION]   Standard output: check legacy extension api folder
    [INFORMATION]   Standard output: create and install daemon
    [INFORMATION]   Standard output: codesyscontrol started
    [WARNING]       Unable to detect Raspberry Pi Architecture. Setting armv6l as default, you can change this through the settings panel.
    [INFORMATION]   Standard output: codesyscontrol stopped
    [ERROR]         Expected exit value of command failed: expected 0, received 1
    [WARNING]       Error setting the Raspberry Pi Architecture
    [ERROR]         Error installing codesyscontrol
    

    If I read the log correctly the control is actually installed but cannot start.

    I'm running out of ideas how to proceeed now, any suggestions are welcome.

     
  • eschwellinger

    eschwellinger - 2025-09-03

    let me check - had a similar case today

     
  • gunstr - 2025-09-16

    The problem has been resolved. Two findings are described below for future reference.

    • The new RPi hw delivered during August 2025 has a MAC address from a new vendor series that is not supported by old runtimes. 4.17.0.0 or above is required.
    • 4.17.0.0 does not pick up the correct architecture during installation and aarch64 has to be manually configured either in the GUI under operations or in /etc/codesyscontrol/CODESYSControl_User.cfg under the [CmpRasPi] section.
     

Log in to post a comment.