Having a Snap start after another snap

I have a kiosk that I built using Ubuntu-Core, Ubuntu-Frame, and Node-Red on a Raspberry Pi 5. The issue I’m having is that Ubuntu-Frame is starting before Node-Red finishes loading, so I get a blank page that has a try again button.

After about 10-15 seconds you can hit that try again but I was hoping to get the system to come up on its own. How can I get a snap, Ubuntu-Frame, to wait on Node-Red before loading? Do I have to create a custom snap for Ubuntu-Frame?

I know another option is to just add a script to Ubuntu-Core that would restart the Ubuntu-Frame snap after ~15 seconds on reboot, but I was hoping to eliminate the blank page completely.

This is currently not possible, but I guess you could file a wishlist issue for ubuntu-frame to add something like a “startup-delay” config option …

Thank you! I’ll just add that script to restart ubuntu-frame and hopefully they’ll add the startup-delay in the future.

From the description, the problem isn’t Frame starting before Node Red is ready, it is whatever web client you are using to view the Node Red server starting before the server is ready.

Are you using wpe-webkit-mir-kiosk? If so, this sounds similar to:

If that’s not a useful route, could you incorporate a web client (electron?) into your server snap and have control of the timing?

1 Like

Yes, that is the exact issue. I initially tried to create a local html file with a timer and a redirect for wpe-webkit-mir-kiosk, but a local html file isn’t allowed. I’ll have to read through that thread though.

I do know that a simple snap set wpe-webkit-mir-kiosk url=http://localhost:1880/bacp or snap restart ubuntu-frame about 10 seconds after the initial blank page comes up will cause the screen to pop up correctly.

Restarting ubuntu-frame is unnecessary, that only “helps” because wpe-webkit-mir-kiosk also restarts after Frame shuts down. You could restart it directly (but that would still be manual, so not a real solution)