This firmware interfaces with sensors and peripherals and connects to the server. It allows users to dynamically add and remove connected peripherals. The created peripherals can then be read from and commanded via the server. The firmware can be flashed with the Flasher or via PlatformIO in VS Code.
[[TOC]]
Below is a list of currently supported peripherals in the firmware. Some may not yet be supported by the web app:
- All analog in / out peripherals
- All digital in / out peripherals
- All PWM peripherals
- All capacitive touch sensors
- BME/BMP280 air sensors
- CSE6677 power sensor
- NeoPixel LED strips
- Atlas Scientific EC / pH / RTD meters
The peripherals page lists additional details for each type.
This is a controller's typical start up sequence:
- Connect to one of the stored WiFi APs
- Sync the local clock from an NTP server
- Connect to the server via a WebSocket
- Register its supported peripherals and task types with the server
- Power on the controller
- Connect to the InamataSetup WiFi
- Your browser should open the captive portal on 192.168.4.1 (check not https)
- Press configure WiFi and enter the details:
- Select WiFi name
- Enter WiFi password
- Enter the controller auth key
- For local dev enter your IP such as
192.168.1.3
. The port used is 8000 - For local dev enter
n
to use HTTP instead of HTTPS
- Press save and possibly reboot the device
The WebSocket protocol is described on the WebSocket API page.
Development is mainly done in a private GitLab repository but changes are automatically pushed to this public GitHub repository.
The Google C++ code style is used. It is recommended to use clang-format to automatically format your code with the provided .clang-format
file.
Clear all flash on the microcontroller with the Erase Flash
command in PlatformIO - VS Code. This will remove saved secrets and temporarily saved WiFi credentials.
To enable more details when debugging, uncomment ENABLE_TRACE
in platformio.ini
. When working with AutoConnect (WiFi setup portal), uncomment the AC_DEBUG
build flag to gain insights there.