Firmware update command from PLCnext engineer

Hi! First of all! the Team is doing a great job!!! Is there any function for making a firmware update command from PLCnext engineer code? FB? I looked in to PLCnext base LIB, but can only find FB for reading PLC and Firmware info! I know that firmware upgrade is preformed from WBM but it wold be nice if we can to it from code. Or is it possible to make any Linux based script that checks the version and if there is a firmware available to system makes firmware update and then deletes the firmware file? Regards Mathias

Hello Mathias,

I’ll ckeck if it’s possible to update the FW by FB in PLCnEng and give you an answer as soon as possible. It is possible to create a script file for FW-Update, following steps are needed:

                                               1. Create a SSH-Connection to AXCF2152 target
                                               2. Copy the new FW container to "opt/plcnext" folder 
                                               3. Execute command "update-axcf2152" 

After the FW update, the FW container is automatically deleted. If you need help creating the script, please let me know. Best,
Eduard

Hi Eduard! Yes i know hove to update firmware using Putty, but can you give me a example hove this could be done automatically when the Controller starts.(Auto start this script when plc starts) Check new firmware at folder "opt/plcnext” IF so Execute command “update-axcf2152” Delete file Regards Mathias

Hello Mathias,

I have created a example script file for FW-update after reboot and I hope this solution will help you. Please find the script file under following Link: https://phoenixcontact.sharefile.eu/d-s4afb0a8bdbd47fb9 You have to execute the following steps:

                                               1. Copy this script file into "/etc/init.d" folder on your plcnext target
                                               2. Make this file executable via following shell command: sudo chmod 755 /etc/init.d/local.autostart
                                               3. Include this script to the run-level via following command line: sudo update-rc.d local.autostart defaults 80 10

Please note, this script is not tested! Please test and adapt it for your use case. During controller restart, the script will be executed automatically. As restart trigger, you can use the FB “PBCL_SysRestart_1” from “PLCnextBase Library”, please find it in PLCnextStore: https://www.plcnextstore.com Best, Eduard

Hello Mathias, I have provided your request, regarding FB for firmware update to development. The needed functionality is added to requirement for PLCnextBase Lib. Best, Eduard