Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

speedcontrols/wifi-configurator

Repository files navigation

WiFi configurator

Firmware for Wemos D1 mini (ESP8266) to configure speed controls (or any other device, supporting simple protocol).

Why?

Some devices like motor speed controls need to be configured. But that happens only once. It would be nice to avoid add display/keyboard into hardware for such task and implement complex menu system in device firmware.

Idea is simple - use cheap ESP8266 board and configure everything via web browser on your mobile or desktop. Just insert Wemos D1 mini into your device, connect to new WiFi network, follow to suggested web page and update params as you need. After config complete - remove Wemos board from your device. Easy!

How to flash firmware

First, you need Wemos D1 mini board, connected via USB to your computer (4MB version).

  1. Install PlatformIO IDE. Follow instructions here. We use PIO for Atom, but PIO for VSCode should be ok too.
    • Make sure you've installed udev rules (linux) or device drivers (windows).
  2. Clone this repo or download via zip archive.
  3. Edit wifi password in /src/firmware/data/config.json5, tune other params if you wish.
  4. Open this project in installed IDE.
  5. Open PlatformIO -> Terminal -> New Terminal

Now type this commands in terminat window:

pio run --target upload
pio run --target uploadfs

How thing work

This happens step-by-step:

  • New access point is created, with captive portal.
  • When user connects to AP, it's suggested to follow captive portal page.
  • User opens suggested page
  • Default web page served, and device configuration requested via UART in json-form format.
  • Form with described fields displayed to user
  • User modifies params and press submit buttons
  • Form fields been sent to defice via UART.

See protocol description for details about UART communications.

Development

  • npm run www - Starts web server to develop web page content. With simple device emulator.
  • npm run build-www - update firmware files with new www content.

In PlatformIO:

pio run --target upload
pio run --target uploadfs

First command compiles sources and upload firmware to board. Second one builds SPIFFS image and uploads it. Also, you can run those commands via IDE menus.

IDE -> PlatformIO -> Monitor - starts monitor to see debug messages.

License

MIT.

About

Firmware for Wemos D1 Mini, to configure speed controls via WiFi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published