The pain point of shared equipment cabinets is how to control multiple cabinet doors at the same time in a low-cost, high-reliability way. Thingboot's 8-channel controller just solves this problem - one device manages 8 grids and can be controlled remotely through the HTTP interface. The integration is very smooth.
1. Why do you do this? (analyze)
What is the biggest headache when we build shared equipment cabinets (such as shared express cabinets, tool cabinets, and even vending machines)?
Messy wiring: If a power cord is pulled from each cabinet door to find the main control board, 8 grids will require 8 sets of relays. The back of the cabinet will be messy like a spider web, making repairs difficult.
High cost: If you buy a PLC or relay board yourself, you also need to equip it with a communication module, and the hardware cost keeps rising.
Tired of development: If you write the underlying driver from scratch, it would be too laborious to deal with various signal debouncing, network disconnection and reconnection.
At this time, directly useThingboot’s 8-channel intelligent universal controllerMuch smarter. It is equivalent to an "8-plug strip with its own brain". We only need to tell it to "open the third port" and it will do it by itself. We only need to adjust the interface.
2. Which "guy" is the best to choose? (hardware selection)
To achieve "8-way centralized control", the hardware is this:
Recommended model: UNI-KZQ-TY-8 (intelligent universal controller 8 channels)
Number of control channels: 8 channels (independent control, drive whichever channel you want).
What can I bring?: There are corresponding versions for DC 12V or AC 220V. For cabinets, it is usually controlled by 12VElectromagnetic lockOr 220VLighting/display. If it is to control 220V high-power equipment, choose the AC version; to control locks, choose the DC version.
How to connect to the Internet: Wi-Fi 2.4G (as long as there is signal, it can be placed anywhere).
Features: Supports HTTP requests, MQTT, andLAN privatization(If the cabinet is in the basement without an external network, it can also be controlled through the internal network).
Physical connection logicConnect the positive poles (or live wires) of the electromagnetic locks of the 8 cabinet doors to the controller respectively.OUT1 to OUT8On the interface, the public line is connectedCOM. Connect the power, set up the network, and things in the physical world will be taken care of.
3. How to adjust it through software? (API integration practice)
Thingboot's open interface is very friendly, it is a standard HTTP request.
1. Preparation
You have to get three things (look at the background of Thingboot console):
AppID: Your application ID.
AppSecret: Your application key (used to calculate signatures to prevent others from messing with your interface).
Device ID: The device number of the 8-way controller.
2. Core operation: open/close door
The most common action in shared cabinets is "the user clicks and the corresponding grid pops up."
interface addresshttps://api.thingboot.com/{AppID}/device/control/?sign={Signature}&ts={Timestamp}
Request body Body (JSON format)
If someone rents locker No. 3, we only need topower3set to1(pulse signal, unlocking action), and then automatically reset after 0.3 seconds0(Power failure protection lock body).
If you want to open channels 1, 3, and 5 at the same time (such as batch clearing):
This is very flexible. You don’t need to issue commands one by one.HTTPUpon request, all cabinet doors 1/3/5/7 popped open..
3. How to write the code? (Python example)
To put it a little more colloquially, take Python as an example. It’s actually just these few lines:
Tips:In actual business, you canorderRigaextrafields, such as order number{"power2":1, "extra":"ORDER_123456"}. In this way, when the device execution status is pushed back, you will know which order opened the door, which is very convenient for reconciliation..
4. Advanced gameplay: make it smarter
Light energy to open and close the door is called "remote control", what we want to do is "smart".
Asynchronous message push (get real results)The HTTP request returning 200 only means "the platform has received the instruction", not "the cabinet door really popped open" (what if the device goes offline?).Receive core step on the server sidePush message. When the controller actually completes the action, it will actively tell your server: "I executed the door-opening command just now successfully/failed." This way you can give users accurate feedback.
Scheduled tasks and inspectionsUse the "Cloud Timing" function of the Thingboot console. Set it at 6 o'clock every morning and let the controller switch all channels
resetOnce (break first and then connect). This can clear the residual magnetism of the electromagnetic lock and solve the problem of mechanical jamming that occasionally cannot open the door. There is no need for operation and maintenance to go to the site to press the button..Local linkage (edge computing)If your cabinet is in a basement with poor internet, don’t worry. This controller supportsLAN privatizationorSelf-built MQTT. You can call it directly from the local server using the intranet IP, and it can also be used when disconnected from the external network..
Voice feedback linkageAlthough we mainly talk about controllers, there are also other things in Thingboot’s ecosystemIntelligent voice column. You can integrate it: when the user scans the code and door No. 3 pops open, adjust the voice interface to let it shout "Cabinet door No. 3 has been opened, please store the items.".
5. Summarize the benefits of this solution
Use Thingboot's solution to create shared equipment cabinets.High cost performance
Fast development: Don’t draw your own board and build a microcontroller. The back-end students will read the document for half an hour and write a
POSTJust ask, and you can run through the logic of the cabinet in one afternoon.Simple expansion: It turns out that to make 24 cabinets, you may have to create a complex circuit matrix. Now you only need to buy three 8-way controllers, each with independent network distribution. Once bound in the cloud, you can adjust the corresponding grid which one you want to control.
powerparameter.Easy maintenance:Which road is broken? Take a look at the backstage and just change the controller without touching the wiring of the entire cabinet.
In short,"The physical wiring is equipped with 8 channels, and the software call selects power". Grasp these two points, and the control part of your shared equipment cabinet will be stable.