Merle general setup steps:
Device setup and OS install
Install the Go programming language
Create Merle user account
After these steps, the device is ready for Merle development and deployment.
Device Setup and OS Install
Merle can run on any device which supports the Go programming language. The device can be physical such as a Rapsberry Pi or Arduino, or virtual such as a VM running on the cloud. Obviously, only physical devices have access to the physical world (GPIO, I2C, etc). Virtual devices can't access the physical world but they can be proxies for physical devices (see Thing and Thing Prime).
Below are some example device setups for specific physical and virtual platforms. Although these examples all install Debian-based Linux distribution for the OS, Merle's only requirement is the OS supports the Go programming language which means other non-Linux or non-Debian-Linux should work.
(Merle sort of works with TinyGo also, but some major features aren't working, so it's experimental).
Raspberry Pi Setup
Flash a copy of Raspberry Pi OS onto an SD card. The Raspberry Pi OS Lite version is sufficient for all but the most ambitious Merle apps, but if you need the full Desktop, install Raspberry PI OS. Either the 32-bit or 64-bit versions work fine.
It is convenient to configure for headless access to the Raspberry Pi. To do so, in the /boot directory of the SD card, manually add the following:
A userconf.txt file to add a user "merle"
A wpa_supplicant.conf file to automatically setup WiFi
A file named ssh, without any extension
Boot the Raspberry Pi on the SD card. If headless access was configured, and WiFi connected, you can SSH into the Raspberry Pi with user "merle".
Linode VM Setup
Linode is a cloud service hosting Linux VMs. Follow these steps to preparing a linode VM for Merle. This creates a $5/month VM which will run all but the most ambitious Merle apps.
Create an account and log into linode.com.
Create a new Linode (VM)
Select Ubuntu 21.10 distribution
Under Linode Plan, select Shared CPU and select Nanode 1 GB.
Set a root password
Once VM is created and running, log in as root, either using Linode's console LISH or just plain old ssh.
Google Cloud Platform VM Setup
Google Cloud Platform (GCP) is a cloud service hosting Linux VMs, among other things. Follow these steps to preparing a GCP VM for Merle. This will create a sub-$5/month VM which will run all but the most ambitious Merle apps.
Go to Compute Engine
Create an Instance
Under Machine configuration
Machine type: f1-micro
Under Boot disk, change Image to
Operating system: Ubuntu
Version: Ubuntu 21.10
Under Firewall, enable HTTP and HTTPS, if desired
Once VM is created and running, log in from the console using the SSH-in-browser connect option.
Installing Go Programming Language
Go, aka golang, may already be installed. Check the Go version. Merle requires a Go version >= 1.15.
If Go is not installed, try installing Go from the distribution:
Installing Additional Library
Merle needs an additional library installed to support HTTP Basic Authentication. Merle will not compile without this library.
(This is unfortunate...need to investigate how to work around this...maybe there is another Go library for Basic Auth?)
Creating Merle User
We want a non-root user to run our Thing. Create a new user and add user to sudoers. I'm using user merle in this example, but any valid user name will do.
Add user to sudoers
Log in as new user