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 SD card read only mode.

Runtime
lsislsis
2014-09-23
2019-11-13
<< < 1 2 3 > >> (Page 2 of 3)
  • eschwellinger

    eschwellinger - 2014-10-01

    Hi,

    please access the webvisu in your browser and then give me a screenshot of the logger in codesys (if you do at in /tmp/codesyscontol.log - this is only flushed from time to time)

    BR
    Edwin

    IMG: plclog.jpg

     
  • lsislsis

    lsislsis - 2014-10-01

    Log.

    IMG: raspberry_visu_fault.JPG

     
  • eschwellinger

    eschwellinger - 2014-10-01

    hi,
    seems to work from logger messages... is that the case where you do not have a connection in the browser?
    The error case screenshot is needed.

    BR
    Edwin

     
  • lsislsis

    lsislsis - 2014-10-01

    No.
    I try to send a new log when the problem exists.

    Regards

     
  • lsislsis

    lsislsis - 2014-10-02

    Hi Edwin.

    1000 watchdog reboots in 12 hours with sd card read only and usb drive as run time host without problem!

    Regards.

     
  • eschwellinger

    eschwellinger - 2014-10-03

    Hi,
    very good, seems to work reliable.

    BR
    Edwin

     
  • jvilla

    jvilla - 2014-11-01

    hi
    I have been breaking the sd card several times, the solution seems very good, doing this, we would already be enabled Retain variables ?.
    Could someone put an image with condiguracion sd read only?
    Thank you.
    Greetings.

     
  • HTejada

    HTejada - 2017-04-19

    Hi,

    I have several problems when the app is running for long time:

    After two hours:

          -I haven't trend. I tried to change the directory and configuration, always the same error.
    

    After four hours:

         - It can´t  write log in Pendrive or SD. Error= NO_EXIST but i can see the directory and files with VNC. My personal log was running by 4h no more.
    
    
    
    
         - I haven't IPv4 and I can't access to Webvisu form Browser.
    
    
         - I add a screenshot of the log.
    

    Thank you very much to everyone for your help.

    PD. The license was check and ok (yellow light)

    BR
    Hector.

    IMG: after 2 hours.PNG

    IMG: config.PNG

    IMG: aconfig.PNG

    IMG: codesys.PNG

    IMG: write error.PNG

    IMG: Ip.PNG

    IMG: log.PNG

     
  • adv

    adv - 2017-10-26

    Just put my raspy in read only mode. Instead of a usb drive i created a 3rd partition and followed the instructions of Mr. Schwellinger.

    Unfortunally i get a licence error for the Profinet Interface (Screenshots after Download, not started!)

    Can somebody help me pls...

    Regards.

    IMG: 26

    IMG: 26

     
  • adv

    adv - 2017-10-26

    still searching in /etc/CODESYSControl.cfg (see screenshot), although i modified the /etc/init.d/codesyscontrol:

    do_start () {
            make_mknod
            export PlcConfigFile=/media/CODESYSControl.cfg
            if [ -d "/sys/bus/platform/drivers/bcm2708_i2c/" ]; then
                    echo bcm2708_i2c.0 > /sys/bus/platform/drivers/bcm2708_i2c/unbind
                    echo 400000 > /sys/module/i2c_bcm2708/parameters/baudrate
                    echo bcm2708_i2c.0 > /sys/bus/platform/drivers/bcm2708_i2c/bind
            fi
            # 1 wire
            modprobe w1-gpio pullup=1
            modprobe w1-therm
            cd /media/
            # Return
            #   0 if daemon has been started
            #   1 if daemon was already running
            #   2 if daemon could not be started
            start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test --chdir $WORKDIR > /dev/null || return 1
            start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --chdir $WORKDIR --startas /bin/bash  -- -c "exec $DAEMON -d $CONFIGFILE >$LOGFILE 2>&1 " || return 2
            # pin codesys to first cpu!
            /usr/bin/taskset -a -p 01 $(cat $PIDFILE);
            sleep 1 && pgrep codesyscontrol > /dev/null && echo "codesyscontrol started" || echo "ERROR: codesyscontrol not started!";
    }
    

    IMG: 26

     
  • adv

    adv - 2017-10-27

    Hello Mr. Schwellinger,

    I used the raspian strecht lite (https://downloads.raspberrypi.org/raspbian_lite_latest).

    After first boot, i used fdisk to resize root partition to 4gig. Then i created a 3rd partition with the remaining memory (i use a 8gig SD) and folled every step mentioned by your previous post...

    Can you explain the first error of my last screen: "cannot find configuration /etc/CODESYSControl.cfg"? Why CODESYS still searching in this directory instead of /media/CODESYSControl.cfg?

    Regards,
    adv

     
  • eschwellinger

    eschwellinger - 2017-10-27

    Hi,
    I'm using it that way(this is a bit tricky, guess there are many better solutions for doing it):
    Install Stretch lite on the SD Card.
    Execute
    read-only-fs.sh

    I use this jumper on GPIO Pins to select on bootup if the whole SD is monted readonly or not.
    - set to rw - insall the CODESYS Runtime via Update Tool
    -license the CODESYS Pi runtime
    then execute the following script once:

    read-only-CDS_after_licenseing.sh
    #!/bin/bash# Use this script to setup the licenses once in RW mode after activateing the licensemkdir /home/pi/cmact_licensescp /var/opt/codesys/cmact_licenses/ /tmp/cmact_licenses/cp /var/opt/codesys/cmact_licenses/ /home/pi/cmact_licenses/rm /var/opt/codesys/cmact_licenses/*rmdir /var/opt/codesys/cmact_licensessudo ln -sf /tmp/cmact_licenses/ /var/opt/codesys/cmact_licenses

    Then add to /etc/init.d/codesyscontrol just before the runtim start

    [b]read-only-CDS.sh[/b]
    #!/bin/bash# CDS Extension make it work this need to be called before CDS runtime startsmkdir /tmp/cmact_licensescp /home/pi/cmact_licenses/* /tmp/cmact_licenses

    This procedure copy the license to rw ram - which is needed to have it up an working.

    BR
    Edwin

    Sure you could only copy new applications to the readonly Pi if you set this Jumper on the GPIO's to have it in RW mode.
    BR
    Edwin

     
  • adv

    adv - 2017-11-07

    Ok... but that's just another solution for read only raspy and don't solve my specific problem.

    Can you just explain, why CODESYS searching in /etc/CODESYSControl.cfg although i modified the /etc/init.d/codesyscontrol...

    I think this is the problem, which has to be fixed, instead of changing the whole setup like you described in your previous post...

    Regards.

     
  • eschwellinger

    eschwellinger - 2017-11-08

    Hi,

    guess you haved missed to change it here:

    BR
    Edwin

    IMG: configfile.jpg

     
  • adv

    adv - 2017-11-08

    no!

    IMG: 08

     
  • adv

    adv - 2017-11-08

    Dont understand the messages (see screenshot):

    IMG: 08

     
  • eschwellinger

    eschwellinger - 2017-11-08

    Hi,
    you need to move the 3S.dat from /etc/ to your new runtime directory... (Location where CODESYSControl.cfg is located)

    BR
    Edwin

     
  • adv

    adv - 2017-11-09

    no, already done!

    EDIT:
    Which files are mandatory for licensing?
    In which directory has these files to be exist?
    Which files/directory has to be writable?

    If i go to PLC-settings (SPS-Einstellungen) to "edit license" I see the license (see screenshot):

    IMG: 09

     
  • eschwellinger

    eschwellinger - 2017-11-09

    hi,
    then you Need to adapt this entry here:

    BR
    Edwin

    IMG: cfg.jpg

     
  • adv

    adv - 2017-11-09

    no i alreade changed this like you mentioned in your previous post:

    Zitat:
    6.add/change to /etc/CODESYSControl.cfg
    [SysFile]
    FilePath.1=/etc/, 3S.dat
    FilePath.2=/media/, .app, .crc
    move CODESYSControl.cfg and 3S.dat to your new location - in my case /media/

    I just change the entry to this:

    Zitat:
    [SysFile]
    FilePath.1=/etc/
    FilePath.2=/media/, .app, .crc, 3S.dat

    Still not working...

    EDIT:
    Missing license is just for Profinet right?!?!?

     
  • eschwellinger

    eschwellinger - 2017-11-09

    [SysFile]
    FilePath.1=/media/, 3S.dat
    FilePath.2=/media/, .app, .crc

    if you see a message in the logger 'missing license file'
    all fieldbus licenses/webvisu is missing.
    You are using 3.5SP11 runtime - right?

    BR
    Edwin

     
  • adv

    adv - 2017-11-09

    yes, 3.5.11.10:

    Package-Info:

    root
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version      Architecture Description
    +++-==============-============-============-=========================================
    ii  codesyscontrol 3.5.11.10    all          V3.5.11.10, Do 10. Aug 12:28:26 CEST 2017
    

    I recognize following and maybe that is a problem. In your instruction you said:

    Zitat:
    5. change the runtime application directory to /media
    sudo nano /etc/init.d/codesyscontrol
    see screenshot
    and change the location of PlcConfigFile
    export PlcConfigFile=/media/CODESYSControl.cfg
    and
    cd /media/

    In the screenshot i put my /etc/init.d/codesyscontrol.
    I changed/added the yellow lines. The script is slightly diffrent then yours (see orange rectangle).
    And i see that WORKDIR still pointing to /var/opt/codesys which is a unionfs (/var_org and /var_rw). So writing an boot image for example will not be stored remanent on the sd card (stored to /var_rw/opt/codesys which is a ramfs)?!?!

    You said:

    Zitat:
    ...
    2. all applications files are redirected to /media (Usb stick)
    you should see Application.app, Application.crc visu directory etc on the USB Stick /media
    ...

    and thats not the case. Maybe soming in the init.d script has changed which i have to pay attention on?!

    IMG: 09

     
  • eschwellinger

    eschwellinger - 2017-11-10

    Hi,

    you mean everything works now (your license - missing license file) is solved?
    I think the missing part is now:
    Since 3.5SP11 the /etc/CODESYSControl.cfg is splittet in an fix part
    CODESYSControl.cfg and Userpart CODESYSControl_User.cfg ... so if you do an download CODESYS add in CODESYSControl_User.cfg
    the name of the Booproject for example.

    [CmpSettings]
    FileReference.0=SysFileMap.cfg, SysFileMap
    FileReference.1=/etc/CODESYSControl_User.cfg

    Maybe you addapt this already.

    'and thats not the case. Maybe soming in the init.d script has changed which i have to pay attention on?!'
    Could you please check if on your /media/PlcLogic Directory after downloading the application you see Application/Application.app and Application.crc?

    BR
    Edwin

     
  • adv

    adv - 2017-11-10

    no, license still dont work!

    Zitat:
    Since 3.5SP11 the /etc/CODESYSControl.cfg is splittet in an fix part
    CODESYSControl.cfg and Userpart CODESYSControl_User.cfg ... so if you do an download CODESYS add in CODESYSControl_User.cfg
    the name of the Booproject for example.

    1.) I changed the WORKDIR variable in the init.d script to /media/var/opt/codesys. Then i created the directorys and copied all files from /var/opt/codesys to it.

    2.) I copied the file /etc/CODESYSControl_User.cfg to /media/CODESYSControl_User.cfg

    3.) I changed the path /etc/CODESYSControl_User.cfg to /media/CODESYSControl_User.cfg in the configuration file /media/CODESYSControl.cfg

    After reboot CODESYS starts normally, but still with the licence issue. Downloading an application successfully creates the directoy /media/var/opt/codesys/PlcLogic/Application and the files "Application.app and Application.crc".
    As expected, in the directoy /var/opt/codesys/PlcLogic nothing is created.

    After 2nd reboot i can go online and the application is running!

    So "only" the license issue is still a problem...

     
<< < 1 2 3 > >> (Page 2 of 3)

Log in to post a comment.