Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node-esp8266-generic: Modernize build environment by adding PlatformIO
- Loading branch information
Showing
6 changed files
with
209 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../node-esp8266-generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$(eval venvpath := .venv) | ||
$(eval python := $(venvpath)/bin/python) | ||
$(eval pip := $(venvpath)/bin/pip) | ||
$(eval pio := $(venvpath)/bin/pio) | ||
|
||
|
||
build: setup-virtualenv | ||
$(pio) run | ||
|
||
upload: setup-virtualenv | ||
$(pio) run --target upload --upload-port=${MCU_PORT} | ||
|
||
setup-virtualenv: | ||
@test -e $(python) || `command -v virtualenv` --python=python3 $(venvpath) | ||
$(pip) install platformio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
.. include:: ../../resources.rst | ||
|
||
.. _node-esp8266-generic: | ||
|
||
####################### | ||
Bienenwaage 2.0 NodeMCU | ||
####################### | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 1 | ||
|
||
---- | ||
|
||
.. tip:: | ||
|
||
You might want to `read this document on our documentation space <https://hiveeyes.org/docs/arduino/firmware/node-esp8266-generic/README.html>`_, | ||
all inline links will be working there. | ||
|
||
|
||
***** | ||
About | ||
***** | ||
A beehive monitor firmware for ESP8266. | ||
|
||
:Author: Stefan Ulmer <ulmi [ät] gmx.de> | ||
|
||
Details | ||
======= | ||
|
||
A beehive monitoring sensor node based on the NodeMCU_ hardware, featuring an ESP8266_ MCU. | ||
Telemetry data is transmitted using MQTT over WiFi or GSM. | ||
The most recent firmware version is available at `node-esp8266-generic.ino`_. | ||
|
||
|
||
******** | ||
Features | ||
******** | ||
- Equipped for NodeMCU_, but suitable to run on any ESP8266_ device | ||
- Sensors: 2x Temperature via DS18B20_, 2x Weight via HX711_, Battery level via ADC | ||
- GSM/GPRS via SIM800/TinyGSM | ||
- WiFi via ESP8266 | ||
- Telemetry via MQTT | ||
|
||
|
||
************* | ||
Documentation | ||
************* | ||
- https://community.hiveeyes.org/t/inbetriebnahme-und-weiterentwicklung-der-firmware-fur-arduino-node-esp8266-generic-node-esp32-generic/3189 | ||
|
||
|
||
************* | ||
Configuration | ||
************* | ||
|
||
General | ||
======= | ||
In order to toggle different features and modes, please have a look | ||
at the list of ``#define`` constants at the top of the sketch. | ||
|
||
Weight scale | ||
============ | ||
Adjust ``SCALE_DOUT_PIN_{A,B}``, ``SCALE_SCK_PIN_{A,B}``, ``Taragewicht_{A,B}`` and ``Skalierung_{A,B}``. | ||
To find out about appropriate values for ``Taragewicht_X`` and ``Skalierung_X``, | ||
please use a weight scale adjustment sketch like | ||
https://github.com/hiveeyes/arduino/tree/master/scale-adjust/HX711. | ||
|
||
:: | ||
|
||
// Scale settings | ||
#define WEIGHT true | ||
float Taragewicht_A = 226743; | ||
float Skalierung_A = 41.647; | ||
float Taragewicht_B = -238537 | ||
float Skalierung_B = -42.614; | ||
|
||
Temperature sensors | ||
=================== | ||
Adjust ``SENSOR_DS18B20``, ``DS18B20_PIN`` and the device addresses ``SensorX``. | ||
|
||
More sensors | ||
============ | ||
Adjust ``SENSOR_BATTERY_LEVEL``. | ||
|
||
WiFi | ||
==== | ||
To configure WiFi SSID and credentials, please use the captive portal | ||
available on X.X.X.X when the device starts in AP mode. | ||
|
||
GSM | ||
=== | ||
To configure GSM/GPRS connectivity, please adjust the ``GSM_ENABLED``, | ||
``apn[]``, ``user[]``, ``pass[]`` and ``simPIN[]`` variables. | ||
|
||
MQTT | ||
==== | ||
To configure MQTT telemetry, adjust the ``MQTT_BROKER``, ``MQTT_PORT``, | ||
``MQTT_USERNAME``, ``MQTT_PASSWORD`` and ``MQTT_TOPIC`` variables. | ||
|
||
Weather Underground | ||
=================== | ||
To enable Weather Underground for getting nearby temperature and humidity | ||
information, adjust ``WUG_API_KEY`` and ``WUG_STATION_ID``. | ||
|
||
|
||
****************** | ||
Build instructions | ||
****************** | ||
:: | ||
|
||
make | ||
|
||
After successfully building it, you will find firmware images at | ||
|
||
- .pio/build/nodemcu/firmware.bin | ||
- .pio/build/nodemcu/firmware.elf | ||
|
||
|
||
******** | ||
Firmware | ||
******** | ||
.. highlight:: bash | ||
|
||
|
||
Clone git repository | ||
==================== | ||
:: | ||
|
||
# Get hold of the source code repository including all dependencies | ||
git clone --recursive https://github.com/hiveeyes/arduino | ||
|
||
# Select this firmware | ||
cd node-esp8266-generic | ||
|
||
|
||
Build | ||
===== | ||
|
||
The build system is based on PlatformIO_. | ||
|
||
Build firmware:: | ||
|
||
make | ||
|
||
Upload to MCU | ||
============= | ||
:: | ||
|
||
export MCU_PORT=/dev/ttyUSB0 | ||
make upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; https://docs.platformio.org/page/projectconf.html | ||
|
||
[platformio] | ||
src_dir = . | ||
|
||
[env:nodemcu] | ||
platform = espressif8266 | ||
board = nodemcuv2 | ||
framework = arduino | ||
|
||
monitor_speed = 115200 | ||
|
||
lib_deps = | ||
OneWire@2.3.5 | ||
HX711@0.7.4 | ||
DallasTemperature@3.8.1 | ||
RunningMedian@0.1.15 | ||
ArduinoJson@^5 | ||
https://github.com/daq-tools/Adafruit_MQTT_Library#maxbuffersize-2048 | ||
tzapu/WiFiManager@^0.16.0 | ||
vshymanskyy/TinyGSM@^0.10.9 | ||
tardate/TextFinder |