Managing LoRa Gateway OS from Mender

Hello!

I’ve finally got around to building my own Mender cluster, and I’ve run the bitbake commands in the docs, but the bits I’m missing are:

  1. Where does bitbake put the artifact when it completes successfully?
  2. Is there a special “incantation” in order to get this SD image into a format for Mender?

Any light anyone can shed on this would be most welcome!

This might be helpful: https://github.com/brocaar/lora-gateway-os/blob/master/scripts/loraserver-prepare-deploy

You might need to modify this to your own needs (+ set the correct directory permissions), but I run this from within the Docker container to “export” the build artifacts outside the container :slight_smile:

Perfect, for now that will do nicely!

Thanks!

I’ve now got a CI/CD pipeline up and running with Jenkins building the Yocto image and uploading the results to mender, but I’m having issues overriding the DISTRO_VERSION variable.

As far as I can tell, it’s set in meta/conf/distro/lora-gateway-os.conf and then re-used in various places, however I’d like to be able to set this dynamically to the current LGWOS version + the Jenkins BUILD_ID variable.

I’ve tried to create a new variable with the same name in my local.conf file, but it doesn’t seem to do the trick.

Is there a way to pass this on?

(P.S. if this is better asked in Yocto forums, I’m happy to move this over there instead!)

I’m not sure if it is possible to put this into your local.conf, I remember I had similar issues as I wanted to put the generated image file into a versioned directory which failed because of the load order of configuration files.

I think the Yocto forum might be a better place to ask.

ok, thanks, I’ll wander over there and report back here with the answer! :slight_smile:

I now have this working, and have proposed a minor change at https://github.com/brocaar/lora-gateway-os/pull/14 which should allow everyone to be able to do this in future!

Nearly a year on and I’ve finally got around ot upgrading to Chirpstack Gateway OS from the old loraserver version.

Yocto spits out a number of files that look to be of interest, however none of them appear to be mender artifacts.

@brocaar (with apologies for pinging you directly!) have I missed a script somewhere in the repo that creates the *.mender artifacts for upload?

The files I seem to have available are:

chirpstack-gateway-os-base-raspberrypi3-20200422183519.rootfs.ext4.gz
chirpstack-gateway-os-base-raspberrypi3-20200422183519.rootfs.manifest
chirpstack-gateway-os-base-raspberrypi3-20200422183519.testdata.json

However none of these appear to be the expected *.mender or *.sdimg files from the mender documentation - what have I missed?

**EDIT: ** I’ve also tried Mender-convert against the ext4 file with the following results:

Running mender-convert from-raw-disk-image --raw-disk-image input/chirpstack-gateway-os-base-raspberrypi3.ext4 --mender-disk-image chirpstack-gateway-os-base-raspberrypi3-mender-integ.sdimg --device-type raspberrypi3 --artifact-name chirpstack-gateway-os-base-raspberrypi3-mender-integ --bootloader-toolchain arm-buildroot-linux-gnueabihf --demo --demo-host-ip <MY_IP>
*** Data partition size set to default value: 128MB ***
*** Total storage size set to default value: 8GB ***
1/9 Shrinking raw disk image root filesystem...
Warning: invalid/unsupported embedded raw disk image. Skipping resize...
2/9 Repartitioning raw disk image...
	Detected raw disk image with 0 partition(s).
	Calculating partitions' sizes of the Mender image.
/mender-convert/mender-convert-functions.sh: line 289: 213909504
*
bytes
bytes * 512 : syntax error in expression (error token is "bytes * 512 ")

Fixed it.

You need to use the mender-artifact tool to create a mender artifact from a raw root file system using the *.ext4.gz file.

Once you’ve done this, you can upload the resulting .mender file to the Mender server and roll it out to your devices from there.

Thanks anyway! :slight_smile:

1 Like

Note that for the Gateway OS I have moved to SWUpdate, which turned out to be simpler to maintain (for me) as the Mender meta layer does quite a lot of automatic patching. See also: https://sbabic.github.io/swupdate/swupdate.html.

The concept is the same. SWUpdate can be used together with https://www.eclipse.org/hawkbit/, although I have not tried it (yet).

Heh, yeah, I found that out when trying to compile a Zeus image for Mender!