I can create an artifact and deploy a .zip file, but how do I automaticallly unzip it?

This is for the Raspberry Pi Zero, but I used raspberrypi3 config option when creating. Seems to work with SSH / File upload-download in Troubleshooting. And I can deploy an artifact, but how does one automatically unzip it and reboot the machine?

Looking for the Easiest way. The golden image technique I couldn’t get to work right because my SD card is not partitioned right and I also couldn’t get the USB drive method to work for that.

So what I’d like to do is just upload a file to /home/dev/Desktop/FolderName.zip, unzip it and reboot the machine. Possible?

If I just need to write a file monitor and that is the best way, please let me know, but I’m looking for any tricks that mender provides.

EnjoysMath

EDIT I’m actually not able to even deploy an artifact. It just gets stuck here:

Thanks! :sweat_smile:

Hi @EnjoysMath,

The easiest™ Mender way to get a directory deployed it to use the directory Update Module. A tutorial is provided in this Hub article.

Greetz,
Josef

1 Like

Hello,

I had a similar issue with our module update, and we came up with a solution. First, we performed a deployment with a single-file artifact. This artifact contained a script called “firmware_update,” which was placed in /usr/share/mender/modules/v3/ (I think). The script was used for a custom module update process. Within the custom module update, we decompressed a folder.tar.bz2 and moved its contents to the desired location. Additionally, this update process performed several actions to update our firmware. Once the update was complete, we compressed the folder into a tarball and bz2 format, creating a “firmware_update” artifact, which we then deployed on the devices.

I hope this explanation is clear and helpful.

EDIT: in the script, you can use ArtifactReboot) and reboot
ARP

1 Like

@arp_insens

I am not sure what you mean in yoru paragraph of a possible solution.

My solution is this: since we only need Mender for up to a year because we’re migrating to another processor; to not use all the Mender features. I tried to set up for instance “Golden Image Method” and ran into trouble. I am 100% certain the Troubleshoot > Upload / Download / SSH works.

And I happen to be really good with Selenium webdriver. So I made a Mender OTA Update App that logs in downloads the “Tenant Token Default” method from the Create A Device > Getting Started - this is all done automatically.

So as you can imagine I will be opening up 30 or so SSH connections in a for-loop to upload the file set to the raspberry pi. It’s all visible on the screen as the “bot” is working. I’ve done this kind of code before, so it’s a lot faster for me to complete this script in 1-2 days than to integrate fully with Mender. I’m pretty impressed with it’s simple install method, and it was working. I changed none of my methods on this side, and it doesn’t work with the bot, nor manually copy/pasting the commands over to the Pi over WinSCP.

What’s interesting is what seemed to have triggered this was that I decommissioned one device and it was unable to be put back to a recognized / commisioned device. But ever since I did that I cannot add any devices either in demo mode nor paid mode (Basic). I also tried logging in directly to Mender Dashboard using username password as well as the social auth of GitHub. And those are the only two I can use right now for technical reasons.

I might pay more $ for better support because no response today or update on this bug.

EM

Hello,
well I am sorry to hear that, I once red that someone had the same issue as you and fixed it by commissioning another device(once the other device was commissionned, the previous decomissionned was accessible), if you do find a solution, please let me know, I am interested !
ARP

Edit: I am talking about this topic: