BienenWaagenManagerHive scale & app
Quickstart

From scale box to app

Allow about an hour. All services are free for running a hive scale. First choose how your scale box should transmit – the guide then shows only the steps you need.

Not sure whether LoRaWAN reaches your apiary? Check first with tracker mode or on the ttnmapper.org map.

1

ThingSpeak: create a channel all paths

ThingSpeak stores the measurements; the app reads them from there.

  1. Create a free account at thingspeak.mathworks.com.
  2. Channels → New Channel: one channel per scale box. Enable and name fields 1–7:
    FieldContent
    field1 / field2Weight scale 1 / 2 (kg)
    field3Temperature (°C)
    field4Humidity (%)
    field5Battery voltage (V)
    field6 / field7Weight scale 3 / 4 (4 scales only)
    The GPS position automatically goes into the channel's location fields.
  3. Under API Keys note two values: the Write API Key (for the scale box or the Cloudflare Worker) and the Read API Key (for the app).
The free ThingSpeak account allows one entry every 15 seconds and about 3 million entries per year – plenty for many scales.
2

The Things Network: register the device LoRaWAN

  1. Create an account at thethingsnetwork.org and open the Console (cluster Europe 1).
  2. Applications → + Create application, e.g. beescales.
  3. + Register end device → Enter end device specifics manually:
    • Frequency plan: Europe 863–870 MHz (SF9 for RX2 – recommended)
    • LoRaWAN version: LoRaWAN Specification 1.1.0, activation OTAA
    • Let the console generate JoinEUI, DevEUI and AppKey/NwkKey
  4. In the device settings under Join settings enable “Resets join nonces” – otherwise TTN rejects the join after a factory reset of the scale box.
  5. Copy the four keys in MSB format (switch the console display to “msb”) – they go into the scale box in step 5.
  6. Payload formatters → Uplink: choose Custom Javascript formatter and paste the BienenWaagenManager formatter:
3

Cloudflare Worker: connect TTN to ThingSpeak LoRaWAN

The worker is a small program in the cloud: it receives every message from TTN and writes the values into the right ThingSpeak channel. The free plan is far more than enough (100,000 requests per day).

  1. Create an account at cloudflare.com.
  2. Workers & Pages → Create → Worker (“Hello World”), give it a name, e.g. beescales, Deploy.
  3. Edit code: replace the entire content with the template:
  4. At the top, in API_KEYS, enter the Write API Key from step 1 for each scale box. The number on the left is the scale box's Node ID (step 5).
  5. Recommended: set your own password in WEBHOOK_SECRET – then the worker only accepts messages from your TTN.
  6. Deploy and note the worker address, e.g. https://beescales.YOUR-NAME.workers.dev.
4

Set up the TTN webhook to the worker LoRaWAN

  1. In the TTN application: Integrations → Webhooks → + Add webhook → Custom webhook.
  2. Webhook ID e.g. thingspeak, webhook format JSON, base URL = worker address from step 3.
  3. If you set a WEBHOOK_SECRET: add the header X-Webhook-Secret with the same value under Additional headers.
  4. Under Enabled event types tick only Uplink message and save.
52

Set up the scale box in the web UI all paths

  1. Briefly press the button on the scale box – it starts maintenance mode. The display shows the hotspot name, password and address.
  2. Connect your phone or laptop to this Wi-Fi and open 192.168.4.1 in the browser. See what the web UI looks like (demo) ↗
  3. Configuration → Operating Mode: set the Node Identification – 1 for the first scale box, 2 for the second, and so on.
  4. Configuration → Keys & Connection: enter DevEUI, JoinEUI, AppKey and NwkKey from step 2 and save each.
  5. Configuration → Uplink: uplink mode LoRa (TTN→ThingSpeak), save.
  6. Configuration → Keys & Connection: enter Wi-Fi name and password and the ThingSpeak Write API Key from step 1. For 4G also the APN of your SIM card.
  7. Configuration → Uplink: uplink mode WiFi (WLAN→ThingSpeak) or 4G/LTE, save.
  8. Configuration → Schedule: choose a transmission profile – Regular (every 10 minutes during the day) is a good start.
  9. Calibration → Scale Calibration: calibrate each scale with a known weight – the wizard guides you through the two measuring points.
63

Test all paths

  1. In maintenance mode the scale box automatically sends a test message (can be switched off under Uplink → Uplink test).
  2. In the TTN Console under Live data you see “Join accept” and the test message. It is marked as a test and deliberately carries no measurement fields, so it cannot distort your charts.
  3. In the Cloudflare dashboard under Worker → Logs it says “Testpaket, nicht an ThingSpeak” (test packet, not sent to ThingSpeak) – the chain up to the worker works.
  4. An entry with the current measurements appears in the ThingSpeak channel.
  5. Press the button or wait until maintenance mode ends: the scale box measures right away and transmits. This entry appears in the ThingSpeak channel, in the worker log as “Waagenbox 1 → ThingSpeak Entry: …”.
74

Connect the app all paths

  1. Install the app.
  2. Settings → Import: enter your ThingSpeak User API Key (Account → My Profile) – the app lists all channels of the account and adds them with one tap. The user key is not stored.
  3. Alternatively one by one: Add channel with channel ID and Read API Key.
  4. Name your colonies, done. Tip: stick NFC tags on your hives and assign them under Settings → NFC.

Troubleshooting

TTN shows no “Join accept”

Keys swapped or entered in LSB format? Check all four keys in MSB format. Is a gateway in range (ttnmapper.org)? After a factory reset enable “Resets join nonces”.

TTN receives, but ThingSpeak stays empty

Payload formatter pasted? NODE_ID and field1 … must be visible in “Live data”. Does the scale box's node ID match the entry in API_KEYS in the worker? The worker log shows the cause.

ThingSpeak reports “Entry: 0”

Wrong write key or two entries within 15 seconds. When testing, just wait a little.

Wi-Fi uplink fails

The scale box supports 2.4 GHz Wi-Fi only. With weak reception a repeater helps – or LoRaWAN, if available.

Weight is negative or missing

Negative values are deliberately not sent – the scale is then not connected or not yet calibrated.

All settings are described in detail in the manual and in the web UI help (?).