Synopsis
This is an example about how things are working in general to get the idea. For demonstration purposes, we use a flexible firmware for ESP8266 talking MQTT, node-wifi-mqtt.ino.
Build and download firmware
http \
--timeout=300 \
--download \
POST \
https://swarm.hiveeyes.org/api/hiveeyes/testdrive/area-42/node-1/firmware.bin \
ref=master \
update_submodules=false \
path=node-wifi-mqtt \
architecture=esp \
makefile=Makefile \
WIFI_SSID_1="the-beekeepers" \
WIFI_PASS_1="wifi-secret" \
MQTT_BROKER="test.mosquitto.org" \
MQTT_USERNAME="hotzenplotz@example.org" \
MQTT_PASSWORD="mqtt-secret" \
MQTT_TOPIC="hiveeyes/testdrive/raeuberhoehle/schatzkammer/data.json" \
MEASUREMENT_INTERVAL="60 * 1000" \
DEEPSLEEP_ENABLED="true" \
SENSOR_HX711="true" \
SENSOR_DHTxx="false" \
LOADCELL_ZERO_OFFSET="53623.0f" \
LOADCELL_KG_DIVIDER="18053"
Success
When successful, the output should be like:
HTTP/1.1 200 OK
Channel-Id: /hiveeyes/testdrive/area-42/node-1/firmware.bin
Content-Type: application/octet-stream
Downloading to "hiveeyes_node-wifi-mqtt_esp-esp8266_20170421T044305_0a30bf43_4db5b00a-2a94-4a24-9676-6817550e229b.bin"
Done. 274.39 kB in 0.00148s (180.46 MB/s)
Result
Proof:
xtensa-lx106-elf-strings \
hiveeyes_node-wifi-mqtt_esp-esp8266_20170421T044305_0a30bf43_4db5b00a-2a94-4a24-9676-6817550e229b.bin \
| egrep -A3 '(the-beekeepers|test.mosquitto.org)'
the-beekeepers
wifi-secret
[...]
--
test.mosquitto.org
hotzenplotz@example.org
mqtt-secret
hiveeyes/testdrive/raeuberhoehle/schatzkammer/data.json
echo $?
0