XMAS Hackathon together with Kunbus

Almost Christmas!

Last week we were glad to participate in the XMAS hackathon organized by Kunbus GmbH. It took place in their office in Hamburg. Together with Leogistics GmbH, A1 Digital, and other participants, we worked on this hack. One of the reasons, it was great, was that it was an in-person event after a few years of only having online events.
During these two days, we started by looking at the possibilities of thin-edge.io in combination with Cumulocity IoT and the Revolution Pi.

We discussed different topics like device management, what is already available and what is needed. The main direction of this discussion was to explore the (new) possibilities with thin-edge.io, running on the Revolution Pi, connected to Cumulocity IoT.
We discussed how to handle certificates on the device and many other things.

Then it was time to put everything that was discussed (and more) into action.

The challenge of the hackathon was to turn an old US snack-vending machine into a thrilling cloud-based advent calendar for kids in a nearby hospital. With sound, light, smoke and great gifts that make their stay in the hospital a little brighter.

As already mentioned, the heart of the machine is a Revolution Pi running thin-edge.io. This Revolution Pi is controlling many of the LEDs, the smoke machine, playing sounds, the led screens dispatching the gifts and also controlling the QR code reader for retrieving the gifts.

A lot of things had to be created in these two days, as there was nothing when we started, except the vending machine and equipment like the Revolution Pi.

First, we installed thin-edge.io on the Revolution Pi and connected this device to Cumulocity IoT.
On the Cumulocity IoT side, there had to be more work done. One important thing was the creation of an application. This was created to support the different functions of the vending machine.

This application consisted of a custom operation handler which was responsible for mapping cloud operations to on-device functions such as dispensing a gift, playing sounds, flashing the LED’s etc. When a voucher is scanned by the vending machine, a request was sent to the cloud where the one-time voucher is validated, and an operation is then sent back to thin-edge where the gift was dispensed.

Monitoring and logging were added to ensure that the application would be easy to debug if anything unexpected happens.

The whole solution was packaged as a single installable app to make installing and updating a breeze. So once the Revolution Pi vending machine goes into mass production, the fleet-wide device management of it will be child’s play.

In addition to the task of controlling the various functions of the vending machine from Cumulocity IoT, the process for creating and redeeming the coupons had to be developed.

Therefore, in the first step, a script was designed to generate QR codes with a unique identifier and store them in Cumulocity IoT.
In the second step, streaming analytics was used to create a rule within Cumulocity IoT that, when at the vending machine a QR code is scanned, checks whether the identifier is valid and not yet used. Approved QR codes then send an operation to the Revolution PI to dispatch a gift and are marked as used.

The final step then involved a UI extension in the cockpit to visualize the QR codes generated and redeemed, so that the admin can see if there are enough QR codes to retrieve gifts.

After two days of brainstorming and experimenting, networking and having fun, we created some interesting views on device management including software management. Not all tasks which had to be done were finished, but that will happen in the next few weeks.

A big thanks to the organizers of the XMAS Hack and all participants and merry christmas.

To be continued…