Control a mechanical devise with Bubble

If it is possible, how do I use a bubble app to control a mechanical (physical) set of locks.

The pictures below show the system I am have. (Lock control board, DTU, locks, and etc)




My assumptions:

  1. The DTU is essential the same as a Raspberry Pi
  2. The Raspberry pi can connect to the Bubble io website.
  3. The Raspberry pi can also send data to the control board which in turn control the locks.
  4. I need to write a program (python) that will convert the Bubble IO output into an input for the control board .

Are my assumptions correct? Am I on the correct path to control the locks with the bubble app? If so my next step should be getting the python program written?

Any help/advice is much appreciated.

Thank you

The Bubble part is “easy” here. Create a dashboard which has a series of toggles (either yes/no or 0/1 values) and which displays the value of the toggle on a web page.

Your locally running python “listener” is going to parse the values of those uniquely named fields from the browser (which are populated by the value of your toggles) and send data via whatever protocol you’re (serial?) to your lock controller, which in turn controls the relay of the lock. Fortunately, the locks value of open or closed is probably set by some sort of binary statement like true/false or yes/no which should be easy to control from your parser.

I agree with Adam. This is less of a question about how Bubble works and more about how your Raspberry Pi (or similar device) controls connected hardware. I think you could simply place an HTML element on the page in your Bubble app and then copy & paste code from a tutorial about how to control Raspberry Pi GPIO pins from a web page, such as shown in this tutorial: Controlling GPIO pins of Raspberry Pi with web page - Hackster.io

If you want to get fancy then you could do further interactions with JavaScript and unique IDs for various native Bubble elements on the screen but the idea is pretty much the same.

So, use the HTML element in Bubble so that you can follow along with tutorials about controlling Raspberry Pi GPIO pins from a web page. Look for advice about how to do this from a site hosted on a web server and not locally hosted.

1 Like

To clarify for OP, the “site hosted on a web server” is the Bubble portion of this conversation. You WILL need a local-hosted machine reading the web data, that’s where your DTU or a Raspberry Pi comes into play. It’s “reading” the webpage using your local python app.

I can’t really tell from the image whether that scanner is a biometrics scanner or a barcode/QR code scanner. If it is the former there are API packages out there for using those with Raspberry Pi, though when it passes to Bubble, I’d imagine that it’s going to send the results of whether you passed your security check in plaintext.

Same with the QR/linear scanner, although much easier to implement, because both can be configured as a HID (keyboard) and just translate images into characters, but again, these are going to be passed in plaintext in the most basic implementations.

Thank you guys. I will dig in and learn about everything you described. After I get smart I will probably have more question. You guys are a great resource. Thanks again. Have a Merry Christmas!

This topic was automatically closed after 70 days. New replies are no longer allowed.