Programming-Microcontrollers-and-WebAssembly-with-TinyGo
Programming Microcontrollers and WebAssembly with TinyGo, published by Packt
Required Software
Git
Go
Windows
Toolchain
AVR Dude
GNU Make
Recommended Software
VSCode
VSCode Go Extension
VSCode TinyGo Extension
Required Go packages
go get -u tinygo.org/x/drivers
go get -u github.com/eclipse/paho.mqtt.golang
Required Hardware
Arduino UNO
Arduino Nano 33 IoT
Troubleshooting
Windows
exit status 3221225781
When tinygo flash returns an error like this:
error: failed to flash C:\Users\Enrico\AppData\Local\Temp\tinygo393394635\main.hex: exit status 3221225781
This is most likely due to a missing .dll file.
Install this to get the dll you need: https://sourceforge.net/projects/libusb-win32/
MacOS
If you have problems to find out, under which name the Arduino registers on your computer, try the following command:
ls /dev | grep usb
You are going to see an output like:
/dev/tty.usbmodem132408
This is the device you can put in the --p
flag when using tinygo flash
command
DataSheets
MAX7219
HD44780
ST7735
bme280
MQTT Broker
If you start the broker for the first time run the following command.
docker run -it --name mosquitto
--net=host
--restart=always
-p 1883:1883
-p 9001:9001
-v ~/go/src/github.com/PacktPublishing/Programming-Microcontrollers-and-WebAssembly-with-TinyGo/Chapter07/mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
eclipse-mosquitto
For later starts just use:
docker start mosquitto