UP↑SCALE › SCALES & ADAPTERS › INTEGRATION
Scale integration: your LIMS, your own server, your devices and machines
The UP↑SCALE sends its weights and records to your LIMS, ELN or own server - from the app, or by itself in your WiFi network with no app open - and every route on this page comes with free example code (MIT License). For labs that feed the LIMS they have or want a small one of their own, for IT teams, makers and machine builders. Nothing goes through UP↑SCALE or a cloud: every route ends at an address of yours.
- Feed the LIMS or ELN you have - or run a small LIMS of your own
- The UP↑SCALE sends by itself over WiFi, with no app open
- Every chain and every seal checkable at your own server
- Own displays, ESP32 devices and filling machines
In short
UP↑SCALE is one scale app for the scale you already have. This page shows every way to bring its weights and records into your systems: the LIMS / ELN forwarding of the app, the webhook export and the JSON API of the UP↑SCALE in your WiFi network, weight streams, MQTT, Modbus, ESP-NOW devices and filling machines - each with free example code (MIT) and receivers that check every chain and seal by themselves. No cloud in between. The streams over UDP and GET are free, the live weight and tracking are PRO (from 4.43 EUR a month), the records ENTERPRISE & COMPLIANCE (from 13.00 EUR a month).
Every route at a glance
Two things decide the route: who sends - the app while it is open and connected, or the UP↑SCALE by itself in your WiFi network - and what you want to receive: records, the live weight, room values or signals for a device.
| Route | Who sends | Way | Edition | App open? | Security | Example files |
|---|---|---|---|---|---|---|
| LIMS / ELN forwarding of the app | the app | the app to your address; the scale on Bluetooth, USB or the WiFi app link | PROENTERPRISE | yes | https + token | upscale-receiver.*, upscale-to-lims.py, upscale-n8n.json, upscale-node-red.json |
| Webhook export of the UP↑SCALE | the UP↑SCALE | the UP↑SCALE in your WiFi network | PROENTERPRISE | no | TLS, HMAC signature or sealed envelope | upscale-receiver.*, upscale-to-lims.py, upscale-to-object-lock.py, upscale-n8n.json, upscale-node-red.json |
| Archive receiver | the app or the UP↑SCALE | the answer of your receiver: what it saved | ENTERPRISE | as the sender | only from a checked answer; the chain hash must match | upscale-receiver.*, upscale-to-object-lock.py |
| Requests, remote actions, poll | your receiver asks | in the answer of your receiver, or a poll of the UP↑SCALE | ENTERPRISE | no | as the webhook; actions only with their own switch, never in LEGAL MODE | upscale-receiver.* |
| JSON API | your program asks | HTTP to the UP↑SCALE in your network | ENTERPRISE | no | HMAC signature or sealed request | upscale-api.py, upscale-api.sh |
| Weight streams | the UP↑SCALE | UDP broadcast, GET or WebSocket in your network | FREEPRO | no | plain on purpose: anyone in the network can read | upscale-stream.py, upscale-stream.html, upscale-udp.py, upscale-home-assistant.yaml |
| Sensors of the UP↑SCALE | your sensors, Home Assistant, MQTT | the UP↑SCALE polls, subscribes or receives | ENTERPRISE | no | signed or sealed push, encrypted ESP-NOW | upscale-mqtt-publish.py, upscale-espnow-sensor-node.ino, upscale-home-assistant.yaml |
| Independent verification | your receiver or QA checks | live at the receiver, and offline from the stored events | ENTERPRISE | no | hash chains, ECDSA seals, public licence keys | upscale-verify.py, upscale-receiver.* |
| Tracking on your website | the app or the UP↑SCALE | webhook export or LIMS forwarding | PRO | as the sender | as the sender | upscale-tracking-receiver.php, upscale-tracking-receiver.py |
| BLE FOR ALL | the UP↑SCALE | Bluetooth advertising, no connection | FREE | no | plain on purpose | upscale-arduino-ble-weight-monitor.ino, upscale-html-ble-weight-monitor.html |
| WATCH LINK | the UP↑SCALE | an open Bluetooth service | PRO | no | plain on purpose; buttons only on an open scale | the packet table |
| ESP-NOW devices | the UP↑SCALE and your ESP32 | ESP-NOW radio, no router | PRO | no | AES-128-GCM, a key per device | upscale-masterblaster.ino, upscale-espnow-sensor-node.ino |
| USB serial output | the UP↑SCALE | the USB cable | FREE | no | the cable | the line format |
| Filling machines, espresso pumps, sorting gates | the UP↑SCALE | ESP-NOW to an ESP32 relay | PRO | no | AES-128-GCM, a key per device | upscale-masterblaster.ino |
| Scales on the network | the RS-232 dongle (232 / DIY) reads | TCP or Modbus TCP in your network | PRO | no | not encrypted: a network only you control | upscale-tcp-scale.py, upscale-modbus-scale.py |
ENTERPRISE stands for ENTERPRISE & COMPLIANCE and includes everything of PRO. A licence that ends stops its routes at once - no setting is deleted and the records wait on the scale. The forwarding of the app and the webhook export never run at the same time: while the export of the UP↑SCALE is on, the forwarding of the app is off. Every example file is free under the MIT License: save it and change it as you need.
Labs: feed the LIMS or ELN you already have
Most LIMS and ELN take instrument data in one of three ways - and the UP↑SCALE fits each of them, with no cloud in between:
- Import folder or REST API:
upscale-to-lims.pytakes the records of the webhook export or of the app and writes one CSV and / or XML file per record into the folder your LIMS watches - under a temporary name first, then renamed, so the LIMS never reads half a file - and / or calls the REST API of your LIMS with a field mapping you set at the top of the file. It acknowledges a record only after the hand-off worked; a record that comes twice goes to the LIMS once. - Low-code tools: the flows
upscale-n8n.jsonandupscale-node-red.jsontake the events, check the token or the sealed envelope, call the REST API of your LIMS and send the receipt only after the LIMS took the record. Any node - a database, a sheet, a file - can take the place of the LIMS call. The HMAC signature can not be checked there (the tools hand over parsed JSON): use the token or the sealed envelope. - Your LIMS asks: a LIMS that collects by itself reads the records from the JSON API of the UP↑SCALE - or the API client feeds the bridge, as in the last line below.
Three ways to start the bridge (the settings are environment variables, or the defaults at the top of the file):
# CSV / XML files into the import folder of your LIMS (webhook export, modes 2 + 3)
UPSCALE_OUT=folder UPSCALE_FOLDER=/srv/lims/import UPSCALE_SECRET=my-secret \
python3 upscale-to-lims.py
# the REST API of your LIMS (the app forwards with a token)
UPSCALE_OUT=rest LIMS_URL=https://lims.example.com/api LIMS_TOKEN=... \
UPSCALE_TOKENS=app-token python3 upscale-to-lims.py
# your LIMS asks the JSON API, the bridge writes the files
python3 upscale-api.py follow activity | UPSCALE_OUT=folder python3 upscale-to-lims.py --stdin | Setting | What it does |
|---|---|
UPSCALE_OUT | where the records go: folder, rest or both |
UPSCALE_FOLDERUPSCALE_FORMAT | the import folder of your LIMS and the file format: csv, xml or both |
UPSCALE_TYPES | the record types to hand on, e.g. weighing,sales,activity (empty = all; ping, status and the live weight are never handed on) |
LIMS_URLLIMS_TOKEN | the address of the REST API of your LIMS and its token (sent as a Bearer header) |
UPSCALE_MODESUPSCALE_TOKENSUPSCALE_SECRET | the security modes it takes, the token(s) of mode 1 and the secret of the webhook box for modes 2 and 3 |
UPSCALE_DATAUPSCALE_PORT | the folder for its copy of every record and its state files, and the port (8081) |
A typical case: For example, a small QC lab whose LIMS watches an import folder: every finished weighing lands there as a CSV file within seconds, and the LIMS imports it like the file of any other instrument.
What you need: a PC or server in your network with Python 3.8 or newer, the import folder or the REST address of your LIMS; ENTERPRISE for the records (PRO sends the live weight and tracking).
Example files: upscale-to-lims.py, upscale-n8n.json, upscale-node-red.json · Manual: records into your LIMS, LIMS / ELN forwarding
Labs: a small LIMS of your own
Without a LIMS, a receiver and a folder are a good start. The three reference receivers keep every record as JSON lines per type and day, check the hash chains and the seals as the records come in, give the receipt and confirm what they saved. They behave the same and share one data folder - take the language your server already runs:
upscale-receiver.php- PHP 7.4 or newer on any web server with PHP (8.1 or newer for fsync); the data folder outside the web rootupscale-receiver.py- Python 3.8 or newer with its own small web server (port 8080; https with your certificate if you like)upscale-receiver-node.js- Node.js 18 or newer, no packages
Set it up in four steps
- Settings - environment variables, or the defaults at the top of the file:
Setting What it does UPSCALE_MODESthe security modes it takes, e.g. 1,2,3or only3UPSCALE_TOKENSmode 1: the token(s) of the app or of the scale, comma separated UPSCALE_SECRETmodes 2 and 3: the secret you typed into the webhook box of the UP↑SCALE UPSCALE_DATAthe data folder: events, logs, state UPSCALE_STORED0= no "stored" answers: the scale and the app then free their entries as without this receiverUPSCALE_PORTUPSCALE_CERTUPSCALE_KEYPython and Node.js: the port (8080) and, for https without a web server in front, your certificate and key - Start it (Python here; PHP: copy the file into a folder of your web server):
UPSCALE_SECRET=my-secret UPSCALE_MODES=2,3 UPSCALE_DATA=/srv/upscale-data \ python3 upscale-receiver.py - Point the sender at it: LINK → 🔗 Webhook & JSON API → 🔗 Webhook export with this address, the same security mode and the secret - or Settings → 🔗 LIMS / ELN FORWARDING with the https address and the token. 📡 TEST sends a ping.
- Check and back up: let
upscale-verify.pycheck the folder every night (a cron job, below) and back the folder up - it is your record.30 2 * * * python3 /opt/upscale/upscale-verify.py /srv/upscale-data
What you get in the data folder
| File | What it does |
|---|---|
events/<type>/<YYYY-MM-DD>.jsonl | every event as it came, one JSON line each, with the results of the checks added |
chain.log | one line per checked entry and seal: OK, FILLED, BROKEN, GAP, CONFLICT, SIGNED up to N ... |
receiver.log | refused requests (wrong token, signature, replay) and conflicts |
requests/<Device ID>.json | requests for that scale - you write them |
state/ | the chains per scale and kind, the newest signed checkpoints, the first seal key of every scale, the receipts |
JSON lines open in any text editor, go into a spreadsheet and load into a database with one command. When files are no longer enough, let the function that stores an event write into your database as well - the checks stay as they are.
For your quality system this folder is the record: keep it on storage with a backup, add a second copy, run the verify tool and qualify receiver and storage like any other system.
A typical case: For example, a teaching lab without a LIMS runs the Python receiver on an office PC: each day's weighings, sales and log entries are files it can open in a spreadsheet, and the chain check shows at once when one is missing.
What you need: a PC or server in your network with PHP, Python or Node.js, and a backup; ENTERPRISE for the records.
Example files: upscale-receiver.php, upscale-receiver.py, upscale-receiver-node.js, upscale-verify.py · Manual: webhook export, example code
The app sends: LIMS / ELN forwarding PROENTERPRISE
The app posts every event as JSON - one event per POST - to an address of your lab: a LIMS, an ELN, your own archive. It sends while the app is open and connected to the scale - on Bluetooth, the USB cable or the WiFi app link - and only from the browser where you switched it on: switch it on in one app only, e.g. on the lab PC next to the balance. Settings → 🔗 LIMS / ELN FORWARDING.
What it sends
| Event | Edition | What it does |
|---|---|---|
weight | PRO | the live weight, with the line of the serial format in the field serial |
tracking | PRO | start, end and alarms of a tracking run |
points | PRO | the points of a tracking run |
activity | ENTERPRISE | the activity log of the scale, with the raw entry and its chain hash |
legal | ENTERPRISE | the LEGAL MODE store (232 / DIY), sent by the archive device |
sales | ENTERPRISE | every sale the scale saves while the app is connected - also those of other apps - with the record bytes, its chain and the alibi bytes |
stock | ENTERPRISE | stock movements |
sealed | ENTERPRISE | every seal: reports, PDFs, exports, record files, signatures, chain checkpoints - on request with the file itself |
status | ENTERPRISE | routine check, release state, a warning removed, below the minimum weight |
weighing | ENTERPRISE | the weighing log of this app |
programs | ENTERPRISE | batch records, solutions, recipes, pipette runs - on request with the report as a file sealed by the scale |
validation | ENTERPRISE | IQ / OQ runs, every case |
room | ENTERPRISE | the room log of the 📡 sensors of the app |
While the app is closed: the activity log loses nothing (the app catches up from the scale); sales of that time are not sent (they are in the activity log); weighings, the live weight and tracking events only go out while the app is open (tracking: the newest point and missed alarms after the reconnect).
Delivery: one POST at a time, 8 seconds to answer (60 seconds for a sealed file), then it tries again after 5 seconds up to 5 minutes. Up to 1000 events wait in the browser, also over a reload (beyond that the oldest are dropped - they stay on the scale); a yellow line warns at 800 waiting or after an hour without your server. The live weight is never queued. Every event has a fixed id (activity: device and number) - drop doubles by it. 📡 TEST sends a ping.
What your server needs
- https: the browser does not post from the https app to http - an internal certificate authority is fine.
- CORS: allow the origin https://up-scales.com, the headers Content-Type and Authorization and the methods POST and OPTIONS; for an address in your local network also Access-Control-Allow-Private-Network; answer OPTIONS with no body.
- A 2xx answer - anything else is sent again later.
- The token: the app sends it as a Bearer header; the reference receivers also take X-API-Key or a token in the address.
- Room for files: a sealed file comes as base64 and can be a few MB - check limits such as post_max_size of PHP.
CORS in your web server
The reference receivers answer CORS themselves. Behind a web server, or for a receiver of your own, add the headers there:
nginx - in front of a receiver on port 8080:
location /upscale/ {
add_header Access-Control-Allow-Origin "https://up-scales.com" always;
add_header Access-Control-Allow-Methods "POST, OPTIONS" always;
add_header Access-Control-Allow-Headers "Content-Type, Authorization" always;
add_header Access-Control-Allow-Private-Network "true" always;
if ($request_method = OPTIONS) { return 204; }
proxy_pass http://127.0.0.1:8080;
} Apache - in the .htaccess of the receiver folder (mod_headers and mod_rewrite):
Header always set Access-Control-Allow-Origin "https://up-scales.com"
Header always set Access-Control-Allow-Methods "POST, OPTIONS"
Header always set Access-Control-Allow-Headers "Content-Type, Authorization"
Header always set Access-Control-Allow-Private-Network "true"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^ - [R=204,L] n8n, Node-RED - n8n: set "Allowed Origins (CORS)" of the Webhook node to https://up-scales.com; Node-RED: httpNodeCors with the origin https://up-scales.com in settings.js (the notes of the flow have the line).
The offline single-file app sends the origin null - allow it only if you use that app. Check with 📡 TEST: the browser console names a missing header.
The simple webhook
For services without CORS (hook services, chat webhooks) the app can send the JSON as plain text with the token in the address. It can not read the answer, so every event counts as delivered and nothing is sent again - not for records that must arrive.
One event
{"schema": "upscale.event/1", "id": "<device>:weight:1793440000000", "type": "weight",
"device": "<Device ID>", "scale": "UPSCALE420-42149", "firmware": "1.0042", "user": "Anna",
"sent_at": "2026-10-31T10:00:00.000Z",
"data": {"time": "2026-10-31T10:00:00.000Z", "grams": 19.6, "value": 19.6, "unit": "g", "stable": true,
"stability": "settled", "spread_d": 0.15, "d": 0.1, "thing": "",
"serial": "ST,+0000019.60 g\r\n"}} Every event has the same envelope: schema, id, type, device, scale, firmware, user, sent_at and the data of its type. The webhook export of the UP↑SCALE uses the same envelope with "src":"scale", so one receiver takes both.
A typical case: For example, a compounding pharmacy: the app on the bench PC sends every finished batch record with its sealed report to the ELN, and the ELN files it with the batch.
What you need: an https address with CORS, a token and the app open on one device; PRO for the live weight and tracking, ENTERPRISE for the records.
Example files: upscale-receiver.php, upscale-receiver.py, upscale-receiver-node.js, upscale-to-lims.py · Manual: LIMS / ELN forwarding, CORS, simple webhook, batch records
The UP↑SCALE sends by itself: webhook export PROENTERPRISE
In its WiFi session the UP↑SCALE posts its records to your receiver itself - a LIMS, a POS or ERP bridge, your own server - one event per POST, in the same envelope as the app, with no app open. Settings: LINK → 🔗 Webhook & JSON API → 🔗 Webhook export (saved over Bluetooth, used at the next WiFi start).
- PRO: the live weight (when it settles, or every 1, 5 or 60 seconds; never queued), tracking runs and their points, the test event ping, the receipt, every security mode and credential.
- ENTERPRISE & COMPLIANCE: the activity log, sales, the LEGAL MODE store (232 / DIY), status, room values, prints of the balance (RS-232 dongles), seals and chain checkpoints - and the requests, remote actions, the poll and the archive receiver. A ticked kind without its licence is not sent; its records wait on the scale.
Nothing is lost: the activity log, the sales and the LEGAL MODE store wait on the scale - over restarts and Bluetooth times - and go out in order. A kind starts when you tick it - the activity log and the LEGAL MODE store with the archive receiver ticked: from their oldest entry that is not archived yet; older entries come with a request.
Delivery: one event at a time, 8 seconds to answer, then it tries again after 5 seconds up to 5 minutes. Delivered means a 2xx answer (in modes 2 and 3 only with a correctly signed or sealed answer). A record refused five times with a 4xx (not 401, 403, 408 or 429; in modes 2 and 3 only a signed or sealed 4xx counts) is skipped: it stays on the scale and the activity log notes it. After 24 hours without a delivery the receiver counts as lost: one log line, a try every 30 minutes and the button RETRY NOW; every app shows a warning at the next connection. Weighing is never blocked, also not in LEGAL MODE.
Three security modes
| Mode | How | Your receiver |
|---|---|---|
| 1 TLS | https only; the certificate is checked against the list of public certificate authorities in the firmware | needs a certificate of a public authority - a self-signed one is refused |
| 2 HMAC | every request signed with HMAC-SHA256 over time, nonce and body; also on plain http | checks the signature and signs its answer over the same nonce - also empty and error answers |
| 3 sealed | the whole event encrypted with AES-256-GCM, the key made from the secret; also on plain http | decrypts, refuses an n not higher than the last one of that Device ID, seals its answer |
The headers of mode 2 and the envelope of mode 3:
X-Upscale-Time: <time>
X-Upscale-Nonce: <nonce>
X-Upscale-Signature: sha256=<hex of HMAC-SHA256(secret, time "." nonce "." body)> {"schema":"upscale.sealed/1","device":"<Device ID>","n":<n>,"ct":"<base64>"}
ct = AES-256-GCM of the event + the 16-byte tag
key = SHA-256(secret)
nonce = Device ID (6 bytes) + n (6 bytes, little endian)
answer = {"schema":"upscale.sealed/1","n":<n>,"ct":"<base64>"}, nonce (Device ID XOR 0xFF) + n Plain http only with modes 2 and 3. n only goes up (a counter times 65536 plus a random part per start). PHP receivers: write sealed answers with JSON_UNESCAPED_SLASHES (else json_encode writes every slash of the base64 text as \/), and with Apache and PHP-FPM add CGIPassAuth On, or the Authorization header gets lost.
Credentials
None, a Bearer token, X-API-Key, a header of your own, Basic, a token in the address, OAuth2 client credentials (https only; renewed before it expires or after a 401) - or a registration with a pairing code: REGISTER NOW posts the Device ID, the name of the scale, the firmware and the code, and your server answers with the token. On plain http only none: the signature or the seal is the credential there. Secrets and tokens are stored on the scale, set only over USB, the WiFi link or encrypted Bluetooth, and never go back to an app; 🗑 FORGET CREDENTIALS deletes them.
POST {"device":"<Device ID>","scale":"<name>","firmware":"<version>","code":"<pairing code>"}
-> {"token":"<token>"} (optional: "url", "id") The events and their fields
Records have the id <Device ID>:<type>:<number> (a seal: the number of its log entry; tracking events: the run and the point or alarm). After a power cut a few events may come twice - drop them by id. An activity entry:
{"schema":"upscale.event/1","id":"a1b2c3d4e5f6:activity:1201","type":"activity",
"device":"a1b2c3d4e5f6","scale":"UP↑SCALE (DIY) #76439","firmware":"1.01312","user":"",
"sent_at":"2026-11-28T08:15:02Z","src":"scale",
"data":{"seq":1201,"time":"2026-11-28T08:15:01Z","epoch":1795853701,"kind":11,"detail":0,
"user_id":2,"extra":0,"value":12.5,"aux":4711,"raw":"<base64 of the 16 bytes>","chain":"<64 hex>"}} | Event | Fields |
|---|---|
activity | seq, time, epoch, kind, detail, user_id, extra, value, aux, raw, chainraw = the 16 bytes of the entry (base64), chain = the hash after it |
sales | seq, sale_id, day, time, thing, pieces, grams, revenue, …, chain, raw, alibi_rawevery value of the sale, its 8-byte chain, the record bytes as stored (raw) and, with an alibi number, the alibi bytes (alibi_raw) - so your receiver can recompute the chain |
legal | number, label, time, kind, …, raw, chainthe store number (UP-000123), time, kind, the balance line as it came, tare, value, the 48 raw bytes and the chain |
print | seq, time, epoch, value_g, stable, flags, lines, source, user_id, legal | fingerprint, text, raw, chainprints of the balance on the RS-232 dongles: the whole print text, its source (cable, network, USB) and the LEGAL MODE number - or a fingerprint of the text; raw and chain of its activity line |
trackingpoints | start, stop and alarms with their kind and point; points in batches of up to 16, each as [number, time, gross, net]; the state of the run - in detail on the tracking page |
sealed | seal_kind, kind, log_seq, time, number, seal, cert, pk, has_certificateactivity_upto, activity_h, activity_oldest, sales_upto, sales_chain (kind 4)legal_upto, legal_h, legal_oldest (kind 5) · sha256 (kinds 1-3)the seal (144 bytes as hex), its certificate and the public key; chain checkpoints and store seals also decoded, for convenience - a receiver decodes the seal bytes itself. Seals an app asks for while the export runs (sealed ticked) wait in a small list (4 at most, lost on a restart - the seal is inside the file too); chain checkpoints come with activity or sales ticked, store seals with legal ticked. |
reply | request, id, ok, … | errorthe answer to a request of your receiver |
weightstatusroom | the live weight; status (online, once per session); room values that cross a limit |
The answer of your receiver
{"ack":"a1b2c3d4e5f6:sales:1234","ref":"R-000123","requests":[{"get":"status","id":"s1"}]} All optional: ack confirms the event id, ref is your receipt (up to 36 characters) - the webhook card and the status page show it, and for a sale or a LEGAL MODE entry the activity log notes "receipt from the receiver". requests asks the scale for more (requests), stored confirms what you saved (archive).
What your receiver needs
- reachable from the network of the scale (firewall)
- https with a certificate of a public authority - or HMAC / sealed on http in your own network
- a 2xx answer; in modes 2 and 3 a signed or sealed answer, also for empty and error answers
- mode 3: the replay check of n per Device ID
- doubles dropped by id, the records on storage with a backup
Qualify the receiver and its storage with the device qualification and the validation pack. Manual: records to the receiver (R-1 to R-8), validation pack, WiFi chapter
A typical case: For example, a 232 dongle on a verified balance in LEGAL MODE sends every store entry to the pharmacy server - also at night with no app open; while the server is down, the entries wait on the dongle.
What you need: the UP↑SCALE in your WiFi network and a receiver it can reach; PRO for the live weight and tracking, ENTERPRISE for the records.
Example files: upscale-receiver.php, upscale-receiver.py, upscale-receiver-node.js, upscale-to-lims.py, upscale-to-object-lock.py, upscale-n8n.json, upscale-node-red.json · Manual: webhook export, refused records, receiver lost, prints
Archive receiver: free the log only for what you saved ENTERPRISE
The activity log and the LEGAL MODE store have limited room on the scale. With the archive receiver (ticked by default) your receiver says what it saved, and the UP↑SCALE - or the archive app with "Free only what the receiver confirmed as saved" - may then reuse the room of those entries. A 2xx only means delivered; saved means this answer:
{"stored":{"type":"activity","upto":1234,"chain":"<64 hex: H after entry 1234>"}}
activity H(n) = SHA-256( H(n-1) | n as uint32 little endian | the 16 bytes of entry n )
H before entry 0 = 32 zero bytes
legal H = SHA-256( H before | the 48 bytes of the entry ) N is the newest entry up to which your receiver wrote every entry, and chain the hash it recomputed itself. The scale takes it only from a checked answer (https with its certificate check, or signed or sealed) and only when the hash is its own hash after N. The reference receivers answer stored after the data is on the disk; UPSCALE_STORED=0 switches it off. With no archive device yet, the first confirmed save makes your receiver the archive device - the rules and the buttons are in the manual.
A second copy with a retention lock
upscale-to-object-lock.py keeps every record as one object in S3-compatible storage with object lock: until the retention date the provider refuses to delete or overwrite it. It acknowledges only after the upload (ref = the version id), finds doubles in the bucket, answers stored and can copy the daily files of the Python receiver into the bucket. It needs boto3. Try it with a short retention first: the strict lock mode of a provider can not be undone, not even by you.
Any append-only storage of your own works the same way - an append-only file on a second server, a bucket with a retention lock: with the chain hashes in the records, a later change shows. Keeping the storage of your receiver safe and backed up is your job.
A typical case: For example, a lab keeps a second copy of every record in storage with a retention lock - and the activity log of the scale never runs full, because the receiver confirms what it saved.
What you need: ENTERPRISE, a receiver that answers stored, and storage with a backup.
Example files: upscale-receiver.php, upscale-receiver.py, upscale-receiver-node.js, upscale-to-object-lock.py · Manual: archive receiver, free only what the receiver confirmed
Requests, remote actions and the poll ENTERPRISE
Your receiver can put up to four requests into any answer, each with an optional id that comes back. The UP↑SCALE answers with an event reply, or sends the records again as normal events:
{"get":"weight"} {"get":"status"}
{"get":"things","from":0} {"get":"sensors"}
{"get":"activity","since":1200} {"get":"legal","since":1}
{"get":"sales","day":"2026-11-27"} Remote actions have a switch of their own (off by default): tare, zero (on pages where TARE tares) and a line in the activity log with the first 4 bytes of the SHA-256 of your text. Every action is logged with the receiver as its source; it is refused while the switch is off, in LEGAL MODE and on other pages.
{"do":"tare"} {"do":"zero"} {"do":"log","text":"batch 42 started"} The poll: with nothing to send, the UP↑SCALE can ask for requests itself ("Ask the receiver for requests", off by default, every 15 seconds to 1 hour) - answered like a POST:
GET <address>?device=<Device ID>&poll=1 (HMAC-signed)
GET <address>?device=<Device ID>&poll=1&n=<n>&t=<tag> (sealed: t = GCM tag of an empty text, hex) In the reference receivers you write a JSON list into requests/<Device ID>.json; up to four of them go out with the next answer, and what went out is gone from the file.
A typical case: For example, the LIMS writes "batch 42 started" into the activity log of the scale and asks for yesterday's sales.
What you need: ENTERPRISE and the webhook export; remote actions switched on for tare, zero and log lines.
Example files: upscale-receiver.php, upscale-receiver.py, upscale-receiver-node.js · Manual: requests
JSON API: your programs ask the UP↑SCALE ENTERPRISE
Your programs - a LIMS, a POS, a script - ask the UP↑SCALE at http://<address>/api/... with no app open. Switch: LINK → 🔗 Webhook & JSON API → 🔌 JSON API & weight streams → JSON API ON. It uses the secret and the security mode of the webhook box (TLS there means HMAC here: the scale has no certificate of its own).
| Request | What it does |
|---|---|
GET /api/status | without the secret: name, Device ID, page, security mode; signed: the full status |
GET /api/nonce | without the secret: a nonce for one request, valid 60 seconds |
GET /api/weight | the weight |
GET /api/sensors | the values of the sensors of the scale |
GET /api/things?from=0 | the THINGS, page by page |
GET /api/activity?since=1200&count=20 | activity log entries from a number on |
GET /api/legal?since=1 | LEGAL MODE store entries (232 / DIY) |
GET /api/sales?day=2026-11-27&from=0 | the sales of a day |
GET /api/prints?since=1200 | prints of the balance (RS-232 dongles) |
POST /api/do | tare, zero or a log line - only with remote actions on, never in LEGAL MODE |
POST /api/sensor?source=1 | room values from your sensor (works with the API off too) |
Signed requests (HMAC)
X-Upscale-Signature: sha256=hex(HMAC-SHA256(secret, time "." nonce "." METHOD " " path-with-query "." body)) With the headers X-Upscale-Time, X-Upscale-Nonce (from /api/nonce, used once) and X-Upscale-Signature; the answer is signed like a webhook answer. Ten failed checks in a minute close the API for a minute. CORS is allowed, so web pages in your network may call it.
Sealed requests
Sealed, every request is a POST with the envelope of mode 3 and the n of /api/nonce; the nonce of the cipher is the Device ID XOR 0x0F + n, the answer uses the Device ID XOR 0xF0.
Records page by page
{"ok":true,"type":"activity","from":1200,"events":[...],"next":1215,"more":true} As many events as fit into one answer (count: 20 by default, 50 at most), each in the webhook envelope with raw and chain; ask again from next while more is true. The Python client does it for you, also as follow (every new entry); the shell script signs with curl and openssl:
python3 upscale-api.py --host 192.168.1.50 --key my-secret weight
python3 upscale-api.py activity --since 1200 --count 20
python3 upscale-api.py sales --day 2026-11-27
python3 upscale-api.py follow activity
UPSCALE_HOST=192.168.1.50 UPSCALE_KEY=my-secret sh upscale-api.sh get "/api/activity?since=1200&count=20" A typical case: For example, a script at 6 in the morning collects the new activity entries of every scale in the building and files them for the day.
What you need: ENTERPRISE, the secret and a program in your network (Python 3.8, or curl and openssl).
Example files: upscale-api.py, upscale-api.sh · Manual: JSON API
Weight streams: the live weight for programs and displays FREEPRO
Plain on purpose, like BLE FOR ALL: anyone in your network can read them. Switch them on in LINK → 🔗 Webhook & JSON API → 🔌 JSON API & weight streams; the status page lists what is on, and mDNS announces them (upscale-<number>.local).
| Stream | Edition | What it does |
|---|---|---|
| UDP broadcast | FREE | one datagram per weight, port 20420 or yours; does not pass a router |
GET /api/weight | FREE | the weight now, without the secret |
ws://<address>/stream | PRO | the weight as it comes, up to 2 readers; tare and the coffee timer go back - not while a master password locks the scale, never in LEGAL MODE |
Three formats for the WebSocket and the UDP broadcast (GET always answers JSON): the 10-byte weight packet of the Decent Scale protocol, the line of BLE FOR ALL, or a JSON line (ENTERPRISE adds a line per print of the balance). Rate: on every change (at most 20, at least 1 a second) or 1, 5 or 10 a second.
GET /api/weight -> {"ok":true,"grams":12.34,"stable":true,"unit":"g","time":...,"page":0}
JSON line -> {"w":12.34,"u":"g","s":1,"t":<time>,"ms":<since start>,"d":"<Device ID>"}
print line -> {"print":<seq>,"w":...,"u":"g","s":1,"t":...,"up":<LEGAL MODE no.>,"d":"<Device ID>"}
WebSocket back -> tare | timer start | timer stop | timer reset (or Decent Scale bytes 03 0F, 03 0B 03/00/02) python3 upscale-stream.py 192.168.1.50
python3 upscale-stream.py upscale-12345.local --send tare
python3 upscale-udp.py --port 20420 Decent, Decent Scale and DE1 are names of Decent Espresso International Ltd. UP↑SCALE is not affiliated with or endorsed by Decent Espresso.
A typical case: For example, a big weight display at a packing table, or a bridge to a PLC that reads the weight ten times a second.
What you need: the UP↑SCALE in your WiFi network; UDP and GET are FREE, the WebSocket is PRO. The HTML page opens from a file or from a http page in your network - an https page may not open ws://.
Example files: upscale-stream.py, upscale-stream.html, upscale-udp.py, upscale-home-assistant.yaml · Manual: weight streams
Sensors of the UP↑SCALE: room values, limits, air buoyancy ENTERPRISE
Up to 4 sources with up to 5 values each (temperature, humidity, air pressure and two of your own) - LINK › 🌡 Sensors of the scale. Four ways to bring them in:
- HTTP JSON: the UP↑SCALE asks an address every 10 seconds to 1 hour and reads each value by its JSON path (Basic auth in the address; no digest auth).
- Push: your device posts to /api/sensor, signed or sealed like the API - a device that can not sign gets a bridge such as Node-RED in front.
- MQTT: a topic of your broker (mqtt:// or mqtts://, user and password, wildcards allowed), JSON with paths or a plain number; the scale only subscribes (it publishes nothing) and also takes the retained message when it connects.
- ESP-NOW node: an ESP32 with a sensor sends a sealed frame; values outside -40 to 125 °C, 0 to 100 % RH or 300 to 1200 hPa are dropped:
frame 0xE5 | counter (8 bytes, LE) | AES-128-GCM of 22 bytes | tag (16 bytes)
plain 0x53 | mask | 5 floats (temperature, humidity, pressure, value 4, value 5)
nonce 'D' 0 0 0 + counter AAD 0xE5 'D' A room limit that is crossed writes a line into the activity log (at most every 10 minutes) and sends the webhook event room; back inside writes one more line. "Keeps the air buoyancy correction up to date" sets the air density after a change of 0.2 % (at most every 15 minutes, never during a recipe or solution, not under the strict audit trail; a log entry each time). The values also go into the webhook events, the requests, GET /api/sensors, the status page and the 📡 sensors of the app.
Something else: the 📡 sensors of the app (Modbus RTU, HTTP JSON, MQTT and Bluetooth sensors, read by the app) - see LIMS and room sensors.
A typical case: For example, Home Assistant publishes room temperature, humidity and air pressure to MQTT: the UP↑SCALE keeps its air buoyancy correction up to date, and a crossed room limit lands in the activity log and at your server.
What you need: ENTERPRISE and the UP↑SCALE in your WiFi network; a broker, Home Assistant, a sensor with HTTP JSON or an ESP32.
Example files: upscale-mqtt-publish.py, upscale-espnow-sensor-node.ino, upscale-home-assistant.yaml, upscale-api.py, upscale-api.sh · Manual: sensors of the scale, sensors of the app
Independent verification: check every record at your server ENTERPRISE
Your receiver can check every record by itself - with nothing but the stored events and the public UP↑SCALE licence keys, without trusting the app, the browser or the transport token. Three things make that possible:
- Hash chains: every entry of the activity log, the LEGAL MODE store and the sales log carries the hash of the one before. The reference receivers recompute every link - also of an entry that fills a gap later, against both neighbours - and write OK, FILLED, GAP or BROKEN into chain.log; the same id with other content is a CONFLICT.
- Seals: every sealed report, file, signature and checkpoint carries an ECDSA P-256 signature of the UP↑SCALE and, with a licence, a certificate of its key signed by UP↑SCALE. The receivers check the signature, check the certificate with the public licence keys and check that seal, certificate and event name the same Device ID; the first key of a scale is noted and a changed key is reported loudly.
- Chain checkpoints (seal kind 4): the UP↑SCALE signs the heads of its own chains - the newest activity entry with its hash, the newest sales record with its chain; a store seal (kind 5) does the same for the LEGAL MODE store. In the webhook export the UP↑SCALE makes them by itself (once after the start, then every 10 minutes or after 256 new entries, when something new is there); the app asks for one after an archive round and right before it saves a record file. A receiver that matches a checkpoint writes "SIGNED up to N": every entry up to N that links to it is covered by the signature. A later checkpoint covers everything before it, so losing one does no harm.
- Pairs with the LEGAL MODE store (RS-232 dongles in LEGAL MODE): a sale or a print of the balance carries the number of its LEGAL MODE entry (e.g. UP-000123), and the entry holds the sale, the value used and the time. The reference receivers match every pair by itself - the number, the sale, the weight and the time must fit - and write
linked,waiting(the other half has not come yet),MISMATCHorentry missing.
The receivers write the result of every check next to the event and into chain.log. Without the Python package cryptography the Python receiver still checks the chains and logs every seal as not checked.
The formulas and the checkpoint
activity H(n) = SHA-256( H(n-1) | n as uint32 LE | entry, 16 bytes ) H before 0 = 32 zero bytes
sales c(s) = first 8 bytes of SHA-256( c(s-1) | record without its last 8 bytes | alibi bytes )
c before 1 = 8 zero bytes
legal H = SHA-256( H before | entry, 48 bytes )
seal 80-byte payload + ECDSA P-256 signature over SHA-256(payload), r|s = 144 bytes
kind 4 [0] 1 [1] 4 [2-7] Device ID [8-11] seq of its own log entry [12-15] time
[16-19] N = newest activity entry covered [20] user (0 = by itself) [21] 0 app / 1 webhook
[22-25] S = newest sales record [26-33] sales chain after S
[42-73] activity H after N [74-77] oldest activity entry kept
kind 5 [16-19] newest store number [42-73] its H [74-77] oldest number kept The offline check
upscale-verify.py reads the data folder of a receiver - a copy from your backup is fine - and checks it again, offline and without writing into it: it rebuilds every chain from the raw entries, checks every seal and checkpoint and prints per scale and kind the first and last number, gaps, broken links, conflicts, the range covered by a signed checkpoint and what came after the newest one (not covered yet). The exit code is 0 only when nothing is broken, conflicting or badly sealed (gaps alone give 0) - so a cron job or a CI step can raise the alarm.
python3 upscale-verify.py /srv/upscale-data
python3 upscale-verify.py /srv/upscale-data --device a1b2c3d4e5f6
python3 upscale-verify.py /srv/upscale-data --all | Result | What it does |
|---|---|
BROKEN | an entry does not give the hash the chain says - it, or the one before it, was changed - or a checkpoint signed another hash than the entries give |
CONFLICT | the same id came with other content, or two entries with the same number |
gap | numbers that never came - ask the UP↑SCALE for them with a request while it still keeps them |
signed | every entry in the range is covered by a seal of the UP↑SCALE: its chain links up to the hash the UP↑SCALE signed |
not covered yet | the entries after the newest checkpoint - the next checkpoint covers them |
MISMATCH | a sale or print and its LEGAL MODE entry do not fit: another sale, weight or time |
What it shows - and what it does not
- A seal shows that the data is unchanged since the UP↑SCALE signed it, and which UP↑SCALE signed it. The seal key is made on the UP↑SCALE itself and never leaves it, and its certificate, signed with the licence key of UP↑SCALE, ties it to this one device: a change of the data becomes visible.
- Values the app computes or adds - the weighing log of the app, programs, validation runs, its room log - are only as trustworthy as the device that sent them; where they come with a sealed report, its seal is checked.
- The checks are tamper-evidence: they show a change or a gap, they do not stop one and do not bring a lost record back.
Keeping the folder of your receiver safe - backups, a second copy - stays your job; the checks tell you when something in it is not right.
A typical case: For example, before an audit QA runs the verify tool on the receiver folder and gets: every chain complete, signed by the UP↑SCALE up to the newest checkpoint, nothing broken, nothing conflicting.
What you need: Python 3.8 with the package cryptography, the receiver folder (or its backup); the records need ENTERPRISE.
Example files: upscale-verify.py, upscale-receiver.php, upscale-receiver.py, upscale-receiver-node.js · Manual: sealed or signed, tamper-evident records
Tracking runs on your own website PRO
The tracking mode records a weight point at every interval and raises alarms. The example receiver stores every run, draws a live chart, gives CSV and JSON and sends an e-mail at every alarm - from the webhook export of the UP↑SCALE or from the forwarding of the app. Everything about it, step by step, is on its own page.
A typical case: For example, a drying room or a silo: a live chart on your own website and an e-mail when the weight reaches its target or the scale goes silent.
What you need: a web server with PHP 7.4 or newer (or Python 3.8 or newer) and PRO.
Example files: upscale-tracking-receiver.php, upscale-tracking-receiver.py · Manual: tracking on your website
Your own devices and displays
Without a server: devices next to the scale read the weight over Bluetooth, ESP-NOW or the USB cable - from a simple display to a device that presses TARE.
BLE FOR ALL: the weight for everybody nearby FREE
With BLE FOR ALL (in the manual: WIRELESS for all) the UP↑SCALE puts its weight into its public Bluetooth advertising: every device nearby reads it without connecting or pairing - several scales at once, watches, home automation. The weight is the same line as on the USB cable, as HEX. Plain on purpose: it is off on a new scale and goes off when you switch the encrypted link on (you can switch it on again). Not while the UP↑SCALE is in a WiFi session - there: the weight streams.
upscale-arduino-ble-weight-monitor.ino- an Arduino board with the ArduinoBLE library finds every UP↑SCALE nearby and shows its live weight, no pairing.upscale-html-ble-weight-monitor.html- one HTML file that reads and sums every scale around in the browser (the scan needs the Chrome flag "Experimental Web Platform features"); you can try it live.
Your own Bluetooth programs can not read the encrypted link: for them, switch the encrypted link off - or use BLE FOR ALL or the WATCH LINK.
A typical case: For example, a dashboard on a PC in a packing room that adds up the weights of several scales - none of them paired, none of them busy with it.
What you need: an Arduino board with Bluetooth LE, or Chrome with the flag; FREE.
Manual: BLE FOR ALL, Arduino, HTML
WATCH LINK: an open door for watches and displays PRO
Watch and widget apps, displays and your own devices connect over Bluetooth, get the live weight, the state of the running program and its signals - and press TARE, OK, RESET or ZERO. Open on purpose: not encrypted, also with the encrypted link on. The buttons only work on an open scale (with users: while somebody is logged in with the app). With MULTIPLE MASTERS off it is one more connection next to your app; switching it on or off restarts the scale. Every packet fits 20 bytes, also for small watches. There is no example file - the packets are the specification:
service 00000010-1312-420b-b710-d90000000420
characteristic 00000011-1312-420b-b710-d90000000420 (notify, read, write; little endian)
name begins with "UP↑SCALE ("
LIVE [0] 0xA1 | [1] flags: 1 stable, 2 net, 4 center of zero, 8 overload, 16 taring,
32 tare refused, 64 no valid weight, 128 alarm open | [2] mode x 16 + state
| [3] number of the last SIGNAL | [4-7] float value | [8-16] value as text | [17-19] unit
mode 0 weighing, 1 counting, 2 check-weighing, 3 factory filling, 4 sorting, 5 fill weighing,
6 recipe, 7 coffee, 8 tracking, 15 another page
state 0 none, 1 TOO LESS, 2 OK (low), 3 PERFECT, 4 OK (high), 5 TOO MUCH, 6 waiting / take it off
SIGNAL [0] 0xA2 | [1] its number | [2] kind (+128 = alarm) | [3] detail | [4-7] float | [8-19] text
kinds 1 pack counted, 2 factory, 3 sorting, 4 tracking alarm, 5 coffee alarm, 6 recipe,
7 fill weighing, 8 overload, 9 tare refused, 10 no value from the RS-232 scale, 11 button refused
write t TARE, o OK, r RESET, z ZERO, a alarm seen A typical case: For example, an ESP32 with a big display on the far wall of a kitchen shows the weight and PERFECT, and its button tares the scale.
What you need: a device with Bluetooth LE and your own app for it; PRO.
Manual: WATCH LINK, its packets
ESP-NOW: devices without a router PRO
Up to 5 ESP32 devices, added by their MAC address, get the live data 5, 10 or 20 times a second - no router, no internet, no login - and may send TARE, OK and RESET. It also runs next to WiFi, on the channel of your network.
- Always encrypted: AES-128-GCM with a random key of its own per device; the app shows it as one line for the sketch (🔑 KEY, 📋 COPY, below). The key only goes over the encrypted Bluetooth link or the USB serial command NOWKEY, never over ESP-NOW; a counter that only goes up refuses replayed packets.
upscale-masterblaster.ino- the complete device for the Arduino IDE: receives the live data, sends TARE, OK and RESET on its buttons, contains the full data structure, prints sorting pings and switches a valve, a fast stage and an alarm pin.upscale-espnow-sensor-node.ino- an ESP32 with a sensor sends temperature, humidity and air pressure to the sensors of the UP↑SCALE; it can live in the same device as the MasterBlaster.
const uint8_t UPSCALE_KEY[16] = {...}; What the data structure carries per program (weights in the unit set on the scale; new fields are added at the end, so older devices keep working):
- Sorting: weight, category number, label, count and total (UNDER = 0, OVER = the last + 1), status flags, a ping packet with the counted category, its weight and a ping number, the category table row by row.
- Tracking: run state 0-3, points, last point, start weight, target, interval and the alarm bits - an extra packet with an alarm number for every new alarm.
- Factory filling: fill_run, fill_slow, fill_stop (early, in an extra packet, with stop number, flow rate and lag) and fill_state - see filling machines.
- Espresso: coffee_shot, coffee_target, fill_run and fill_stop = STOP NOW - see espresso machines.
Limits: the key of a device is in its sketch - keep the sketch to yourself like a password. Nobody can stop a radio jammer, so a machine must stop when no data comes (the sketch closes the valve after 500 ms). The sketches are written for the ESP32. The radio sleeps after the inactivity stop (5 minutes by default) unless it is set to always on.
A typical case: For example, a second display on the far side of a workshop shows the weight and the program state, and its buttons tare and confirm - no phone, no router.
What you need: an ESP32 board, the Arduino IDE and PRO.
Example files: upscale-masterblaster.ino, upscale-espnow-sensor-node.ino · Manual: ESP-NOW, its keys
USB serial output and the line format FREE
Switch on USB SERIAL OUTPUT in the scale settings and the UP↑SCALE sends its weight on the USB cable (115200 baud, 8N1): LIVE all the time or ON REQUEST, as plain text or as ASCII in HEX. The same 19-byte line is in BLE FOR ALL, in the field serial of the LIMS weight event and in the stream format "line of BLE FOR ALL" - one parser reads them all:
ST,+0000019.60 g<CR><LF>
[1-2] ST stable / US unstable weight, SQ / UQ count
[3] ,
[4-14] the value: the sign and 10 characters, zeros in front, with the decimal point
[15-17] the unit, right-aligned
[18-19] CR LF
ST,+000023.420 oz 23.420 oz, stable
SQ,+0000000420 PC 420 pieces, stable
US,-0000003.91 g -3.91 g, not stable
ON REQUEST: Q = the weight now S = the next stable weight
ALWAYS: T = tare Z = zero EXTENDED++ sends 40 readable lines a second (raw, smoothed, average, the filter stages, gross) and, if you like, a summary per second - only while a program reads the port. The USB link of the app is something else: while the app uses the cable, the scale sends no serial weight lines.
A typical case: For example, an old weighing program on a PC that reads a serial port keeps working with the UP↑SCALE on the USB cable - it asks with Q and gets the weight.
What you need: a USB cable and a serial monitor or your program; FREE.
Manual: USB serial output, the HEX format, EXTENDED++
The encrypted link: specification for your IT
For an IT review before an approval, or for a client of your own: the cryptographic specification of the encrypted link (AES-128-GCM, ECDH P-256 with a signed one-time key of the scale, HKDF-SHA256, registered apps). The same in plain words: security.
Machines: filling, espresso, sorting, alarms
The UP↑SCALE drives machines through an ESP32 next to them over ESP-NOW: the ESP32 switches a valve, a pump or a relay, and the scale decides when. upscale-masterblaster.ino switches a valve, a fast stage and an alarm pin and prints the sorting pings - a starting point for all four cases.
Filling machines: predictive cut-off, coarse / fine, pause PRO
In the factory filling mode the UP↑SCALE stops a valve, pump or auger early: when the weight plus flow rate times lag reaches the filling. It aims two times the learned scatter above the target, or the middle of PERFECT if that is higher - never above PERFECT -, learns the lag (an underfill is corrected fully, an overfill by a quarter), tops up when it stopped too early, slows down a set percentage before the target for two-speed machines, pauses up to 120 seconds before the next filling and waits while it tares. Tick "With a filling machine (cut-off over ESP-NOW)" on the mold overview. What the machine reads:
fill_run true while the machine should fill
fill_slow true from the slow-down point to the next cavity (coarse / fine)
fill_stop comes early by flow rate x lag, at once in an extra packet
+ stop number, flow rate per second, lag
fill_state 0 none, 1 START (put a mold on), 2 filling, 3 slow, 4 stopped, 5 pause, 6 mold full
MasterBlaster: FILL_VALVE_PIN (fill), FILL_FAST_PIN (fast stage), ALARM_PIN;
the valve closes after 0.5 s without data A typical case: For example, a small chocolate maker fills 36-cavity molds with a pump on an ESP32 relay: the UP↑SCALE stops the pump early for every cavity and learns the lag as it goes.
What you need: an ESP32 with a relay or valve driver, the MasterBlaster sketch and PRO.
Example files: upscale-masterblaster.ino · Manual: cut-off, coarse / fine, pause
Espresso machines: the pump stops at the target yield PRO
In the coffee mode the UP↑SCALE gives STOP NOW a little before the target yield - by flow times lag, the lag learned shot by shot - and sends it over ESP-NOW to a pump relay. Lever or switch machines: switch the brew switch off after the shot.
coffee_shot = true coffee_target = target yield fill_run = cup on, shot running fill_stop = STOP NOW Machines and apps that speak the Decent Scale protocol use the UP↑SCALE as their scale (10 weights a second, 0.1 g, tare, shot timer). The protocol has no stop command: set the target in the machine. Not in a WiFi session; there the WebSocket stream understands the tare and timer bytes of the protocol.
Decent, Decent Scale and DE1 are names of Decent Espresso International Ltd. UP↑SCALE is not affiliated with or endorsed by Decent Espresso.
A typical case: For example, an espresso machine whose pump relay stops at the target yield, shot after shot, with the lag learned on the way.
What you need: an ESP32 with a relay on the pump and PRO - or a machine with the Decent Scale protocol.
Example files: upscale-masterblaster.ino · Manual: early stop, Decent Scale protocol
Sorting gates PRO
In the sorting mode every counted item sends a ping packet with its category and weight: an ESP32 opens a gate, moves a conveyor or lights a lamp for that class. The ping number shows a missed packet; TARE, OK and RESET go back.
A typical case: For example, a sorting gate that pushes each item into its weight class.
What you need: an ESP32 with a servo or relay, and PRO.
Example files: upscale-masterblaster.ino · Manual: sorting over ESP-NOW
Tracking alarms to a buzzer or a lamp PRO
In the tracking mode every packet carries the run state and the alarms, and every new alarm comes once more in an extra packet. The MasterBlaster switches its alarm pin: a buzzer, a lamp or a relay.
A typical case: For example, a lamp over a drying rack that lights up when the target weight is reached.
What you need: an ESP32 with a buzzer, lamp or relay, and PRO.
Example files: upscale-masterblaster.ino · Manual: tracking over ESP-NOW
Scales on the network PRO
The RS-232 dongles (232 and DIY) can read a scale over your network instead of their RS-232 port: a scale terminal with an Ethernet port, an RS-232 scale behind a serial-to-LAN adapter (TCP client or TCP server), or a Modbus TCP scale (unit ID, holding or input registers, data type, word order, decimals, status bits, a command register or coils for tare and zero). Tare, zero and print commands go over the network, and everything else stays as with the cable: programs, records, alibi lines, LEGAL MODE (with a warning). The link is not encrypted - use a network only you control.
Set up a serial-to-LAN adapter
- Connect it to the scale with a PC-style cable and the same serial settings as the scale; flow control none.
- Operation mode "TCP server" (raw - not Telnet, RFC 2217 or a virtual COM port), a port such as 4001, one connection, a fixed address.
- Delimiter CR LF, or force transmit after 20-50 ms; inactivity timeout 0; TCP alive check on.
- In the app: RS-232 settings → 📶 NETWORK SCALE → TCP client with the address and the port. Check it first from a PC with nc (first line below).
Try it first with an emulator
upscale-tcp-scale.py plays a network scale as server or client with common continuous and command protocols and logs every command the dongle sends; upscale-modbus-scale.py plays a Modbus TCP scale (port 5020; integer and float registers - the float in both word orders -, status bits, a command register and coils).
nc <address of the adapter> 4001
python3 upscale-tcp-scale.py server --port 4001
python3 upscale-modbus-scale.py --port 5020 --unit 1 A typical case: For example, a balance terminal with an Ethernet port in the next room: the dongle reads it over WiFi - tried first with the emulator on a laptop, before anyone touches the real scale.
What you need: a 232 or DIY dongle in your WiFi network and PRO; Python 3 for the emulators.
Example files: upscale-tcp-scale.py, upscale-modbus-scale.py · Manual: network scale, serial-to-LAN adapter
Every example file
All files are free under the MIT License (the full text is in each file) - copy them and change them as you need. They open as plain text in the browser (the HTML Bluetooth monitor opens as a page you can try): save them with your browser, or download them with curl.
| File | Runs on | What it does | Section |
|---|---|---|---|
upscale-receiver.php | PHP 7.4+ | reference receiver: three security modes, CORS, doubles dropped, JSON lines per type and day, chain and seal checks, receipt, stored, requests, poll | Your own small LIMS |
upscale-receiver.py | Python 3.8+ | the same in Python, with its own https option | Your own small LIMS |
upscale-receiver-node.js | Node.js 18+ | the same in Node.js, no packages | Your own small LIMS |
upscale-verify.py | Python 3.8+ | offline check of a receiver folder: every chain, seal and checkpoint; an exit code for cron jobs | Independent check |
upscale-to-lims.py | Python 3.8+ | CSV / XML files into the import folder of your LIMS and / or its REST API | Your LIMS / ELN |
upscale-to-object-lock.py | Python 3.8+, boto3 | one object per record in S3-compatible storage with a retention lock | Archive |
upscale-n8n.json | n8n 1.x | n8n workflow: webhook, check, LIMS call, receipt | Your LIMS / ELN |
upscale-node-red.json | Node-RED 3.1+ | Node-RED flow: check, daily files, LIMS call, receipt | Your LIMS / ELN |
upscale-tracking-receiver.php | PHP 7.4+ | tracking runs: live chart, CSV, e-mail alarms | Tracking |
upscale-tracking-receiver.py | Python 3.8+ | the same in Python | Tracking |
upscale-api.py | Python 3.8+ | client of the JSON API: reads, actions, follow, sensor push | JSON API |
upscale-api.sh | sh, curl, openssl | the JSON API with curl and openssl (HMAC) | JSON API |
upscale-stream.py | Python 3.6+ | reader of the WebSocket stream, sends tare and the timer | Weight streams |
upscale-stream.html | a browser | one page: a big live weight and TARE from the WebSocket stream | Weight streams |
upscale-udp.py | Python 3.6+ | listener for the UDP broadcast of every scale in the network | Weight streams |
upscale-mqtt-publish.py | Python 3 | MQTT publisher of room values for the scale | Sensors |
upscale-home-assistant.yaml | Home Assistant 2024.10+ | room values to the scale over MQTT, and the weight as a REST sensor | Sensors |
upscale-espnow-sensor-node.ino | Arduino, ESP32 | room values to the scale over encrypted ESP-NOW | Sensors |
upscale-masterblaster.ino | Arduino, ESP32 | ESP-NOW device: live data, buttons, valve, fast stage and alarm pins | Own devices |
upscale-arduino-ble-weight-monitor.ino | Arduino, ArduinoBLE | the live weight of every scale nearby from BLE FOR ALL | Own devices |
upscale-html-ble-weight-monitor.html | a browser | reads and sums every scale nearby in the browser | Own devices |
upscale-tcp-scale.py | Python 3 | network scale emulator, server or client | Network scales |
upscale-modbus-scale.py | Python 3 | Modbus TCP scale emulator | Network scales |
The examples show the protocol and are a starting point, not finished products: try them in your setup before you rely on them. The storage of your receiver, its backups and its qualification are in your hands.
Questions about scale integration
Can I connect a weighing scale to my LIMS?
Yes. The UP↑SCALE sends its weighings and records as JSON to your LIMS or ELN - from the app while it is connected, or by itself over WiFi - and a free bridge writes them into the import folder of your LIMS or calls its REST API. Your LIMS can also ask the JSON API of the UP↑SCALE. There is no cloud in between.
Does the app have to be open for the data to arrive?
Not with the webhook export: in your WiFi network the UP↑SCALE sends by itself, and its records wait on the scale while your server is down. The LIMS / ELN forwarding of the app only sends while the app is open and connected; the activity log is caught up later from the scale.
Do I need a cloud or an account for it?
No. Every route ends at an address of yours - a LIMS, a PC in the lab, your own web server. Nothing goes through UP↑SCALE.
Which edition do I need for a LIMS integration?
The weight streams over UDP and GET are FREE. PRO (from 4.43 EUR a month) sends the live weight and tracking runs and adds the WebSocket stream, ESP-NOW and network scales. ENTERPRISE & COMPLIANCE (from 13.00 EUR a month) sends the records - activity log, sales, LEGAL MODE store, seals, batch records - and adds the JSON API, the requests, the archive receiver and the sensors of the scale.
Can my server check that no record is missing or changed?
Yes. The activity log, the LEGAL MODE store and the sales log are hash chains, and the UP↑SCALE signs their heads in chain checkpoints. The free receivers check every link and every seal with the public UP↑SCALE licence keys, and upscale-verify.py checks a whole receiver folder again offline. It shows a change or a gap - it can not undo one.
Can I build a small LIMS of my own?
Yes. One of the three reference receivers (PHP, Python or Node.js) keeps every record as JSON lines per type and day, checks the chains and confirms what it saved; add the verify tool and a backup, and move the storage to a database when files are no longer enough.
Does it work without the internet?
Yes. The webhook export, the JSON API and the streams work in your own network, and ESP-NOW and BLE FOR ALL need no network at all. In your own network without a public certificate, use the HMAC-signed or the sealed mode.
Can an ESP32 control a filling machine with the scale?
Yes. Over ESP-NOW the UP↑SCALE tells an ESP32 when to fill, when to slow down and when to stop - early, by flow rate and the learned lag - and the free MasterBlaster sketch switches the valve or the pump. It closes the valve by itself when no data comes for half a second.
Can I read the weight in my own program or in Home Assistant?
Yes. GET /api/weight and the UDP broadcast are free in your WiFi network, the WebSocket stream is PRO, and the USB serial output and BLE FOR ALL work without a network. Home Assistant reads the weight with a REST sensor - the example file has it.
Can the receiver link a LIMS weighing record to its LEGAL MODE entry?
Yes. The link is in both records: a sale or print of the balance carries the number of its LEGAL MODE entry (e.g. UP-000123), and the LEGAL MODE entry points back to the sale and holds the value used, the time and the line of the balance as it came. Each side is covered by its own hash chain and by the signed chain checkpoints of the UP↑SCALE. The reference receivers match every pair by itself and report linked, waiting or a mismatch; your LIMS can use the same fields: number, sale, value and time.
Also useful for you
Connect a Scale to Phone & PC: Bluetooth, USB, RS-232
Connect a scale to phone or PC: Bluetooth, the USB cable or your WiFi network, several scales, scales of other makers, machines, webhook and your own programs.
Read →LIMS, ELN & sensors
UP↑SCALE LaboratoryEvery weighing to your LIMS or ELN, room values next to it, air buoyancy corrected.
Read →Laboratories & pharmacies
UP↑SCALE LaboratoryThe compounding assistant from master formula to signed batch record, routine checks before use, a full test suite and records you can prove: users, roles, reasons, a hash-chained audit trail and sealed reports.
Read →Makers & developers
Build your own adapter for about 15 EUR, read the open protocol, and connect the scale to your own pages, Arduino and ESP projects.
Read →Tracking Mode on Your Website: Live Chart, CSV, E-mail
Send the tracking runs of your scale to your own server: every point stored, a live chart, CSV export and e-mail alarms - with a free PHP example.
Read →Who else uses it
Filling machines
Business & productionThe factory mode fills molds and bags cavity by cavity; the scale stops your machine early over ESP-NOW and learns its lag.
Read →Tracking mode
UP↑SCALE LaboratoryThe weight at a fixed interval for days or weeks: drying curves, plants, silos, alarms, CSV and your own website.
Read →The same app, for other work
Every function is in the same app - at home, in business and in the lab. All functions at a glance.
Home & kitchen
The free kitchen and food scale app: nutrition, carbs, recipes, baking, coffee
Read →Business & production
Weighing scale software: counting, check-weighing, ℮, labels, stock and sales - pay once
Read →UP↑SCALE Laboratory
Lab balance software: audit trail, e-signatures, balance checks, calibration, pipettes, validation pack
Read →