Last active
April 1, 2020 20:07
-
-
Save shawalli/1f173866cff23365c7d5f3788c646f5d to your computer and use it in GitHub Desktop.
Set up a Raspberry Pi W Zero with Go and TinyGo, in order to compile and flash to Arduino Uno
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Performed on a Raspberry Pi W Zero running Raspian/Buster | |
# $ uname -a | |
# Linux raspberrypi 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l GNU/Linux | |
export GO_VERSION=1.13.9 | |
export TINYGO_VERSION=0.12.0 | |
# Install Go | |
wget https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz | |
tar -xvzf go${GO_VERSION}.linux-armv6l.tar.gz -C ${HOME} | |
cat <<'EOF' >> ${HOME}/.bashrc | |
# Go | |
export GOROOT=${HOME}/go | |
export PATH=${PATH}:${HOME}/go/bin | |
EOF | |
# Install TinyGo | |
wget https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VERSION}/tinygo_${TINYGO_VERSION}_armhf.deb | |
sudo dpkg -i tinygo_${TINYGO_VERSION}_armhf.deb | |
cat <<'EOF' >> ${HOME}/.bashrc | |
# TinyGo | |
export PATH=${PATH}:/usr/local/tinygo/bin | |
EOF | |
# Install Arduino tools (AVR) | |
sudo apt-get install gcc-avr avr-libc avrdude | |
# Verify Go and TinyGo execution/versions | |
. ~/.bashrc | |
go version | |
tinygo version | |
# Verify Build | |
tinygo build -o blinky1.hex -target=arduino examples/blinky1 | |
# Test end-to-end compile and flash to Arduino | |
tinygo flash -target=arduino -port=/dev/ttyACM0 examples/blinky1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
country=US | |
network={ | |
ssid="" # plaintext SSID | |
psk="" # plaintext password | |
key_mgmt=WPA-PSK | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment