Update README
parent
401b6a8108
commit
9a574c2004
89
README.md
89
README.md
|
@ -1,41 +1,74 @@
|
||||||
mqtt-playground
|
spejsiot
|
||||||
===============
|
========
|
||||||
|
|
||||||
This repository is a storage for my mqtt and IoT (( ͡° ͜ʖ ͡°)) playground.
|
This is the repository of hswaw spejsiot project, meant to IoTize EVERYTHING easily.
|
||||||
|
|
||||||
|
This includes simple framework for building appliances compatible with
|
||||||
|
[Homie MQTT convention](https://github.com/marvinroger/homie), based on cheapo
|
||||||
|
ESP8266 SoCs and [Sming](https://github.com/SmingHub/Sming).
|
||||||
|
|
||||||
|
It currently supports most of Homie protcol (with `homie/` prefix replaced
|
||||||
|
by `iot/`), OTA and preliminary SSL support. (provided by Sming itself, currently
|
||||||
|
not enabled)
|
||||||
|
|
||||||
|
Sample application is present in `switch/` directory. (simple relay device)
|
||||||
|
For more information take a look at [project wiki page](https://wiki.hackerspace.pl/project:spejsiot).
|
||||||
|
|
||||||
|
|
||||||
Hardware
|
Getting started
|
||||||
--------
|
---------------
|
||||||
|
|
||||||
Current tests involve NodeMCU ESP12-E/ESP8266 boards. Switch is activated with
|
# Create relevant environment variables in your ~/.bashrc
|
||||||
GPIO0 (FLASH button on NodeMCU) and light is connected to GPIO2, where blue LED
|
cat >> ~/.bashrc <<EOF
|
||||||
is directly connected on ESP-12E module.
|
# ESP8266 toolchain setup
|
||||||
|
export ESP_HOME="$HOME/esp-open-sdk"
|
||||||
|
export SDK_BASE="$ESP_HOME/sdk"
|
||||||
Software
|
export XTENSA_TOOLS_ROOT="$ESP_HOME/xtensa-lx106-elf/bin"
|
||||||
--------
|
export PATH="$XTENSA_TOOLS_ROOT:$PATH"
|
||||||
|
|
||||||
Mosquitto contained in docker is used as a broker. For proper TLS you need to
|
# Sming setup
|
||||||
create self-signed certificate and store its SHA-1 fingerprint in
|
export SMING_HOME="$HOME/Sming/Sming"
|
||||||
`common/common_config.h`.
|
export ESPTOOL="$ESP_HOME/xtensa-lx106-elf/bin/esptool.py"
|
||||||
|
export ESPTOOL2="$HOME/esptool2/esptool2"
|
||||||
ESP8266 code uses [patched slaff's
|
|
||||||
fork of Sming framework](https://github.com/informatic/Sming/tree/patch-1).
|
# This is for Wemos D1 Mini and some NodeMCU boards
|
||||||
(For axTLS support) Set your Wifi configuration in `common/common_config.h`
|
export ESPPORT="/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0"
|
||||||
(used by both `switch` and `light`)
|
export COM_PORT="$ESPPORT"
|
||||||
|
|
||||||
|
# Make flashing slightly (4x) faster.
|
||||||
Thoughts
|
export ESPBAUD=460800
|
||||||
--------
|
export COM_SPEED_ESPTOOL="$ESPBAUD"
|
||||||
|
EOF
|
||||||
Oh my, that's slow.^W^Wquite fast, when patched properly.
|
|
||||||
|
source ~/.bashrc
|
||||||
|
|
||||||
|
# Setup ESP8266 development environment (some additional packages may be needed)
|
||||||
|
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git $ESP_HOME
|
||||||
|
pushd $ESP_HOME && make && popd
|
||||||
|
|
||||||
|
git clone https://github.com/raburton/esptool2 $ESPTOOL2/..
|
||||||
|
pushd $ESPTOOL2/.. && make && popd
|
||||||
|
|
||||||
|
# Setup Sming environment
|
||||||
|
git clone --recursive https://github.com/SmingHub/Sming $SMING_HOME/..
|
||||||
|
pushd $SMING_HOME && make && popd
|
||||||
|
|
||||||
|
# Build test spejsiot app
|
||||||
|
git clone https://code.hackerspace.pl/informatic/spejsiot
|
||||||
|
cd spejsiot/switch/ && make flash
|
||||||
|
|
||||||
**WARNING!** `Sming.reset();` jumps to (serial) bootloader right after flashing.
|
**WARNING!** `Sming.reset();` jumps to (serial) bootloader right after flashing.
|
||||||
This causes OTA to fail with `wdt reset`. External RESET assert is required after
|
This causes OTA to fail with `wdt reset`. External RESET assert is required after
|
||||||
flashing.
|
flashing.
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Basic node configuration (MQTT broker IP, 802.11 credentials) is present
|
||||||
|
in `common/common_config.h`.
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
----
|
----
|
||||||
* Store configuration (credentials, broker IP, maybe endpoints?) in
|
* Store configuration (credentials, broker IP, maybe endpoints?) in
|
||||||
flash memory
|
flash memory
|
||||||
* [!] Fix OTA
|
* Docs, ffs
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
MODULES = app ../spejsiot
|
MODULES = app ../spejsiot
|
||||||
DISABLE_SPIFFS = 1
|
DISABLE_SPIFFS = 1
|
||||||
USER_CFLAGS = -I../common
|
USER_CFLAGS = -I../common
|
||||||
ENABLE_SSL = 1
|
#ENABLE_SSL = 1
|
||||||
RBOOT_ENABLED = 1
|
RBOOT_ENABLED = 1
|
||||||
RBOOT_BIG_FLASH = 1
|
RBOOT_BIG_FLASH = 1
|
||||||
RBOOT_RTC_ENABLED = 1
|
RBOOT_RTC_ENABLED = 1
|
||||||
|
|
Loading…
Reference in New Issue