# IoT Candy Grabber

**URL:** <https://discourse.nodered.org/t/iot-candy-grabber/2025>\
**Category:** Share Your Projects\
**Created:** [3 August 2018 10:59 UTC](https://discourse.nodered.org/t/iot-candy-grabber/2025 "2018-08-03T10:59:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![makkelaig](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/makkelaig/32/1536_2.png) [@makkelaig](https://discourse.nodered.org/u/makkelaig)\
**Post date:** [3 August 2018 10:59 UTC](https://discourse.nodered.org/t/iot-candy-grabber/2025/1 "2018-08-03T10:59:50Z")

</div>

For my bachelor project in mechatronics I had to remotely control a toy candy grabber via network. For this purpose I connected the hardware of the candy grabber to a Raspberry Pi3 Modell B+ and modified it slightly so I could access all necessary parameters. The hardware is controlled and monitored with a Python Script and accessible through a Python OPC UA server running on the Raspberry Pi. To view the device, I used the [RPi Cam Web Interface](https://elinux.org/RPi-Cam-Web-Interface), which works really great.

To control the candy grabber, I used the Node-RED dashboard as user interface. That may be an unusual way of using the dashboard but it worked really well.

 ![dashboard](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a1de08f5974fdce13cc9dc4e32526ef7eda8974e.jpg)

For communicating with the Python OPC UA server I used node-red-contrib-opcua client nodes\*. There is a stoptimer node set in the Node-RED flow when a game starts. So the players have 5 minutes to grab a candy, otherwise they loose. Important informations are shown as Pop Up dialogs in the dashboard.

A big **Thank You!** to all the developers contributing to the great packages and APIs that are used in this project. For more information and the full Node-RED flow visit the [project repository](https://github.com/makkelaig/candy-grabber).

\*For reasons yet unknown I was unable to establish communication with the newer version node-red-contrib-iiot-opcua. I got a port error every time I tried. Maybe it expects a certain, predefined port-number?. I will follow up on this problem and would appreciate any insights on this topic.

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [3 August 2018 13:21 UTC](https://discourse.nodered.org/t/iot-candy-grabber/2025/2 "2018-08-03T13:21:32Z")

</div>

Thats pretty cool! well done 👍
