Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andygeiss/esp32
Build your own toolchain to develop, test, build and finally deploy a Golang controller to your ESP32 device.
https://github.com/andygeiss/esp32
esp32 espressif go golang iot iot-device
Last synced: 2 days ago
JSON representation
Build your own toolchain to develop, test, build and finally deploy a Golang controller to your ESP32 device.
- Host: GitHub
- URL: https://github.com/andygeiss/esp32
- Owner: andygeiss
- License: mit
- Created: 2018-01-02T10:56:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T05:21:41.000Z (6 months ago)
- Last Synced: 2025-01-14T16:21:59.422Z (9 days ago)
- Topics: esp32, espressif, go, golang, iot, iot-device
- Language: Go
- Homepage:
- Size: 64.5 KB
- Stars: 87
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ESP32
[![License](https://img.shields.io/github/license/andygeiss/esp32)](https://github.com/andygeiss/esp32/blob/master/LICENSE)
[![Releases](https://img.shields.io/github/v/release/andygeiss/esp32)](https://github.com/andygeiss/esp32/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/andygeiss/esp32)](https://goreportcard.com/report/github.com/andygeiss/esp32)
[![Maintainability](https://api.codeclimate.com/v1/badges/25eafcae9797d5e8a3de/maintainability)](https://codeclimate.com/github/andygeiss/esp32/maintainability)Build your own toolchain to develop, test, build and finally deploy a Golang controller to your ESP32 device.
## Purpose
The [Arduino IDE](https://www.arduino.cc/en/Main/Software) is easy to use.
But I faced problems like maintainability and testability at more complicated IoT projects.
I needed to compile and flash the ESP32 before testing my code functionality by doing it 100% manually.This solution transpiles Golang into Arduino code, which can be compiled to an image by using the ESP32 toolchain.
Now I am able to use a fully automated testing approach instead of doing it 100% manually.## Process
+--------+ +---------+ +----------+
| Test +----> Build +----> Deploy |
+--------+ +---------+ +----------+make make flash
**Important**: The Transpiler only supports a small subset of the [Golang Language Specification](https://golang.org/ref/spec).
## Installation
First download and install the latest [Arduino IDE](https://www.arduino.cc/en/Main/Software) into
/opt/arduino
or changeINO_IDE_PATH
in theMakefile
and necessary packages.- **Ubuntu**:
sudo apt-get install -y bison flex git gperf libncurses-dev make python
- **Manjaro**:
sudo pip install pyserial
Next run the ESP32 SDK-Installation:
make packages
Look at the [examples](https://github.com/andygeiss/esp32/tree/master/examples) for more information.
## Develop, Test and Build
Change the Arduino port to your current settings by changing the
Makefile
:INO_PORT="/dev/ttyUSB0"
Also set the
SSID
andPASS
strings atapplication/device/controller.go
to your WiFi Access Point and start the build process by using:make
Run the binary at
build/device-${ARCH}
to simulate your ESP32 device locally.Connecting to WiFi ...... Connected!
## Deploy
Finally use the following command to deploy the image
device.img
to your real ESP32 device.make flash
**Important**: Please ensure that the current user is in the
dialout
group. Or you will receive apermission denied
.This will create the following output:
2018/08/05 16:04:22 Flashing ...
esptool.py v2.3.1
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Compressed 607456 bytes to 366770...
Wrote 607456 bytes (366770 compressed) at 0x00010000 in 5.9 seconds (effective 816.9 kbit/s)...
Hash of data verified.Leaving...
Hard resetting via RTS pin...
2018/08/05 16:04:22 Done.