I am undertaking development on a PFC200V3 (750-8217) using CODESYS 3.5 SP19 (Patch 7). I would like to start storing data to an SQL database and have tried to follow the support materials provided for using MySQL on the PFC200V2 (eCockpit). I obtained a copy of the Docker image “wagoautomation/mysql”, and tried to install on the PFC200V3. The install completed with a warning that the architecture of the image (ARM) was not the same as the host system (Cortex). I can see the image installed, but it continually restarts (see screeshot).
Is it possible to use MySQL with the 750-8217? If so, I would be grateful for any guidance you can offer. Also, while working through the online materials I started to worry about whether use of Docker on the drive of the 750-8217 might cause wear on the associated memory. Is this likely to be an issue, and if so is it possible to move the container to the SD storage?
Many thanks for your response. I obtained the new docker image and tried to install but the install failed due to insufficient drive space. Is there a way for me to increase the available drive space for the Docker image? For additional reference, I will be using the PFC200 with an SD card where I intend to save the MySQL database.
its good to check free space left on the device: df -h
You can also check if you have any unused volumes:
docker volume ls
to remove volume:
docker volume rm <name>
also check unused images:
docker image ls
and you can delete them:
docker rmi <id or name>
I like to have Portainer for docker management:
you can install this on your device or in other “provisioning” machine and then add “clients” on your devices, so you can deploy container from one place to many controllers
I am just starting out programming on the PFC200v3 and am still not sure exactly what I am looking at. I had aready run df -h and received the following:
I had thought that the docker might be in the volume /home/docker, but that does not seem likely given that the image pull failed (I don’t think the image is anything near 600M).
I also started by confirming that there were no pre-existing docker images.
Following your advice, I checked for unused docker volumes and found one which I deleted. I then attempted to install the sql image again, which failed with the same error message:
Is there a way to increase space on /user/lib ? I have little experience with this - could /user/lib be subject to a maximum file size (less than 130MB) ?
Otherwise, portainer looks promising - many thanks for the tip!
I think the image size for SQL is about 250 MB, but I’m not sure how much total space it needs for the install process itself. Since you have a PFC200 (not a PFC300 like shown by WagoDamRud), the ~900M free you have in /home/docker isn’t surprising.
You can move the directory for Docker from internal flash to the SD card using the method shown on page 12 of this Docker Quickstart: How To: Getting Started with Docker
But first, I fully agree with WagoDamRud, make sure you are not booting the PFC200 from a SD card firmware image!
Main memory (RAM) 512MB
Internal memory (flash) 4096MB
Non-volatile hardware memory 128kbyte
Program memory 32 MB
Data memory 128 MB
I think the df -h command output that I report above approximately adds to 4GB, so that might be the problem. Booting without the SD card installed didn’t change anything. All of the PFC200 units look like they have 4GB of flash memory - not sure what PLC you are using (16.7G would be brilliant).
I will try to move the directory for Docker as suggested by @AdamReeve and get back to you - if that works, then it looks like the PFC200 has too little flash to accommodate MySQL (which is a pain).
Yes, I was talking about the PFC300 the whole time, sorry for the confusion! Its PFC200 G2, so you can’t use official mysql image, because its only for x64 proccessors!
@WagoDamRud - I tried the wagoautomation/mysql container on the first go, and this resulted in me comming to this forum (given that I have an ARMv7, I guess the image was built using the Cortex processor). I will try the first option that you note above and get back to you with results.
Unfortunately, still no luck: the image’s platform (linux/amd64) doesn’t match the host platform (linux/arm/v7):
root@PFC200V3-6CB47F:~ cd /home/dockerimages
root@PFC200V3-6CB47F:/home/dockerimages docker volume ls
DRIVER VOLUME NAME
root@PFC200V3-6CB47F:/home/dockerimages docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
root@PFC200V3-6CB47F:/home/dockerimages docker load -i mysql_image.docker
f2fa9f4cf8fd: Loading layer [==================================================>] 70.69MB/70.69MB
48dc77435ad5: Loading layer [==================================================>] 72.66kB/72.66kB
3da511183950: Loading layer [==================================================>] 163B/163B
683157e9529f: Loading layer [==================================================>] 1.836kB/1.836kB
f8af48bb4e7d: Loading layer [==================================================>] 1.638MB/1.638MB
cc5b4820bbfc: Loading layer [==================================================>] 149B/149B
12dda2505cdb: Loading layer [==================================================>] 694.5kB/694.5kB
f12518219156: Loading layer [==================================================>] 29.17MB/29.17MB
e2f8c6d07b2a: Loading layer [==================================================>] 2.174kB/2.174kB
6a07d221b135: Loading layer [==================================================>] 2.21kB/2.21kB
f077a82947e3: Loading layer [==================================================>] 290B/290B
ac464afc27d8: Loading layer [==================================================>] 1.587kB/1.587kB
Loaded image: biarms/mysql:5.5
root@PFC200V3-6CB47F:/home/dockerimages docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
biarms/mysql 5.5 9a6b109abe1b 5 years ago 304MB
root@PFC200V3-6CB47F:/home/dockerimages docker run -d --restart always --name mysql -p 3306:3306 -v /etc/localtime:/etc/localtime -v /media/sd/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=<user password> -e MYSQL_PASSWORD=<user password> -e MYSQL_USER=<user name> -e MYSQL_DATABASE=<database name> biarms/mysql:5.5
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
f879bdba5be32446d22e3e92802b235f041f2e71208934d71b65feeb2c8f9b4a
root@PFC200V3-6CB47F:/home/dockerimages docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f879bdba5be3 biarms/mysql:5.5 "/usr/local/bin/dock…" 2 minutes ago Restarting (1) 11 seconds ago mysql
Note in the above that the terms in <> were entered with text values. I guess I need to find a docker image for MySQL that is built for ARMv7. Would SQLite be easier to integrate?
@WagoDamRud - entering the command that you suggest returns an error on my system:
<:3306 --platform=linux/arm/v7 -v /etc/localtime:/etc/localtime -v /media/sd/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=wago biarms/mysql
Unable to find image 'biarms/mysql:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address.
See 'docker run --help'.
I think the reason is that the device does not have access to the internet, and the image is designed to check this. I tried to provide access to the internet by attaching the PLC to an open network, but that didn’t help. I should also note that attempting to add reference to the specific version of a locally saved docker image also failed. This seems to be the case whenever you add the –platform option to the command.
After a fair bit of trial and error, the docker image now seems to be up and running. I ended up having to connect the PFC200 to the internet after which it was possible to run the command:
Another issue that I am finding is that the docker container fails to re-connect to the SD card folder after a reboot. Sometimes it will re-connect if I remove and then re-insert the SD card, but in those cases it will then clear the existing content and start with an empty database. I currently have it working on the internal flash memory, which seems to be functioning as expected. For reference, I have been using a Sandisk Extreme card for testing which I formatted using the WBM tool to a single volume named sd in FAT format.