Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Raspberry Pi read only

2021-01-06
2022-01-27
  • yannickasselin - 2021-01-06

    Hello,

    I am testing Codesys running on a Raspberry Pi in Read Only mode (using the read only feature built into Raspberry Pi OS).
    So far so good. I am using the persistence manager to save some variables values on a usb stick and it works fine.

    I was just wondering if anyone else have used Codesys on a Raspberry Pi in read only mode?

    Have you ran into any issues?

    Are there any other things to consider?

    Is there a way to download the compiled file to a different location so that I don't need to put the Pi back in read/write mode every time I want to make a modification in the PLC?

    Does anyone know if there is a way to exclude some files/folders from the overlayFS?
    I am used to the file based write filter in windows 7 embedded where you can exclude files and folders from the overlay (but it is all screwed up in windows 10 with the new unified write filter).

    Thank you

     
  • eschwellinger

    eschwellinger - 2021-01-08

    Hi,
    yes I do so, there are some problems with the softlicense I've added a improvement tracking entry for it.
    I think there is no posibility add some file/folders to exclude - but better to ask this in raspberrypi.org forum: https://www.raspberrypi.org/forums/
    Pretty sure you'll get an answer there.
    Sure if needed you could redirect the whole PLClogic path to save Application to on an USB device.
    (not only the persitence manager files)

    Best Regards
    Edwin

     

    Last edit: eschwellinger 2021-01-08
    • yannickasselin - 2021-01-09

      I don't have any problem with the license so far.
      Could it be because I use a dongle for the license?

       
    • raspi-user - 2021-02-02

      Hi Edwin,
      You wrote "there are some problems with the softlicense".
      Can you give some more information about it?
      Does it mean right now (with all latest Versions of Raspberry OS, CODESYS, and Raspi packages) it is not worth trying to run the RPI with OverlayFS because it will fail anyway when using a soft license?

       

      Last edit: raspi-user 2021-02-02
  • eschwellinger

    eschwellinger - 2021-01-09

    Yes, sure this should work only with runtime key not
    with softlicense at the moment.

    Update: with latest Raspberry PI OS (Januar release) for me it works without problems even now with Softlicense.

     

    Last edit: eschwellinger 2021-02-02
  • yannickasselin - 2021-01-11

    How could I redirect the whole PLCLogic path?

    I tried this but it does not work:

    PlaceholderFilePath.1=/media/pi/DATA/PLCLogic, $PLCLogic$
    PlaceholderFilePath.1.Volatile=1
    PlaceholderFilePath.1.View=1

     
  • eschwellinger

    eschwellinger - 2021-01-11

    [SysFile]
    PlcLogicPrefix=1
    FilePath.1=/etc/, 3S.dat
    PlaceholderFilePath=/media/pi/DATA/PLCLogic, $PLCLogic$

     
  • yannickasselin - 2021-01-11

    I must be missing something. It does not seem to work. Nothing gets written on the USB stick.

     
  • yannickasselin - 2021-01-11

    When I do this, everything works fine. I can see the persistent variables written on USB stick:

    [SysFile]
    FilePath.1=/etc/, 3S.dat
    PlcLogicPrefix=1
    PlaceholderFilePath.1=/media/pi/DATA/ac_persistence, $ac_persistence$
    PlaceholderFilePath.1.Volatile=1
    PlaceholderFilePath.1.View=1

    But when I do this, nothing is written on the USB stick:

    [SysFile]
    PlcLogicPrefix=1
    FilePath.1=/etc/, 3S.dat
    PlaceholderFilePath=/media/pi/DATA/PlcLogic, $PLCLogic$

     
  • yannickasselin - 2021-01-11

    I found that the placeholder is $PlcLogic$ not $PLCLogic$ There is an error in Codesys Help:
    https://help.codesys.com/webapp/ac_pm_overview;product=core_Application_Composer;version=3.5.16.0

    So this is working now:

    [SysFile]
    FilePath.1=/etc/, 3S.dat
    PlcLogicPrefix=1
    PlaceholderFilePath.1=/media/pi/DATA/PlcLogic, $PlcLogic$
    PlaceholderFilePath.1.Volatile=1
    PlaceholderFilePath.1.View=1

    But I still have a problem. I think Codesys starts before the USB stick gets mounted. So Codesys creates another folder named DATA in media/pi. I think I have seen a way to delay the start of the runtime but I cannot find it now.

    Is there a setting to delay the start of the runtime?

     
  • eschwellinger

    eschwellinger - 2021-01-11

    I would try a sleep in the
    /etc/init.d/codesyscontrol
    but I'm not sure if this is a proper solution

     
  • yannickasselin - 2021-01-11

    It seems to work when adding " /bin/sleep 10 " in /etc/init.d/codesyscontrol but I agree, it is probably not the best way to do it. I will try using a separate partition on the sd card instead of USB stick.

     
  • yannickasselin - 2021-01-11

    With a second partition I still need to add a delay. I will try to find out how to make sure the partition or the usb stick is mounted before starting the runtime.

     
    • matthew - 2022-01-26

      Hi yannickasselin,

      Did you get this working on another partition and is it a reliable option?

      Thanks

       
      • yannickasselin - 2022-01-27

        Yes it was working but I did not spend much time testing it.

        I now use some Raspberry Pi CM4 with the overlay enabled and I save my persistent variables on a usb stick instead of a second partition.

        I followed a quick guide to make sure my usb stick is always mounted on the same directory and so far did not need to delay the codesys runtime.

        Everything works fine but I am still experimenting with it.

        Dont't hesistate to post your findings on this topic.

         
        • matthew - 2022-01-27

          Hi yannickasselin,

          I'm also using the RPI CM4 in a touch screen which has eMMC and a spare SD card slot. I was going to partition the eMMC as I'm concerned the vibrations will cause issues with SD card.

          So you did not get it working with the partition and without a delay? I will continue and keep you updated when I find a solution

           

Log in to post a comment.