Install Mongoose OS mos CLI Tool on Raspberry Pi RPi
- Memory Constraint: Unfortunately RPi0s w 512MB of RAM do not have enough free memory (344MB on my RPi0) to compile. So I used an Raspberry Pi 4 with 2GB RAM to compile, then copied the binary over to the RPi0. I haven't tried a Pi3 or Pi2 w 1GB RAM, but they may work too.
- I've only tested this using mos as a command line tool, not the GUI interface.
Build mos Tool
On the RPi...
# install dependencies sudo apt-get install --yes golang build-essential python python-git libftdi-dev libusb-1.0 libftdi1-dev go get github.com/kardianos/govendor # create a working directory mkdir ~/go; cd ~/go # add to ~/.bashrc and reload export GOPATH="$HOME/go" export PATH="$PATH:$GOPATH/bin" export GO111MODULE=on export GOPROXY=https://goproxy.io # clone the mos tool repro git clone --depth 1 https://github.com/mongoose-os/mos.git $GOPATH/src/mos cd $GOPATH/src/mos # build make # test build ./mos help
That's it! The output binary is at
$GOPATH/bin/mos and can be copied to another RPi.
Remember that if you run
./mos by itself, the version of the tool at the time of writing this brings up a user interface, which if you're running in a terminal only, you won't see. So ctrl+c to close it and run it with commands.
If you get an out of memory error during compile, check with
free -h. I know you'll need more than 344MB.
Thanks to Brian Degger for his post on building the mos tool on an RPi that inspired me to bring it current.