Blog 5 - Development 2 - Igor Kapusniak
Blog 5 - Development 2
Introduction
This sprint I was a continuation of the development from the prior sprint. With the core structure of the microbit cloud board code and fullness sensor developed, further additions could now be added such as encryption and sending barcode codes via MQTT to Node-RED.
Encryption Update
Node Red Update
To allow Node-RED to receive scanned barcode codes, MQTT listeners were set up that subscribe to topics and read published messages from the microbit devices. Once a barcode is received, it is converted into a structured format containing the class information, bin details, barcode number, and timestamp for processing.
The barcode is verified using the publicly accessible API from https://re-turn.shanehastings.ie/, which tells us whether the barcode is part of the return scheme or not. If valid, the deposit value is extracted and the data continues to further processing. If invalid, the message is stopped at this stage, preventing invalid items from being added to the leader board. This verification step prevents fraudulent entries into the system.
Next Steps
All that remains is to run the verified return bottle data through Node-RED nodes that update a CSV file, which is then used to update a dashboard page with graphs and other information.
Sprint Summary
This sprint successfully implemented encrypted radio communication between the master and slave devices using an XOR cipher, which required a rewrite to handle string only radio transmission. MQTT integration was added to Node Red to receive barcode scans with verification against the Re-turn API to ensure that only valid bottles are processed.
Comments
Post a Comment