Orange PI Zero - snap not updating

Hi,

I’m running an ubuntu core on an Orange Pi Zero board.

I followed these instructions:

https://developer.ubuntu.com/core/get-started/orange-pi-zero#ubuntu-core

I have build a snap and it’s on the store (privately available), on the board when I run “snap refresh” my snap is getting updated. However it doesn’t happen automatically as I expected it.

If I push a new version of my snap to the store, the board doesn’t update it automatically but the board is rebooting on a daily basis (without updating my snap).

So my question is; is it safe to run this image and if so how can I troubleshoot a snap not being updated ?

Thanks for your help
Best regards,
Benjamin

is your snap in devmode?

No, it’s in strict mode

note that updating happens on a looping schedule, it isnt “immediately” usually … did you give the board some time to do the auto-update ?

Well last time the snap has been updated (manually) was:

refresh-date: 5 days ago, at 10:15 UTC

since then the board has rebooted a few times already.

And I pushed an new version of my snap a couple of days ago:

Submission date
2019-04-29 18:35 - 2 days, 19 hours ago

Is it the expected timing ?

no, refreshes should happen a few times during the day IIRC (so while not “immediately” it should definitely update within a day) … reboots do not really matter though.

what is causing the reboot?

can you share the output of snap version, snap changes, and snap refresh --time? Also snap refresh --list.

I don’t know what’s causing the reboot, I’d think the refresh is causing the reboot, is this possible ?

Here’s the requested output:

~$ snap version
snap    2.38.1
snapd   2.38.1
series  16
kernel  4.9-orangepi-zero

~$ snap changes
ID   Status  Spawn                   Ready                   Summary
83   Error   yesterday at 16:24 UTC  yesterday at 16:24 UTC  Install "orangepi-zero-ogra" snap from "edge" channel
84   Error   yesterday at 16:25 UTC  yesterday at 16:25 UTC  Install "orangepi-zero-ogra" snap from "edge" channel

$ snap refresh --time
timer: 00:00~24:00/4
last: yesterday at 13:06 UTC
next: yesterday at 22:24 UTC

~$ snap refresh --list
Name      Version  Rev  Publisher  Notes
voilaiot  0.9      37   benny007   private

oh, wow … i was not aware they are using my gadget snap in their image, i created this one for my developer images at

feel free to try the orangepi image from there instead (it also uses a kernel based on the generic 4.15 Ubuntu tree), note though that it is set up to be completely configured via a single USB connection … (attach the USB cable to your PC and to the pi, wait until dmesg shows you a ttyACM device coming up on the PC, attach via minicom or screen to that device and configure the system)

Thank you Ogra, I’ve installed your image and it’s booting (faster and the wlan iface is working, really nice), I have small issue which I think I can fix myself (hopefully) but the biggest change I can see, is in the “snap interfaces” where I used to have the following interfaces available:

orangepi-zero-gadget:i2c-0         -
orangepi-zero-gadget:i2c-1         -
orangepi-zero-gadget:i2c-2         -
orangepi-zero-gadget:opi-gpio-0    -
orangepi-zero-gadget:opi-gpio-1    -
orangepi-zero-gadget:opi-gpio-10   -
orangepi-zero-gadget:opi-gpio-11   -
orangepi-zero-gadget:opi-gpio-12   -
orangepi-zero-gadget:opi-gpio-13   -
orangepi-zero-gadget:opi-gpio-14   -
orangepi-zero-gadget:opi-gpio-15   -
orangepi-zero-gadget:opi-gpio-16   -
orangepi-zero-gadget:opi-gpio-18   -
orangepi-zero-gadget:opi-gpio-19   -
orangepi-zero-gadget:opi-gpio-198  -
orangepi-zero-gadget:opi-gpio-199  -
orangepi-zero-gadget:opi-gpio-2    -
orangepi-zero-gadget:opi-gpio-3    -
orangepi-zero-gadget:opi-gpio-6    -
orangepi-zero-gadget:opi-gpio-7    -
orangepi-zero-gadget:serial-1      -
orangepi-zero-gadget:serial-2      -

In your image this is not present, can you tell me how to access the GPIO pin with your image ?

Thanks,
Benjamin

the interfaces are a matter of definition in the gadget … i have updated the gadget snap to include the interfaces above … the next refresh should bring them to you …

if you have any issues please let me know, the images are called developer images for a reason and live from the user feedback i get (i dont use them a lot which is for example the reason i didnt add gpio interfaces yet)

one other thing to note is that you probably want to run:

snap refresh core --stable

so you dont get the core snap from daily builds of the snapd master tree (and dont get daily reboots due to that)

EDIT: one other thing … while i added the i2c interface definitions, there seem to be no i2c interfaces enabled in my kernel yet, that will take a bit of work … so currently dont use i2c, there is nothing behind the interface.

Thanks appreciated!

I’ve run a snap refresh and can now see the GPIO.
I have no plan to use the i2c iface at this time, it’s mainly for the GPIO.

I’m still experiencing one issue to run my snap, this is related to accessing a file in my home directory.

Apparmor denies my snap to access a file in my home directory while my snap has a connection to it:

localhost kernel: [ 82.441551] audit: type=1400 audit(1556963490.378:30): apparmor="DENIED" operation="open" profile="snap.voilaiot.iot" name="/home/benny007/voilaiot.cfg" pid=2038 comm="python2" requested_mask="r" denied_mask="r" fsuid=0 ouid=1000

localhost:~$ snap connections
Interface                Plug                              Slot                            Notes
home                     voilaiot:home                     :home                           manual
network                  voilaiot:network                  :network                        -

Any thought what could be wrong with accessing the home directory ?

Cheers,
Benjamin

this is indeed very weird, does /home/benny007/voilaiot.cfg have proper permissions ? (alternatively you could just let your app use “$SNAP_USER_DATA” which points to /home/benny007/snap/voilaiot/current by default … your snap will definitely have read/write permission there … (as long as you executed the app as benny07 at least … snap daemons are always running as root under confinement and fall under slightly different rules))

My SNAP is running as a daemon, deleting the file and recreating as root fixed the issue.

Just have to test the snap refresh but so far it’s looking all good.

Thanks again for your help!

Benjamin

1 Like