Backdrop
Right away when diving into Nymea and trying to understand it and also explaining it to others, I found the need for a simple, dedicated Linux distro in my pocket ready to boot up a Nymea server wherever I am. But this thing would need to be able to save a few things – mainly my nymea setup – so that I didn’t have to always download and setup things each time.
Enter “Persistent” live USB drive technology – woot woot!
Although this wasn’t super hard, it seems some of the current tutorials online are slightly out of date already and also there wasn’t one with a Nymea-focus.
Creating the Persistent USB Drive
The great news is that this tutorial is 90% awesome and 90% up to date. By following this tutorial you are mostly done, however, there are some new things added to mkusb when you hit those options, will cause confusion since they are not options in this tutorial.
Not included much in this demo is what operating system to use for the drive. I would always recommend standard ubuntu since it’s so well supported. You can download the most recent version from ubuntu.com and at the time of this post I’m using Jammy Jellyfish 22.04.1 downloaded .iso file to build mine. You’ll adjust this tutorial to whatever you are downloading of course.
Other than that, there was another thing missing from the tutorial that might cause some pain as it did for me.
In the blog above where the author reaches the step:
p "Persistent live' - only Debian and Ubuntu'
in the wizard, right after proceeding from this step there is a new/surprise step / window that appears offering the following three choices:
- i ‘dus-Iso2usb’, grub-n-iso method
- p ‘dus-Persistent’, classic dus method
- q Quit
I didn’t know what the first option was so I selected it and it was completely foreign to me and no instructions in the blog, so I quit and had to start again.
Turns out that by selecting the Second one ('dus-Persistent', classic dus method
) this will take you so you can continue and follow the blog above so this is the best choice for me for now and probably for you if you don’t know either.
The rest should be fairly straight forward I believe, if I recall.
Post Install Setup
Once you’ve got your Live (and persistent) USB drive setup, it’s time to tweak a few things
Make ubuntu Universal
First, ‘universe’ software is not enabled by default on this live persistent usb setup. This caused some fairly big headaches for me in the beginning so start by making sure all of that is turned on by doing these steps:
- Hit the super key
- Type ‘software’
- Open ‘software and updates’
- Under Ubuntu Software’ tab make sure ‘Community-maintained free and open source software (universe) checkbox is checked
- Reload when requested
Make ubuntu Fresh Like Vegetables
Might as well run the following to make sure all your core packages are updated:
sudo apt update
sudo apt upgrade
(if required)
Do a Test of Persistency
Before you go too far, you might want to run a quick test to see if all your hard work is actually working so far. Simply create a text file or something, save it to your desktop, and power down the computer. Now boot the machine back up on your live drive again and hopefully a) your file you just created is on your desktop and b) all the package updates and such are still there after running sudo apt update
again. If all is good, proceed with mighty confidence!
Install Nymea Core
Now your main ubuntu operating system is setup. It’s time to get Nymea:core on there.
You can and should always follow the official instructions here but I have also provided some extra help here. Some of those commands are probably outdated already on my post, though, so refer back to the official instructions as you go.
After Nymea core is installed, you’ll probably want to test it to make sure it’s working.
A quick test is (as per my other post) run top
command in your terminal and you should hopefully see nymead
show up as a process near the top. All good? Proceed with some real testing then!
Test Nymea Core with Nyema:app
Get the Nymea app on something.
You can read about how to do that in Part 2 of this blog as I bumbled my way through it the first time.
Once the app is installed, try a connection.
All connected?
Try installing a ‘thing’.
Got a ‘thing’ installed? You might want to try a ‘final test of persistency’ if you are paranoid like I am. How I did that was as follows:
- connect app to nymea:core
- Shut down power to Nymea:Core USB drive machine. You should see ‘connecting’ status appear on Nymea app when it loses connection to Core.
- Once powered down, power it back on again to live drive.
If all goes well, your app should pick up your Nymea:core when it comes back alive.
Now you’re setup for easier testing and demonstrating
Bonus Ideas
I really like the app BeeBeep which allows a simple but also robust chat app to find other ubuntu machines on the LAN. This is particularly awesome to install on your Live (and now persistent) USB Nymea machine because if you need to send things like screenshots, code stuff, etc etc, to your main machine, you can do so easily with BeeBeep as it quickly finds all Ubuntu machines on your LAN. A fine person has made this into a snap, too, so you should be able to simply explore and find it in your ubuntu software centre and install it.