CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

Raspberry SD card read only mode.
https://forum.codesys.com/viewtopic.php?f=21&t=5890
Page 3 of 4

Author:  Edwin Schwellinger [ Fri Oct 03, 2014 3:57 pm ]
Post subject:  Re: Raspberry SD card read only mode.

Hi,
very good, seems to work reliable.

BR
Edwin

Author:  jvilla [ Sat Nov 01, 2014 9:12 am ]
Post subject:  Re: Raspberry SD card read only mode.

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.

Author:  HTejada [ Wed Apr 19, 2017 11:51 am ]
Post subject:  Re: Raspberry SD card read only mode.

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.
Attachment:
after 2 hours.PNG

Attachment:
config.PNG

Attachment:
aconfig.PNG

Attachment:
codesys.PNG



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.

Attachment:
write error.PNG



- I haven't IPv4 and I can't access to Webvisu form Browser.
Attachment:
Ip.PNG


- I add a screenshot of the log.
Attachment:
log.PNG



Thank you very much to everyone for your help.

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

BR
Hector.

Author:  adv [ Thu Oct 26, 2017 1:36 pm ]
Post subject:  Re: Raspberry SD card read only mode.

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.

Author:  adv [ Thu Oct 26, 2017 1:55 pm ]
Post subject:  Re: Raspberry SD card read only mode.

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

Code:
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!";

}

Author:  Edwin Schwellinger [ Thu Oct 26, 2017 3:32 pm ]
Post subject:  Re: Raspberry SD card read only mode.

Hi,

which readonly system do you use?
a nice approach would be this one (based on strech lite):

https://www.raspberrypi.org/blog/adafruits-read-only/

BR
Edwin

Author:  adv [ Fri Oct 27, 2017 6:13 am ]
Post subject:  Re: Raspberry SD card read only mode.

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

Author:  Edwin Schwellinger [ Fri Oct 27, 2017 8:54 pm ]
Post subject:  Re: Raspberry SD card read only mode.

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 license

mkdir /home/pi/cmact_licenses
cp /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_licenses
sudo 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 starts

mkdir /tmp/cmact_licenses
cp /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

Author:  adv [ Tue Nov 07, 2017 8:31 am ]
Post subject:  Re: Raspberry SD card read only mode.

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.

Author:  Edwin Schwellinger [ Wed Nov 08, 2017 6:55 am ]
Post subject:  Re: Raspberry SD card read only mode.

Hi,

guess you haved missed to change it here:

BR
Edwin

Author:  adv [ Wed Nov 08, 2017 8:01 am ]
Post subject:  Re: Raspberry SD card read only mode.

no!

Author:  adv [ Wed Nov 08, 2017 12:46 pm ]
Post subject:  Re: Raspberry SD card read only mode.

Dont understand the messages (see screenshot):

Author:  Edwin Schwellinger [ Wed Nov 08, 2017 11:20 pm ]
Post subject:  Re: Raspberry SD card read only mode.

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

BR
Edwin

Author:  adv [ Thu Nov 09, 2017 10:23 am ]
Post subject:  Re: Raspberry SD card read only mode.

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):

Author:  Edwin Schwellinger [ Thu Nov 09, 2017 10:33 am ]
Post subject:  Re: Raspberry SD card read only mode.

hi,
then you Need to adapt this entry here:

BR
Edwin

Page 3 of 4 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/