Skip to content

Python version on ipkg is 3.7.1, PyPlcnextRsc needs at least 3.7.6

Hi everybody !
I would like to use PyPlcnextRsc library on a AXF2152.
I would like to use a Docker to facilitate the deployment of my Python application.
I use IPKG manager as recommended by Phoenix.
(How to install the Optware Package Manager on a PLCnext Control | PLCnext Community Makers)
But with IPKG, the lastest version of python3 is the 3.7.1.
PyPlcnextRsc needs at least 3.7.6
How can I do ?
Best regards,
François

Comments

  • python3 is already installed on the AXC F 2152.
    Firmware version 2022.0.3 includes python version 3.8.11
  • Dear Martin,

    Okay if i was working on the PLC directly.
    In my case, I would like to use a docker for some reasons (for example, deploy on Windows servers and multiple PLC in further steps).

    The DockerFile I have created :
    FROM bash
    RUN wget -O - http://ipkg.nslu2-linux.org/optware-ng/bootstrap/buildroot-armeabihf-bootstrap.sh | sh
    RUN export PATH=$PATH:/opt/bin:/opt/sbin
    RUN /opt/bin/ipkg install python3
    RUN /opt/bin/ipkg install py3-pip
    RUN /opt/bin/pip3 install websockets
    RUN /opt/bin/pip3 install asyncio
    RUN /opt/bin/pip3 install jsonschema
    RUN /opt/bin/pip3 install mysql-connector
    ADD main.py .
    EXPOSE 4444/tcp
    CMD [ "/opt/bin/python3", "./main.py" ]

    In this docker, I would like to add PyPlcnextRsc.

    I tried to create my DockerFile from a Python3.8 image, but in this case, it was impossible to install other libraries with ipkg.
    All images with Python3.8 I found was using apt-get.
    For mysql-connector library, I was forced to do an apt-get update and that command was rejected by the PLC (EOF error)

    Thanks in advance !
  • The standard python base image and apt should work.
    Perhaps the image is too big for the device.
    Are you using a removeable SD card?
  • Yes, I use a removable SD Card.
    I have tried again with another base image and with apk package manager and it seems working.

    For information, my DockerFile :
    FROM alpine
    RUN apk add --no-cache python3
    RUN apk add --update py3-pip
    RUN pip3 install mysql-connector
    RUN pip3 install websockets
    RUN pip3 install jsonschema
    RUN pip3 install asyncio
    RUN pip3 install -U PyPlcnextRsc
    ADD main.py .
    EXPOSE 4444/tcp
    CMD [ "python3", "./main.py" ]

    Thanks for your support.
Sign In or Register to comment.