Nymea Plugin compilation on Raspberry

Perhaps an alternative to cross-compiling user plugins would be native development and compilation on Raspberry pi4.

Has anyone ever tried this possibility and are there any guidelines on the procedure?

With which distribution would it be better to start between Raspberry pi OS and the Nymea image?

Thanks in advance for any suggestions

I frequently compile quick fixes on my RPi to test them right away.

Just use the normal nymea image (which is a plain Raspberry Pi OS + nymea repo enabled and preinstalled) and do the exact same thing as you’d do on a development Ubuntu machine.

Perhaps, the only change would be that you will likely not use QtCreator on the rpi, so use --no-install-recommends when installing nymea-sdk

sudo apt-get install nymea-sdk --no-install-recommends

Then just follow the manual compilation instructions from the docs.

Wow! Great!!
Now I’ll try!
Many thanks

@mzanetti

A few days ago I tried to follow your advice on, but after doing the first step (git clone https://github.com/nymea/nymea-gpio), when I try to run the first build step
(cd nymea-gpio /builddir
qmake … PREFIX = /usr/)
i get this error:
qmake: could not find a Qt installation of ‘’
What am I doing wrong?
I used an SD Card with Nymea’s Raspberry image on which I enabled SSH and made the IP address static and installed the SDK (sudo apt-get install --no-install-recommends nymea-sdk)
Thanks.
Andrea

https://www.google.com/search?q=qmake%3A+could+not+find+a+Qt+installation+of+‘’&oq=qmake%3A+could+not+find+a+Qt+installation+of+‘’&aqs=chrome..69i57j69i58.473j0j4&client=ms-android-google&sourceid=chrome-mobile&ie=UTF-8

Also, you dont need to build nymea-gpio (unless you want to change the gpio code)

@mzanetti

Wow, faster than the speed of light … :grinning:
I was thinking about such a problem, but I don’t know exactly what is inside the image of Nymea.
I will try as soon as possible.
Thanks
Andrea

The Raspberry pi image is a Raspberry Pi os, build with the same tools as upstream, and then injected the nymea Installation.

@mzanetti

Hi, yesterday I downloaded the new raspberry image (nymea-image-raspbian-buster-2021-11-16.zip) and started the build environment procedure on raspberry.
The step:
sudo apt-add-repository -s “deb http://repository.nymea.io lsb_release -cs main”

fails with error:

aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/buster

The file /etc/apt/sources.list.d/nymea.list already contains the entry:
deb http://repository.nymea.io buster rpi

Is the reference to this repository enough to compile our plugins natively or do you need something else?
Thanks
Andrea

that’s enough… All the -dev libs are in this repository.

If you want to use the dpkg source packages, you can also add “deb-src http://repository.nymea.io buster rpi”

(i.e. that would allow to use “apt-get build-dep nymea” or “apt-get source nymea”)

I was thinking of something like this, thanks for the tip! :+1:

@mzanetti

Hi, I am now able to compile one of your projects without errors.

I tried with nymea-gpio, the steps "qmake … PREFIX = /usr/ CONFIG + = release" and “make” get to the bottom without errors and generate the libnymea-gpio.so.1.0.0 file and its symlinks.

I did not perform the “sudo make install” step to not modify the nymea installation on the raspberry.

Then I took the project of our plugin as it is generated by your wizard for qtcreator and in the folder of the .pro file I tried to run the step “qmake … PREFIX = / usr / CONFIG + = release”, but I get the error:
Project ERROR: nymea development package not found

I think some environment or project variable is missing to tell qmake where to look for modules.

Do you have any suggestions?

Thanks

PS: trying to compile the libnymea-networkmanager project, I get the error:

Project ERROR: Unknown module (s) in QT: bluetooth
make: *** [Makefile: 47: sub-libnymea-networkmanager-make_first] Error 3

Maybe some qt module is missing after installation:
sudo apt install qt5-default