CN116260869A - Method and system for remotely waking up same local area network host by utilizing MQTT protocol - Google Patents

Method and system for remotely waking up same local area network host by utilizing MQTT protocol Download PDF

Info

Publication number
CN116260869A
CN116260869A CN202310225631.2A CN202310225631A CN116260869A CN 116260869 A CN116260869 A CN 116260869A CN 202310225631 A CN202310225631 A CN 202310225631A CN 116260869 A CN116260869 A CN 116260869A
Authority
CN
China
Prior art keywords
wake
coupled
serial port
chip
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310225631.2A
Other languages
Chinese (zh)
Other versions
CN116260869B (en
Inventor
许吉锋
蓝世才
刘付观运
彭瀚林
李聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Coco Software Technology Co ltd
Original Assignee
Guangzhou Coco Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Coco Software Technology Co ltd filed Critical Guangzhou Coco Software Technology Co ltd
Priority to CN202310225631.2A priority Critical patent/CN116260869B/en
Priority claimed from CN202310225631.2A external-priority patent/CN116260869B/en
Publication of CN116260869A publication Critical patent/CN116260869A/en
Application granted granted Critical
Publication of CN116260869B publication Critical patent/CN116260869B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4416Network booting; Remote initial program loading [RIPL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q9/00Arrangements in telecontrol or telemetry systems for selectively calling a substation from a main station, in which substation desired apparatus is selected for applying a control signal thereto or for obtaining measured values therefrom

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Health & Medical Sciences (AREA)
  • Signal Processing (AREA)
  • Medical Informatics (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention relates to the technical field of the Internet of things, in particular to a method and a system for remotely waking up the same local area network host by utilizing an MQTT protocol. A method for remotely waking up the same lan host using MQTT protocol, comprising the steps of: receiving a remote wake-up signal of a main control machine sent by an MQTT server in real time; converting the remote wake-up signal into a wake-up data Packet in a Magic Packet format; and sending a wake-up data packet to all the controlled computers in the local area network so as to wake up all the controlled computers. The method has the function effect that each controlled machine in the same local area network is woken up remotely by the main control machine crossing the network.

Description

Method and system for remotely waking up same local area network host by utilizing MQTT protocol
Technical Field
The invention relates to the technical field of the Internet of things, in particular to a method and a system for remotely waking up the same local area network host by utilizing an MQTT protocol.
Background
Currently, as the demand for use increases, it is often necessary to remotely control the turning On and off of electrical devices to increase efficiency, and WOL (Wake-On-LAN) is one of the solutions for remotely waking up hosts within a LAN.
However, the existing remote wake-up function is limited by a router in the network, and the solution can only be used when the main control machine and the controlled machine are located in the same local area network.
The prior art solutions described above have the following drawbacks:
because the router can only be used when the master control machine and the slave machines are located in the same lan, each slave machine located in the same lan is difficult to wake up remotely by the master control machine across the network, and therefore improvement is needed.
Disclosure of Invention
In order to enable all controlled computers in the same local area network to be awakened remotely by a cross-network main control computer, the application provides a method and a system for awakening the same local area network main control computer remotely by utilizing an MQTT protocol.
In a first aspect, the present application provides a method for remotely waking up the same lan host using MQTT protocol, including the steps of:
receiving a remote wake-up signal of a main control machine sent by an MQTT server in real time;
converting the remote wake-up signal into a wake-up data Packet in a Magic Packet format;
and sending a wake-up data packet to all the controlled computers in the local area network so as to wake up all the controlled computers.
By adopting the technical scheme, the main control machine transmits the remote wake-up signal to the router of the local area network through the MQTT server, converts the remote wake-up signal transmitted by the main control machine into the wake-up data Packet in the Magic Packet format which can be analyzed by the router in the local area network, transmits the wake-up data Packet to the controlled machines in the local area network, and the controlled machines are started after receiving the wake-up data Packet, so that the function that each controlled machine in the same local area network is remotely waken by the main control machine crossing the network is realized.
The present application may be further configured in a preferred example to: before the step of receiving the remote wake-up signal of the master control machine sent by the MQTT server in real time, the method specifically comprises the following steps:
all controlled computers in the local area network subscribe to the main control computer through an MQTT protocol;
automatically sending Wake On Lan for ASP an installation package to the controlled computers of the subscribed main control computers in the local area network.
By adopting the technical scheme, each controlled machine and the main control machine form a subscription relation, each controlled machine receives a remote wake-up signal sent by the main control machine in the local area network, and automatically sends an installation package to the controlled machine after being connected with the controlled machine, so that the controlled machine has the function of receiving the remote wake-up signal.
The present application may be further configured in a preferred example to: the step of sending a wake-up data packet to all the controlled computers in the lan to wake up all the controlled computers specifically includes:
the remote wake-up signal comprises a network wake-up data packet, and the network wake-up data packet comprises identification characters and identification code characters;
when the controlled machine receives the wake-up data packet, identifying identification characters in the wake-up data packet in real time;
after the controlled computer identifies the identification character of the wake-up data packet, reading the identification code character;
the controlled machine judges whether the identification code character is matched with the unique identification code of the controlled machine;
if yes, the controlled machine is started.
Through adopting above-mentioned technical scheme, possess the identification code that corresponds with the controlled machine in the long-range wake-up signal that the main control computer sent, make the connection of main control computer and controlled machine more accurate, be difficult for appearing misjudgement, make another controlled machine of main control computer control, the accuracy when improving the use.
The present application may be further configured in a preferred example to: after this step of converting the remote wake-up signal into a wake-up Packet in the Magic Packet format, it specifically comprises:
sending a wake-up data packet to a local area network router through a UDP protocol;
the local area network router receives the wake-up data packet;
the local area network router broadcasts a wake-up data packet to all the controlled computers in the local area network.
By adopting the technical scheme, the data information of the wake-up data packet has a specific format, and the data information is used as the identification character and the identification code character according to the specific format, so that the main control computer and the controlled computer are matched more efficiently.
In a second aspect, the present application provides a system for remotely waking up the same lan host using MQTT protocol, which adopts the following technical scheme:
the system comprises a power supply module, a main control module, an interface module and a serial port downloading module, wherein the output end of the power supply module is coupled with the main control module, a first signal end of the main control module is coupled with a first signal end of the serial port downloading module, a second signal end of the main control module is used for being externally connected with a computer, a second signal end of the serial port downloading module is coupled with the first signal end of the interface module, and the interface module is used for being externally connected with the computer.
By adopting the technical scheme, the interface module is externally connected with the computer, so that the system program is easy to modify and update, and the main control module receives the remote wake-up signal of the main control computer and sends the remote wake-up signal to the controlled computer.
Preferably, the device further comprises a breathing lamp module, wherein the breathing lamp module is coupled with the second signal end of the main control module, and the breathing lamp module is used for prompting the working state of the main control module.
Through adopting above-mentioned technical scheme, the operating condition of breathing lamp is main control module's operating condition, and the breathing lamp makes the operating condition of system visual, and the staff of being convenient for inspect is convenient for get rid of when system's trouble, improves system error correction efficiency.
Preferably, the serial port downloading module includes a serial port downloading chip unit for converting the UART device into a USB interface, an automatic downloading unit and a serial port voltage stabilizing unit, a first signal end of the serial port downloading chip unit is a first signal end of the serial port downloading module, a second signal end of the serial port downloading chip unit is coupled with the first signal end of the automatic downloading unit, a second signal end of the automatic downloading unit is a second signal end of the serial port downloading unit, and a third signal end of the serial port downloading chip unit is coupled with a signal end of the serial port voltage stabilizing unit.
By adopting the technical scheme, the serial port downloading chip unit enables UART equipment to be converted into a USB interface, the serial port downloading chip unit provides a virtual serial port and is used for upgrading the existing serial port equipment or adding the serial port to a PC, and the serial port voltage stabilizing unit enables the serial port downloading chip unit to supply power to a stable point and protects the serial port downloading module.
Preferably, the serial port downloading module further comprises a serial port indicator lamp unit, one end of the serial port indicator lamp unit is used for being connected with electricity, and the other end of the serial port indicator lamp is coupled with the fourth signal end of the serial port downloading chip unit.
By adopting the technical scheme, the serial port indicator lamp prompts the working state of the serial port downloading chip unit, and when the serial port downloading chip unit works, the serial port indicator lamp is turned on; when the serial port downloading chip unit does not work, the serial port indicating lamp is turned off.
Preferably, the device further comprises a key module for controlling the on-off, wherein a signal end of the key module is coupled with a third signal end C of the main control module.
By adopting the technical scheme, the system has the function of external control on-off, namely has the standby function, and is started through the key module when the system needs to be started.
Preferably, the serial port downloading chip unit includes a chip U2 for converting the existing UART device into a USB interface; the automatic downloading unit comprises a resistor R1, a resistor R4, a triode Q1 and a triode Q2; the serial port indicator lamp unit comprises a resistor R5, a resistor R6, a Light Emitting Diode (LED) 3 and a Light Emitting Diode (LED) 4, and the serial port voltage stabilizing unit comprises a crystal voltage stabilizer X2; the LED power supply is characterized in that a 13 pin of the chip U2 is coupled with one end of the resistor R4, the other end of the resistor R4 is coupled with a base electrode of the triode Q2, a 14 pin of the chip U2 is coupled with one end of the resistor R1, the 14 pin of the chip U2 is also coupled with an emitting electrode of the triode Q2, the other end of the resistor R1 is coupled with the base electrode of the triode Q1, the emitting electrode of the triode Q1 is coupled with the 13 pin of the chip U2, a1 pin of the chip U2 is grounded, a 2 pin of the chip U2 is coupled with one end of the resistor R6, the other end of the resistor R6 is used for being connected with a power supply, a 3 pin of the chip U2 is coupled with one end of the resistor R5, the other end of the resistor R5 is used for being connected with the power supply, a 3 pin of the chip U2 is coupled with the emitting diode, a 2 pin of the chip U2 is coupled with a 3 pin of the chip U2 is coupled with a carrier pin of the chip U2, a 2 is coupled with a 2B end of the chip 2 is coupled with a carrier pin of the chip 2, and a signal carrier pin of the chip 2 is coupled with a carrier pin of the chip 2 is coupled with the carrier pin of the chip 2B.
Through adopting above-mentioned technical scheme, chip U2 as serial ports download chip with current UART equipment conversion USB interface, crystal oscillator X2 and chip U2 coupling play the guard action to chip U2, and triode Q1 and triode Q2 combined action make the signal amplification, and realize signal transmission.
In summary, the present application includes at least one of the following beneficial technical effects:
1. the MQTT protocol enables a cross-network controlled machine of the same local area network to be networked, a remote wake-up signal sent by a main control machine is received, an identification code carried in the remote wake-up signal is matched with the controlled machine, and the MQTT protocol is called to carry out remote wake-up operation on a target controlled machine after the controlled machine is confirmed, so that a cross-network wake-up function is realized, and the scheme is smaller in limitation and wider in controllable controlled machine range compared with the conventional method of broadcasting the remote wake-up signal through a router;
2. the remote wake-up signal sent by the main control machine is provided with the identification code corresponding to the controlled machine, so that the connection between the main control machine and the controlled machine is more accurate, misjudgment is not easy to occur, the main control machine controls the other controlled machine, and the accuracy in use is improved;
3. the working state of the breathing lamp, namely the working state of the main control module, is visualized by the breathing lamp, so that the system is convenient for a worker to check, and is convenient for removing when the system fails, and the error correction efficiency of the system is improved;
4. the serial port downloading chip unit enables UART equipment to be converted into a USB interface, the serial port downloading chip unit provides a virtual serial port for upgrading existing serial port equipment or adding the serial port to a PC, and the serial port voltage stabilizing unit enables a power supply stable point of the serial port downloading chip unit to protect a serial port downloading module.
Drawings
FIG. 1 is a flow chart of an embodiment of a method for remotely waking up the same LAN host using the MQTT protocol;
FIG. 2 is a flow chart before step 10 in an embodiment of a method for remotely waking up the same LAN host using the MQTT protocol;
FIG. 3 is a flowchart of step 20 in an embodiment of a method for remotely waking up the same LAN host using the MQTT protocol;
FIG. 4 is a flowchart of step 40 in an embodiment of a method for remotely waking up the same LAN host using the MQTT protocol according to the present application;
FIG. 5 is a circuit block diagram of a system for remotely waking up the same LAN host using the MQTT protocol;
FIG. 6 is an overall circuit block diagram of an embodiment of a system for remotely waking up the same LAN host using the MQTT protocol;
FIG. 7 is an overall circuit diagram of an embodiment of a system for remotely waking up the same LAN host using the MQTT protocol;
FIG. 8 is a circuit diagram of a master control module of an embodiment of a system for remotely waking up the same LAN host using the MQTT protocol.
Fig. 9 is a circuit diagram of a breathing light module of an embodiment of a system for remotely waking up the same lan host using MQTT protocol.
FIG. 10 is a circuit diagram of an interface module of an embodiment of a system for remotely waking up the same LAN host using the MQTT protocol.
FIG. 11 is a block diagram of a key module of an embodiment of a system for remotely waking up the same LAN host using the MQTT protocol.
FIG. 12 is a circuit diagram of a serial port download module according to an embodiment of the present application for remotely waking up the same LAN host using the MQTT protocol.
Reference numerals illustrate:
1. a power module; 2. a respiratory light module; 3. a key module; 4. a main control module; 5. a serial port downloading module; 51. downloading a chip unit through a serial port; 52. a serial port voltage stabilizing unit; 53. an automatic download unit; 54. an indicator light unit; 6. and an interface module.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to fig. 1 to 10.
In one embodiment, as shown in fig. 1, the application discloses a method for remotely waking up the same lan host by using MQTT protocol, which specifically includes the following steps:
s10: and receiving a remote wake-up signal of the main control machine sent by the MQTT server in real time.
Specifically, the main control machine sends a remote wake-up signal, in the application, the remote wake-up signal sent by the main control machine is a wake-up instruction sent by a small program, the remote wake-up signal is transmitted to the MQTT server, the MQTT server sends the remote wake-up signal to the local router, and the local router receives the remote wake-up signal of the main control machine sent by the MQTT server.
S20: and converting the remote wake-up signal into a wake-up data Packet in a Magic Packet format.
Specifically, the wake-up command (i.e., the remote wake-up signal) sent by the applet is of a string type, and the local router is limited to disable IP directed broadcast, so that it is difficult for the local router to directly broadcast the string to a plurality of different controlled computers in the lan, and the wake-up data Packet in the Magic Packet format can be broadcast to the different controlled computers by the local router.
S30: and sending a wake-up data packet to all the controlled computers in the local area network so as to wake up all the controlled computers.
Specifically, the converted wake-up data Packet in the Magic Packet format is sent to the controlled machine, and the controlled machine is awakened after receiving the wake-up data Packet, so as to realize the function of simultaneously awakening multiple controlled machines in the remote wake-up local area network.
In one embodiment, as shown in fig. 2, before the step S10, before the step of receiving the remote wake-up signal of the host computer sent by the MQTT server in real time, a method for remotely waking up the same lan host computer by using the MQTT protocol further includes:
s101: all the controlled computers in the local area network subscribe to the main control computer through the MQTT protocol.
Specifically, the controlled machine is provided with a power supply, a main board and a network card, the power supply of the controlled machine is an ATX power supply conforming to the ATX2.03 standard, the network card of the controlled machine is provided with a chip supporting WOL, the main board of the controlled machine supports WOL function, the main board of the controlled machine starts WOL function in a power management menu in BIOS, and the controlled machine subscribes to the main control machine through an MQTT protocol to receive a remote wake-up signal sent by the main control machine.
S102: automatically sending Wake On Lan for ASP an installation package to the controlled computers of the subscribed main control computers in the local area network.
Specifically, the Wake On Lan for ASP installation package is sent to the controlled machine, so that the controlled machine has the function of receiving the MQTT instant messaging protocol.
In one embodiment, as shown in fig. 3, in step S30, that is, in the step of sending a wake-up packet to all the controlled computers in the lan to wake up all the controlled computers, specifically includes:
s31: the wake-up data packet comprises identification characters and identification code characters;
specifically, in this embodiment, the network wakeup Packet is a Magic Packet, and its format is: 6 0 xffs plus 16 destination network card MAC addresses, so the total length of the Magic Packet is 6+16×6=102 bytes.
S32: when receiving a remote wake-up signal, identifying identification characters of the network wake-up data packet in real time;
specifically, in this embodiment, the identification character content is: FF-FF-FF-FF-FF, when the identification character is read, the data packet is confirmed to be a network wake-up data packet.
S33: after the identification characters of the network wake-up data packet are identified, the identification code characters are read, and the identification code characters are matched with the unique identification codes of the controlled computers.
Specifically, after the identification character confirms that the data packet is a network awakening data packet, reading a subsequent identification code character, wherein 1-6 bytes of the network awakening data packet are identification characters, each 6 subsequent continuous bytes are identification codes, and the identification codes correspond to the MAC address of the controlled computer.
S34: and matching the identification code in the remote wake-up signal sent by the main control machine with the identification code of the controlled machine, so as to judge the controlled machine in the same local area network pointed by the remote wake-up signal.
Specifically, every 6 subsequent continuous bytes in the remote wake-up signal are matched with the identification code of the controlled machine, so that the controlled machine in the same local area network pointed by the remote wake-up signal is judged.
In one embodiment, as shown in fig. 4, after step S20, that is, after the step of converting the remote wake-up signal into a wake-up Packet in the Magic Packet format, a method for remotely waking up the same lan host using the MQTT protocol further includes:
s201: and sending the wake-up data packet to the local area network router through the UDP protocol.
Specifically, the remote wake-up signal is converted into a wake-up data Packet in a Magic Packet format, and the wake-up data Packet is sent to the local area network router through a UDP protocol.
S202: the lan router receives the wake-up packet.
S203: the local area network router broadcasts a wake-up data packet to all the controlled computers in the local area network.
Specifically, the router broadcasts the converted wake-up data packet to the controlled computers in the local area network, so that the control signals sent by the main control computer are sent to all the controlled computers in the local area network.
In an embodiment, the application further discloses a system for remotely waking up the same lan host by using the MQTT protocol, where the system for remotely waking up the same lan host by using the MQTT protocol corresponds to a method for remotely waking up the same lan host by using the MQTT protocol in the above embodiment, as shown in fig. 5 and 6: a system for remotely waking up the same lan host using MQTT protocol comprising: the breathing lamp comprises a power module 1, a main control module 4, an interface module 6, a serial port downloading module 5, a breathing lamp module 2 and a key module 3, wherein the output end of the power module 1 is coupled with the power input end of the main control module 4, a first signal end A of the main control module 4 is coupled with a first signal end A of the serial port downloading module 5, a second signal end B of the main control module 4 is coupled with the key module 3, a third signal end C of the main control module 4 is coupled with the breathing lamp module 2, and a second signal end B of the serial port downloading module 5 is coupled with a first signal end of the interface module 6.
As shown in fig. 7 and 8, in this embodiment, the main control module 4 is an ESP32WIFI chip, the ESP32WIFI chip includes 38 pins, the 1 pin of the ESP32WIFI chip is grounded, the 2 pin of the ESP32WIFI chip is used for accessing a 3.3V power supply, that is, the 2 pin of the ESP32WIFI chip is a power supply input end of the main control module 4, and the 30 pin, 31 pin, 34 pin and 35 pin of the ESP32WIFI chip are first signal ends a of the main control module 4, that is, the 30 pin, 31 pin, 34 pin and 35 pin of the ESP32WIFI chip are all coupled with the serial port download module 5.
As shown IN fig. 7, the power module 1 includes a voltage stabilizer U1, a capacitor C2, a capacitor C3, and a polarity capacitor C4, where IN this embodiment, the voltage stabilizer U1 is ASM1117—3.3, the voltage stabilizer U1 includes 4 pins, pin 1 of the voltage stabilizer U1 is an ADJ pin for grounding, pin 3 of the voltage stabilizer U1 is an IN pin, pin 2 and pin 4 of the voltage stabilizer U1 are both output ends, pin IN of the voltage stabilizer U1 is used for accessing 5V voltage, pin IN of the voltage stabilizer U1 is coupled with one end of the capacitor C2, and the other end of the capacitor C2 is grounded; the pin 2 and the pin 4 of the voltage stabilizer U1 are both coupled with one end of a capacitor C3, and the other end of the capacitor C3 is grounded; the pin 2 and the pin 4 of the voltage stabilizer U1 are also coupled with the positive electrode of the polar capacitor C4, and the other end of the polar capacitor C4 is grounded; the output end of the voltage stabilizer U1 is coupled with the power input end of the main control module 4, namely, the 2 pin and the 4 pin of the voltage stabilizer U1 are both coupled with the 1 pin of the ESP32WIFI chip.
As shown in fig. 6 and 7, the serial port download module 5 includes a serial port download chip unit 51 for converting UART devices into USB interfaces, an automatic download unit 53, an indicator light unit 54, and a serial port voltage stabilizing unit 52, a first signal end a of the serial port download chip unit 51 is a first signal end a of the serial port download module 5, a second signal end B of the serial port download chip unit 51 is coupled to the first signal end a of the automatic download unit 53, a second signal end B of the automatic download unit 53 is a second signal end of the serial port download unit, and a third signal end of the serial port download chip unit 51 is coupled to a signal end of the serial port voltage stabilizing unit 52.
As shown in fig. 7 and 12, the serial port download chip unit 51 includes a chip U2 for converting an existing UART device into a USB interface; the automatic download unit 53 includes a resistor R1, a resistor R4, a transistor Q1, and a transistor Q2; the serial port indicator lamp unit 54 includes a resistor R5, a resistor R6, a light emitting diode LED3, and a light emitting diode LED4, and the serial port voltage stabilizing unit 52 includes a crystal voltage stabilizer X2; in this embodiment, the chip U2 is a CH340G chip, the CH340G chip includes 16 pins, pin 13 of the chip U2 is coupled with one end of a resistor R4, the other end of the resistor R4 is coupled with a base of a triode Q2, pin 14 of the chip U2 is coupled with one end of a resistor R1, pin 14 of the chip U2 is further coupled with an emitter of the triode Q2, the other end of the resistor R1 is coupled with a base of the triode Q1, the emitter of the triode Q1 is coupled with pin 13 of the chip U2, pin 1 of the chip U2 is grounded, pin 2 of the chip U2 is coupled with one end of a resistor R6, the other end of the resistor R6 is used for switching on a power supply, pin 3 of the chip U2 is coupled with one end of a resistor R5, pin 3 of the resistor R5 is used for switching on a power supply, pin 7 of the chip U2 is coupled with pin 3 of the triode Q2, pin 8 of the chip U2 is coupled with pin 3 of the crystal oscillator X2, pin 1 of the chip U2 is coupled with pin 5 of the crystal oscillator, pin 2 is coupled with pin 5 of the chip U2 is connected with a serial port B2 of the chip 2, and pin 5 of the chip 2 is coupled with pin 2 of the first chip 2 and pin 2 is connected with a serial port of the chip 2.
As shown in fig. 7 and 10, the interface module 6 includes an interface TYPE-C, a resistor R2 and a resistor R3, the A1 pin and the B1 pin of the interface TYPE-C are grounded, the A8 pin of the interface TYPE-C is coupled with the resistor R2, the other end of the resistor R2 is grounded, the B8 pin of the interface TYPE-C is coupled with the resistor R3, the other end of the resistor R3 is grounded, the B6 pin of the interface TYPE-C is coupled with the 5 pin of the chip U2, and the B7 pin of the interface TYPE-C is coupled with the 6 pin of the chip U2.
As shown in fig. 7 and 9, the breathing lamp module 2 includes a lamp LED1, a lamp LED2 and a light emitting diode LED5, the lamp LED1 and the lamp LED2 each include 4 pins, the 4 pins of the lamp LED1 and the lamp LED2 are coupled with the output end of the voltage stabilizer U1, the 2 pins of the lamp LED1 and the lamp LED2 are grounded, the 3 pin of the lamp LED1 is coupled with the 25 pin of the ESP32WIFI chip, and the 1 pin of the lamp LED1 is coupled with the 3 pin of the lamp LED 2.
As shown in fig. 7 and 11, the key module 3 includes a restart key unit and a start key unit, the restart key unit includes a key EN, a resistor R9 and a resistor R11, pin 1 of the EN key is grounded, pin 2 of the EN key is coupled with one end of the resistor R9, the other end of the resistor R9 is coupled with one end of the resistor R11, the other end of the resistor R11 is coupled with the output end of the voltage stabilizer U1, an EN wiring port is coupled between the resistor R9 and the resistor R11, and the EN wiring port is coupled with pin 3 of the ESP32WIFI chip; the starting key unit comprises a key BOOT, a resistor R8 and a resistor R10, wherein a pin 1 of the BOOT key is grounded, a pin 2 of the BOOT key is coupled with one end of the resistor R8, the other end of the resistor R8 is coupled with one end of the resistor R10, the other end of the resistor R10 is coupled with the output end of the voltage stabilizer U1, a GPOI9 wiring port is coupled between the resistor R8 and the resistor R10, and the GPIO9 wiring port is coupled with a pin 25 of the ESP32WIFI chip.
The implementation principle of the system for remotely waking up the same LAN host by utilizing the MQTT protocol in the embodiment of the application is as follows: the CH340G chip converts UART equipment into a USB interface, the USB interface is connected with a router through a TYPE-C interface, an installation packet is sent to a controlled machine connected with the router, each controlled machine is connected with the router to form a local area network, when the main control machine sends a remote wake-up signal to the router through a program, the router sends the remote wake-up signal to an ESP32WIFI chip of the singlechip after receiving the remote wake-up signal, the ESP32WIFI chip converts the remote wake-up signal into a wake-up data packet in a Magic packet format, the wake-up data packet is sent to the router through a UDP protocol, the router broadcasts the wake-up data packet to each controlled machine, the controlled machine in the local area network broadcasts the wake-up data packet, after receiving the wake-up data packet, the controlled machine matches the MAC address in the wake-up data packet with the MAC address of the controlled machine (namely, the identification code character in the data packet is matched with the identification code of the controlled machine, and if the two are matched, the controlled machine receives a remote wake-up instruction to start; if the two data packets are not matched, the controlled machine discards the awakening data packet, so that the function of remotely awakening the controlled machine across the network by the main control machine is realized, and the main control machine can awaken all the hosts in the same local area network.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the embodiments and the corresponding technical solutions, and are intended to be included in the scope of the present application.

Claims (10)

1. A method for remotely waking up the same lan host using MQTT protocol, comprising the steps of:
receiving a remote wake-up signal of a main control machine sent by an MQTT server in real time;
converting the remote wake-up signal into a wake-up data Packet in a Magic Packet format;
and sending a wake-up data packet to all the controlled computers in the local area network so as to wake up all the controlled computers.
2. A method for remotely waking up the same lan host using MQTT protocol as claimed in claim 1, wherein before the step of receiving in real time the remote wake-up signal of the host machine transmitted by the MQTT server, it comprises:
all controlled computers in the local area network subscribe to the main control computer through an MQTT protocol;
automatically sending Wake On Lan for ASP an installation package to the controlled computers of the subscribed main control computers in the local area network.
3. The method for remotely waking up the same lan host using MQTT protocol as claimed in claim 1, wherein the step of sending wake-up packets to all the controlled computers in the lan to wake up all the controlled computers comprises:
the wake-up data packet comprises identification characters and identification code characters;
when the controlled machine receives the wake-up data packet, identifying identification characters in the wake-up data packet in real time;
after the controlled computer identifies the identification character of the wake-up data packet, reading the identification code character;
the controlled machine judges whether the identification code character is matched with the unique identification code of the controlled machine;
if yes, the controlled machine is started.
4. The method for remotely waking up the same lan host using MQTT protocol as claimed in claim 1, wherein after the step of converting the remote wake-up signal into a wake-up Packet in a Magic Packet format, the method comprises:
sending a wake-up data packet to a local area network router through a UDP protocol;
the local area network router receives the wake-up data packet;
the local area network router broadcasts a wake-up data packet to all the controlled computers in the local area network.
5. A system for remotely waking up a same lan host using MQTT protocol, based on the method for remotely waking up a same lan host using MQTT protocol as set forth in any one of claims 1 to 4, characterized in that: the serial port downloading device is characterized by comprising a power supply module (1), a main control module (4), an interface module (6) and a serial port downloading module (5), wherein the output end of the power supply module (1) is coupled with the main control module (4), a first signal end A of the main control module (4) is coupled with a first signal end A of the serial port downloading module (5), a second signal end B of the main control module (4) is used for being externally connected with a computer, a second signal end B of the serial port downloading module (5) is coupled with a first signal end of the interface module (6), and the interface module (6) is used for being externally connected with the computer.
6. The method for remotely waking up the same lan host according to claim 5, further comprising a breathing light module (2), wherein the breathing light module (2) is coupled to the second signal end of the main control module (4), and the breathing light module (2) is configured to prompt the working state of the main control module (4).
7. The method according to claim 6, wherein the serial port download module (5) includes a serial port download chip unit (51), an automatic download unit (53) and a serial port voltage stabilizing unit (52) for converting UART devices into USB interfaces, a first signal end a of the serial port download chip unit (51) is the first signal end a of the serial port download module (5), a second signal end B of the serial port download chip unit (51) is coupled with the first signal end a of the automatic download unit (53), a second signal end B of the automatic download unit (53) is the second signal end of the serial port download unit, and a third signal end of the serial port download chip unit (51) is coupled with the signal end of the serial port voltage stabilizing unit (52).
8. The method for remotely waking up the same lan host using MQTT protocol according to claim 7, wherein the serial port download module (5) further comprises a serial port indicator light unit (54), one end of the serial port indicator light unit (54) is used for being connected to power, and the other end of the serial port indicator light is coupled to the fourth signal end of the serial port download chip unit (51).
9. The method for remotely waking up the same lan host according to claim 8, further comprising a key module (3) for controlling on/off, wherein a signal terminal of the key module (3) is coupled to the third signal terminal C of the main control module (4).
10. A method for remotely waking up the same lan host using MQTT protocol according to claim 9, wherein the serial download chip unit (51) comprises a chip U2 for converting an existing UART device into a USB interface; the automatic downloading unit (53) comprises a resistor R1, a resistor R4, a triode Q1 and a triode Q2; the serial port indicator lamp unit (54) comprises a resistor R5, a resistor R6, a Light Emitting Diode (LED) 3 and a Light Emitting Diode (LED) 4, and the serial port voltage stabilizing unit (52) comprises a crystal voltage stabilizer X2; the 13 pin of the chip U2 is coupled with one end of the resistor R4, the other end of the resistor R4 is coupled with the base electrode of the triode Q2, the 14 pin of the chip U2 is coupled with one end of the resistor R1, the 14 pin of the chip U2 is also coupled with the emitter electrode of the triode Q2, the other end of the resistor R1 is coupled with the base electrode of the triode Q1, the emitter electrode of the triode Q1 is coupled with the 13 pin of the chip U2, the 1 pin of the chip U2 is grounded, the 2 pin of the chip U2 is coupled with one end of the resistor R6, the other end of the resistor R6 is used for being connected with a power supply, the LED4 is coupled between the chip U2 and the resistor R6, the 3 pins of the chip U2 are coupled with one end of the resistor R5, the other end of the resistor R5 is used for being connected with a power supply, the LED3 is coupled between the resistor R5 and the 3 pins of the chip U2, the 7 pins of the chip U2 are coupled with the 3 pins of the crystal oscillator X2, the 8 pins of the chip U2 are coupled with the 1 pins of the crystal oscillator X2, the 2 pins of the crystal oscillator X2 are grounded, the 5 pins and the 6 pins of the chip U2 are the second signal end B of the serial port downloading module (5), and the 5 pins and the 6 pins of the chip U2 are coupled with the first signal end A of the serial port downloading module (5).
CN202310225631.2A 2023-03-09 Method and system for remotely waking up same local area network host by utilizing MQTT protocol Active CN116260869B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310225631.2A CN116260869B (en) 2023-03-09 Method and system for remotely waking up same local area network host by utilizing MQTT protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310225631.2A CN116260869B (en) 2023-03-09 Method and system for remotely waking up same local area network host by utilizing MQTT protocol

Publications (2)

Publication Number Publication Date
CN116260869A true CN116260869A (en) 2023-06-13
CN116260869B CN116260869B (en) 2024-06-21

Family

ID=

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1878071A (en) * 2006-07-05 2006-12-13 刘文斌 Computer remote wakeup method and device based on network
CN103414575A (en) * 2013-08-01 2013-11-27 广州杰赛科技股份有限公司 Method, system and device for network wakeup
CN107659414A (en) * 2017-10-13 2018-02-02 深圳市尚云互联技术有限公司 Remote wakening system and method based on P2P
CN212113216U (en) * 2020-04-14 2020-12-08 邢台职业技术学院 Computer capable of waking up work by voice
CN215006627U (en) * 2021-06-24 2021-12-03 广东辰奕智能科技股份有限公司 Serial port downloading circuit
CN215599680U (en) * 2021-07-22 2022-01-21 广州市多边形部落科技有限公司 Programmable integrated circuit
CN115378989A (en) * 2022-08-10 2022-11-22 上海黑眸智能科技有限责任公司 MQTT topic subscription system, method, terminal and medium based on wake-up channel

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1878071A (en) * 2006-07-05 2006-12-13 刘文斌 Computer remote wakeup method and device based on network
CN103414575A (en) * 2013-08-01 2013-11-27 广州杰赛科技股份有限公司 Method, system and device for network wakeup
CN107659414A (en) * 2017-10-13 2018-02-02 深圳市尚云互联技术有限公司 Remote wakening system and method based on P2P
CN212113216U (en) * 2020-04-14 2020-12-08 邢台职业技术学院 Computer capable of waking up work by voice
CN215006627U (en) * 2021-06-24 2021-12-03 广东辰奕智能科技股份有限公司 Serial port downloading circuit
CN215599680U (en) * 2021-07-22 2022-01-21 广州市多边形部落科技有限公司 Programmable integrated circuit
CN115378989A (en) * 2022-08-10 2022-11-22 上海黑眸智能科技有限责任公司 MQTT topic subscription system, method, terminal and medium based on wake-up channel

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
林徐;张继山;: "互联网上远程终端唤醒技术与实现", 湖南城市学院学报(自然科学版), no. 05, pages 1 *
雷学堂,牛乐乐,侯周国,胡智元: "《MicroPython开发与实战》", 北京航空航天大学出版社, pages: 173 - 175 *

Similar Documents

Publication Publication Date Title
RU2698708C2 (en) Apparatus, method and system for controlling load device through power line using power matching protocol
US7483966B2 (en) Systems, methods, and media for remote wake-up and management of systems in a network
US8930517B2 (en) Server rack system
US20090133040A1 (en) Systems and Methods for Providing Wake On LAN (WoL) Support
CN105045599A (en) Television and computer integrated machine and method for realizing remote startup and shutdown control of same
TWI488458B (en) Computer system and remote control method for computer device
CN112753197B (en) Network management using wake-on-LAN
CN204633817U (en) A kind of remote desktop control system
CN116260869B (en) Method and system for remotely waking up same local area network host by utilizing MQTT protocol
CN103941617A (en) Remote control device and equipment through network
CN116260869A (en) Method and system for remotely waking up same local area network host by utilizing MQTT protocol
CN104348645A (en) Server and data transmission method of server
CN211403175U (en) Computer remote control start-up system
CN104219061B (en) Request the method and device of power consumption state variation
CN113193970A (en) Ethernet power supply architecture
WO2024113767A1 (en) Power-on method and power-on apparatus for smart network interface cards
US11177977B2 (en) Method and system for GRE tunnel control based on client activity detection
CN104346209A (en) Updating method of substrate management controller
Foster Xbee cookbook issue 1.4 for series 1 (freescale) with 802.15. 4 firmware
CN109753472B (en) Data processing method and device
US20210157384A1 (en) Assigning power sources
CN206099992U (en) Low -power dissipation optical module
US9665156B2 (en) Systems and methods for providing wake-on-LAN (WoL) support
CN215729734U (en) Core board and server
CN117234558A (en) Firmware upgrading method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant