Bienenwaage 2.0 NodeMCU#


Tip

You might want to read this document on our documentation space, 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#

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#

Clone git repository#

# Get hold of the source code repository including all dependencies
git clone https://github.com/hiveeyes/arduino

# Select this firmware
cd node-esp8266-generic

Build#

The build system is based on PlatformIO.

Build firmware:

make

After successfully building it, you will find firmware images at

  • .pio/build/nodemcu/firmware.bin

  • .pio/build/nodemcu/firmware.elf

Upload to MCU#

export MCU_PORT=/dev/ttyUSB0
make upload