CATALOG

This is a practical solution. aroundThingboot open platform35A intelligent power protection switchas well asSelf-service printerFor remote control scenarios, I will help you sort it out from hardware selection, wiring logic to code implementation.

1. What problem does this plan solve?

Many friends who make self-service printers, express delivery cabinets, and shared vending machines will encounter a headache:What should I do if the device freezes?

Especially for self-service printers, the industrial control motherboard is sometimes unstable. If the screen cannot be pressed and you can't run over and unplug it, the machine will always "pretend to be dead" there, which not only wastes electricity but also delays users queuing behind.

The traditional solution isBuy a network relay, but that thing generally doesn’t have enough voltage and current resistance. The printer’s instant start-up current is very large, and it’s easy to burn the contacts.

So, what we’re talking about today is:How to use Thingboot's open interface and a smart power protection switch that can withstand a large current of 35A to achieve a remote hard restart.

2. Hardware selection: What does this thing look like and how to connect it?

1. Core component: 35A intelligent power protection switch

First of all, let’s clarify that this "35A smart power protection switch" is actually more likeHigh Power DC Solid State RelayorSmart circuit breaker with Bluetooth/serial communication.

  • Why choose 35A?Self-service thermal printers (80mm type) or laser machines have a lot of instantaneous power. If you just buy a 5A relay that costs just a few yuan, it will stick to death after just a few uses. 35A has enough margin to withstand surges.

  • How to connect?Generally it is "in + out". The input terminal is connected to the power supply of your device (such as 24V/12V or 220V, depending on the model you buy), and the output terminal is connected to the positive terminal of the printer.

  • Control logic:This thing isHigh level triggerstillLow level trigger, ask clearly when buying. Generally, a 5V signal is given or the on-off is controlled through optocoupler isolation.

2. Controller: Thingboot’s intelligent hardware

You need a "brain". Thingboot has many smart hardware products, such as4G DTUorIndustrial grade IO controller.

  • Selection:You just need to buy that kind of beltGPIO outputorRelay outputThe model will do.

  • Connection relationship:

    • Thingboot device (GPIO port) -> Connection -> Control terminal of 35A switch -> Control the power cord of the printer.

Connection instructions (colloquial version):Cut the printer's power cord and connect the positive wire to the "input" and "output" of the 35A switch. Then lead two wires from the Thingboot equipment and connect them to the "control end" of the 35A switch. As soon as there is a signal from the other side, the power here "clicks".

3. Software integration: How to control it through code?

This is the most enjoyable part of Thingboot——The HTTP interface is permanently free, and the documentation is straightforward. No matter you are using Java, Python, or even in a small program, just send an HTTP request directly.

Core principles:

Your backend -- (send a command) --> Thingboot Cloud Platform -- (transmit it to the device through the network) --> the device pin outputs high and low levels --> 35A switch action.

1. Preparation

In Thingboot's console, you need to get three things:

  • AppID: Your application ID.

  • AppSecret: Developer password (used to calculate signatures to prevent others from adjusting the interface randomly).

  • Device ID: The device ID of your controller (it’s a string of numbers, affixed to the device).

2. Issue instructions (HTTP method)

You need to send data to this address:http(s)://api.thingboot.com/{AppID}/device/control/

How to do it specifically?Assuming your device ID is123456789, you want the relay connected to its No. 1 circuit to "pull in" to turn on the power.

  • Request parameters:

    • device: 123456789

    • order: {"relay1":1}(This is your command, 1 means open; the command field names of different products are different, just check the documentation).

  • Security check:Bring all requestssign(signature) andts(timestamp).

There is a pitfall here, and it is also something that many people cannot adjust for the first time: the signature algorithm.Thingboot uses dual MD5, which is very simple:sign = md5(md5(your AppSecret) + ts timestamp)

3. Practical code snippets (Python example)

In order to let you see it more clearly, I write a piece of pseudo code, which is very colloquial:

4. Key logic: How to achieve "restart"?

Restarting is not just about sending "on" once, you need aSequential logic

  1. turn off: Send command{"relay1": 0}. The 35A switch is turned off and the printer is completely powered off.

  2. wait: The program waits for 5 seconds (it is important to let the capacitor discharge, otherwise the motherboard may not be completely reset).

  3. turn on: Send command{"relay1": 1}. The 35A switch is closed again, and the printer is powered on.

4. Guide to avoid pitfalls

  1. Regarding the power supply of the 35A switch:Never connect the control signal directly to 220V. Thingboot's equipment is generally dry contact or 5V/12V signal. If your 35A switch requires 12V drive, remember to power the switch separately and share the ground..

  2. Regarding Thingboot’s communication methods:Thingboot's equipment supports HTTP and MQTT.

    • If you only restart the printer occasionally, useHTTPThe simplest, you can use it at any time without maintaining long connections.

    • If you want to do real-time monitoring (such as watching current and voltage in real time), useMQTT, save traffic.

  3. Feedback mechanism:It's not enough for you to just give instructions. What should you do if the device is disconnected from the Internet and you send a shutdown command but it does not receive it?

    • Thingboot supportAsynchronous message push. You can set up a server to receive push notifications, and if the device fails to execute successfully, it will send you an alarm.

  4. Regarding the "smartness" of the 35A switch itself:Since it is a "smart power supply", it usually also comes withOverload protectionFunction.You can use Thingboot'sIncident reportingFunction. If the current fluctuation is abnormal and the printer is jammed, the 35A switch will feedback the signal to the Thingboot device, and the Thingboot device will report it to the cloud, and you can receive a notification immediately..

5. Summary

The whole plan actually consists of three steps:

  1. buy hardware: A Thingboot controller + a 35A high-power switch.

  2. wiring: Connect the high-power switch to the printer's power cord, and connect the control line to Thingboot's GPIO.

  3. write code: Call Thingboot’s free HTTP interface, calculate the MD5 signature, and send it{"relay1":1}That's it.

In this way, even if you are on vacation in Sanya, with just a click on your phone, the self-service printer can be forced to power off and restart, saving you the trouble of making a special trip.