Cross-compilation support

Hello, I am looking for help cross-compiling the Avahi mDNS service. Is there a guide or walk-through I can follow. I have successfully set the service up on a Raspberry Pi, but without apt-get on the Next controller, I’m not sure how to proceed. Thank you https://www.avahi.org/

Hello thekrel, please find the Crosscompile Guide: cURL Library for FTP / SMTP under following link: https://plcnext-community.net/index.php?option=com_content&view;=article&id;=254:crosscompile-guide-curl-library-for-ftp-smtp&catid;=23&Itemid;=176⟨=en If you have additional questions, please don’t hesitate to ask! Best Regards Eduard

Eduard, I have read through the guide, I can connect to the PLC via WinSCP and Putty. I have installed Eclipse, the SDK and the plugin, but I’m not trying to write the program in C++. Where are you executing the compile? The PLCnext doesn’t support the commands you have shown. Is this a Linux VM? Can I compile on an R Pi and then load to the PLC? I am an IEC programmer with experience running Debian on a Raspberry Pi. Josh

Hello Josh, I hope I can help. To answer your questions: - The compile can be executed on either a Windows 64 bit, Linux 64 bit or Linux 32 bit system. This host system must also have gcc and make installed. - At the moment it is not possible to compile directly on the PLCnext platform. - Yes, you could in theory do the compile on a Pi and then load to the target (PLCnext platform). You would need to install the appropriate PLCnext SDK on the Pi - for Debian, that would be Linux 64 bit. Some other points: - When cross-compiling the Avahi code, there may be application-specific compiler switches required - the Avahi documentation should tell you what these are. - The Avahi software may have dependencies - that is, it may require that other “standard” packages be installed on the target. You will need to check if these dependencies are available on the PLCnext platform - since PLCnext is a resource-limited embedded platform, you may find that some dependencies are missing. In this case you will also need to cross-compile these dependencies from source for the PLCnext platform - and if those dependencies also have dependencies, this can very quickly lead to a huge amount of work. Most of the third-party packages that I’ve seen used with PLCnext so far have been ones with few (if any) dependencies - e.g. cURL, libmodbus, libqrencode, rsync, etc. - or where a binary is already available for an arm7 platform (e.g. node.js). I’d be interested to know how you get on with this, and what application you have in mind for Avahi on a PLCnext platform. - Martin.

Martin, I have created a Linux 64 VM using Hyper-V and Ubuntu 18. I installed the SDK, downloaded all the dependencies. Fixed the multitude of errors generated from compiling from scratch. I made it all the way to the sudo ldconfig command on the PLC. Now what? This didn’t install the program. I’m not certain the provided guide is what I need. Avahi is not a library it is a program that starts at runtime to advertise a service. The goal is to have the PLC advertise its HMI webclient to a multi-function display, MFD, that supports mDNS. This is desired to prevent needing to preconfigure the PLC’s IP address, and allow an out of the box MFD to discover and connect to the controller. I think I have everything needed, but the instructions. Do you have an in depth guide? I can get the Avahi service up and running in less than 10 minutes on an R-pi or standard linux distro, please provide me with complete directions for the PLC Next. The only dependency required is GLib-2.58.1. Josh

Hi Josh, Try this:

                                               * Log in to the PLC as a root user.
                                               * Make sure the PLC is connected to the Internet.
                                               * Install Optware-ng for the ARMv7 EABI hardfloat platform:

# wget -O - http://ipkg.nslu2-linux.org/optware-ng/bootstrap/buildroot-armeabihf-bootstrap.sh | sh

                                               * update PATH:

 # export PATH=$PATH:/opt/bin:/opt/sbin

                                               * Install avahi:

# ipkg install avahi

Configuration files will now be in the /opt/etc/avahi directory, and the daemon init script will be in /opt/etc/init.d/ . Hope this helps. - Martin.