spejsiot/README.md

75 lines
2.5 KiB
Markdown
Raw Permalink Normal View History

2017-02-05 17:39:12 +00:00
spejsiot
========
2015-12-26 23:29:30 +00:00
2017-02-05 17:39:12 +00:00
This is the repository of hswaw spejsiot project, meant to IoTize EVERYTHING easily.
2015-12-26 23:29:30 +00:00
2017-02-05 17:39:12 +00:00
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).
2015-12-26 23:29:30 +00:00
2017-02-05 17:39:12 +00:00
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)
2015-12-26 23:29:30 +00:00
2017-02-05 17:39:12 +00:00
Sample application is present in `switch/` directory. (simple relay device)
2017-02-05 17:43:18 +00:00
For more information take a look at [project wiki page](https://wiki.hackerspace.pl/projects:spejsiot).
2015-12-26 23:29:30 +00:00
2017-02-05 17:39:12 +00:00
Getting started
---------------
2015-12-26 23:29:30 +00:00
2017-02-05 17:39:12 +00:00
# Create relevant environment variables in your ~/.bashrc
cat >> ~/.bashrc <<EOF
# ESP8266 toolchain setup
export ESP_HOME="$HOME/esp-open-sdk"
export SDK_BASE="$ESP_HOME/sdk"
export XTENSA_TOOLS_ROOT="$ESP_HOME/xtensa-lx106-elf/bin"
export PATH="$XTENSA_TOOLS_ROOT:$PATH"
# Sming setup
export SMING_HOME="$HOME/Sming/Sming"
export ESPTOOL="$ESP_HOME/xtensa-lx106-elf/bin/esptool.py"
export ESPTOOL2="$HOME/esptool2/esptool2"
# This is for Wemos D1 Mini and some NodeMCU boards
export ESPPORT="/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0"
export COM_PORT="$ESPPORT"
# Make flashing slightly (4x) faster.
export ESPBAUD=460800
export COM_SPEED_ESPTOOL="$ESPBAUD"
EOF
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
2016-08-30 19:47:42 +00:00
**WARNING!** `Sming.reset();` jumps to (serial) bootloader right after flashing.
This causes OTA to fail with `wdt reset`. External RESET assert is required after
2016-09-10 23:46:42 +00:00
flashing.
2017-02-05 17:39:12 +00:00
Configuration
-------------
Basic node configuration (MQTT broker IP, 802.11 credentials) is present
in `common/common_config.h`.
TODO
----
* Store configuration (credentials, broker IP, maybe endpoints?) in
flash memory
2017-02-05 17:39:12 +00:00
* Docs, ffs