Summary of the invention
Object of the present invention is intended to solve at least to a certain extent above-mentioned technical problem.
For this reason, the object of the invention is to propose a kind of water heater and the control method thereof that can control the reset of WIFI module in the situation that WIFI module crashes.
For achieving the above object, first aspect present invention embodiment has proposed a kind of water heater, comprising: controller, described controller at least comprises transmission pin, receives pin, enable pin, power pin, ground pin, wherein, described power pin is connected with power supply, described ground pin ground connection, interface, described interface comprises first end to the four ends, WIFI module, described WIFI module comprises data sending terminal, data receiver, earth terminal and power end, described data sending terminal is connected by the first end of described interface and the reception pin of described controller, described data receiver is connected by the second end of described interface and the transmission pin of described controller, described earth terminal is by the 3rd end ground connection of described interface, described power end is connected with the enable pin of described controller by the 4th end of described interface, wherein, described WIFI module sends heartbeat data packets every Preset Time to described controller, described controller judges whether to receive the heartbeat data packets that described WIFI module sends, and if not, by described enable pin output control signal, controlling described WIFI module resets.
The water heater proposing according to the embodiment of the present invention, by the enable pin of controller, control the power supply of WIFI module, controller is by judging whether whether the heartbeat data packets that receives the transmission of WIFI module normally works to detect WIFI module, and in the situation that WIFI module crashes, by enable pin, control WIFI module and reset, so that WIFI module recovery is normally worked.
In one embodiment of the invention, described WIFI module and described Interface integration setting.
In one embodiment of the invention, described controller is exported the first level signal by described enable pin and is controlled described WIFI module and start, and described controller quits work by WIFI module described in described enable pin output second electrical level signal controlling.
Particularly, in one embodiment of the invention, described water heater also comprises: the first resistance, and one end of described the first resistance is connected with the transmission pin of described controller and the second end of described interface, and the other end of described the first resistance is connected with power supply; The second resistance, one end of described the second resistance is connected with the reception pin of described controller and the first end of described interface, and the other end of described the second resistance is connected with power supply.
For achieving the above object, second aspect present invention embodiment has proposed a kind of control method of water heater, described water heater comprises controller and WIFI module, and described controller is controlled the power supply of described WIFI module by enable pin, and described control method comprises the steps:
S1, described controller is exported the first level signal by described enable pin and is controlled described WIFI module and start;
S2, described WIFI module sends heartbeat data packets every Preset Time to described controller;
S3, described controller judges whether to receive the heartbeat data packets that described WIFI module sends, and if not, described controller is controlled described WIFI module by described enable pin output control signal and resetted.
The control method of the water heater proposing according to the embodiment of the present invention, can make water heater by the enable pin of controller, control the power supply of WIFI module, controller is by judging whether whether the heartbeat data packets that receives the transmission of WIFI module normally works to detect WIFI module, and in the situation that WIFI module crashes, by enable pin, control WIFI module and reset, so that WIFI module recovery is normally worked.In addition, this control method is simple and reliable.
In one embodiment of the invention, described controller is exported control signal by enable pin and is controlled WIFI module and reset and further comprise:
Described controller quits work by WIFI module described in described enable pin output second electrical level signal controlling;
Described controller is exported described the first level signal by described enable pin and is controlled described WIFI module and start after Preset Time.
The aspect that the present invention is additional and advantage in the following description part provide, and part will become obviously from the following description, or recognize by practice of the present invention.
The specific embodiment
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has the element of identical or similar functions from start to finish.Below by the embodiment being described with reference to the drawings, be exemplary, only for explaining the present invention, and can not be interpreted as limitation of the present invention.
In addition, term " first ", " second " be only for describing object, and can not be interpreted as indication or hint relative importance or the implicit quantity that indicates indicated technical characterictic.Thus, one or more these features can be expressed or impliedly be comprised to the feature that is limited with " first ", " second ".In description of the invention, the implication of " a plurality of " is two or more, unless otherwise expressly limited specifically.
In description of the invention, it should be noted that, unless otherwise prescribed and limit, term " installation ", " being connected ", " connection " should be interpreted broadly, for example, can be mechanical connection or electrical connection, also can be the connection of two element internals, can be to be directly connected, and also can indirectly be connected by intermediary, for the ordinary skill in the art, can understand as the case may be the concrete meaning of above-mentioned term.
With reference to description and accompanying drawing below, these and other aspects of embodiments of the invention will be known.These describe and accompanying drawing in, specifically disclose some specific implementations in embodiments of the invention, represent to implement some modes of the principle of embodiments of the invention, still should be appreciated that the scope of embodiments of the invention is not limited.On the contrary, embodiments of the invention comprise spirit and all changes within the scope of intension, modification and the equivalent that falls into additional claims.
The water heater that embodiment proposes to the first aspect of the present invention is with reference to the accompanying drawings described.
As shown in Figure 2, the water heater that the embodiment of the present invention proposes comprises controller 100, interface 200 and WIFI module 300.Wherein, controller 100 at least comprises transmission pin 101, receives pin 102, enable pin 103, power pin 104, ground pin 105, wherein, power pin 104 is connected with power supply, ground pin 105 ground connection, particularly, power supply is+5V, is controller 100 power supplies.Interface 200 comprises first end 201, the second end 202, the 3rd end 203 and the 4th end 204.WIFI module 300 comprises data sending terminal 301, data receiver 302, earth terminal 303 and power end 304, data sending terminal 301 is connected by the first end 201 of interface 200 and the reception pin 102 of controller 100, data receiver 302 is connected with the transmission pin 101 of controller 100 by the second end 202 of interface 200, earth terminal 303 is by the 3rd end 203 ground connection of interface 200, and power end 304 is connected with the enable pin 103 of controller 100 by the 4th end 204 of interface 200.Wherein, WIFI module 300 sends heartbeat data packets every Preset Time to controller 100, controller 100 judges whether to receive the heartbeat data packets that WIFI module 300 sends, and if not, controls WIFI module 300 reset by enable pin 103 output control signals.
Particularly, in one embodiment of the invention, after WIFI module 300 powers on, to controller 100, send heartbeat data packets, time delay a period of time, continue to send heartbeat data packets to controller 100.Correspondingly, controller 100 is by judging whether whether whether the heartbeat data packets that receives 300 transmissions of WIFI module normally works to detect WIFI module 300, reset thereby control WIFI module 300.Say, after controller 100 powers on, enable pin 103 is set high and powered on to WIFI module 300, time delay a period of time, wait for that WIFI module 300 sends heartbeat data packets, judge whether the heartbeat data packets of receiving that WIFI module 300 sends, if controller 100 has been received heartbeat data packets, think that WIFI module 300 is in normal work, if a period of time is not received heartbeat data packets, think that WIFI module 300 extremely for example crashes, need to carry out reset operation to WIFI module 300, to the first power-off of WIFI module 300, then power on.
In an embodiment of the present invention, controller 100 can be controlled by enable pin 103 power end 304 of WIFI module 300, thereby controls the power supply of WIFI module 300.Particularly, in one embodiment of the invention, controller 100 is controlled WIFI module 300 by enable pin 103 output the first level signals and is started, and controller 100 quits work by enable pin 103 output second electrical level signal controlling WIFI modules 300.Wherein, the first level signal is high level, and second electrical level signal is low level, that is to say, controller 100 is controlled the power supply of WIFI module 300 by enable pin 103, if enable pin 103 is high level, WIFI module 300 powers on, once this enable pin 103 becomes low level, WIFI module 300 loses power supply, particularly, when this enable pin 103 becomes high level again, represent WIFI module 300 to re-power.So just completed the once reset operation to WIFI module 300.
In a specific embodiment of the present invention, as shown in Figure 2, this water heater also comprises the first resistance R 1 and the second resistance R 2.One end of the first resistance R 1 is connected with the transmission pin 101 of controller 100 and the second end 202 of interface 200, the other end of the first resistance R 1 is connected with power supply, one end of the second resistance R 2 is connected with the reception pin 102 of controller 100 and the first end 201 of interface 200, and the other end of the second resistance R 2 is connected with power supply.Wherein, power supply is+5V.Wherein, in an example of the present invention, the resistance of the first resistance R 1 is 10K ohm, and the resistance of the second resistance R 2 is 10K ohm.
Wherein, in one embodiment of the invention, WIFI module 300 and interface 200 can integratedly arrange.
The water heater proposing according to the embodiment of the present invention, by the enable pin of controller, control the power supply of WIFI module, controller is by judging whether whether the heartbeat data packets that receives the transmission of WIFI module normally works to detect WIFI module, and in the situation that WIFI module crashes, by enable pin, control WIFI module and reset, so that WIFI module recovery is normally worked.
The control method of the water heater below second aspect present invention embodiment being proposed is described.Wherein, water heater comprises controller and WIFI module, and controller is controlled the power supply of WIFI module by enable pin.
As shown in Figure 3, the control method of the water heater that the embodiment of the present invention proposes, comprises the steps:
S1, controller is exported the first level signal control WIFI module by enable pin and is started.
Wherein, the first level signal is high level, says, controller is by setting high enable pin to WIFI module and power on.
S2, WIFI module sends heartbeat data packets every Preset Time to controller.
After step S1, after WIFI module powers on, WIFI module sends heartbeat data packets to controller, and continues over time to send heartbeat data packets to controller.
S3, controller judges whether to receive the heartbeat data packets that WIFI module sends, and if not, controller is exported control signal control WIFI module by enable pin and resetted.
Particularly, if controller receives the heartbeat data packets that WIFI module sends, think that WIFI module normally works, on the contrary, if controller does not receive the heartbeat data packets that WIFI module sends, think that WIFI module extremely for example crashes, need to carry out reset operation to WIFI module, by enable pin, export control signal control WIFI module and reset.
Particularly, in one embodiment of the invention, controller is exported the reset of control signal control WIFI module by enable pin and is further comprised: controller is exported second electrical level signal controlling WIFI module by enable pin and quit work; Controller is exported the first level signal control WIFI module by enable pin and is started after Preset Time.Wherein, the first level signal is high level, and second electrical level signal is low level.Particularly, the in the situation that of the abnormal deadlock of WIFI module, controller is first set to enable pin low level makes WIFI module lose power supply, and after a period of time, controller is set to enable pin high level again re-powers WIFI module.So just completed the once reset operation to WIFI module.
In a specific embodiment of the present invention, as shown in Figure 4, the control method of above-mentioned water heater comprises the steps:
S401, controller powers on.
S402, controller sets high enable pin, powers on to WIFI module.
S403, time delay a period of time, waits for that WIFI module sends heartbeat data packets.
Particularly, after WIFI module powers on, WIFI module sends heartbeat data packets to controller, continues over time to send heartbeat data packets to controller.
S404, controller judges whether the heartbeat data packets of receiving that WIFI module sends, if so, returns to step S402, otherwise enters next step, be i.e. step S405.
S405, controller sets low enable pin, that is, make WIFI module lose power supply.
Particularly, when controller does not receive WIFI module transmission heartbeat data packets, judgement WIFI module extremely for example crashes, and controller sets low enable pin, makes WIFI module lose power supply, enters next step.
S406, time delay a period of time, return to step S402, controller sets high enable pin again and powers on to WIFI module.
Particularly, the in the situation that of the abnormal deadlock of WIFI module, controller is first set to enable pin low level makes WIFI module lose power supply, and after a period of time, controller is set to enable pin high level again re-powers WIFI module.So just completed the once reset operation to WIFI module, made WIFI module recovery to original state, recovered normally to work.
The control method of the water heater proposing according to the embodiment of the present invention, can make water heater by the enable pin of controller, control the power supply of WIFI module, controller is by judging whether whether the heartbeat data packets that receives the transmission of WIFI module normally works to detect WIFI module, and in the situation that WIFI module crashes, by enable pin, control WIFI module and reset, so that WIFI module recovery is normally worked.In addition, this control method is simple and reliable.
In flow chart or any process of otherwise describing at this or method describe and can be understood to, represent to comprise that one or more is for realizing module, fragment or the part of code of executable instruction of the step of specific logical function or process, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can be not according to order shown or that discuss, comprise according to related function by the mode of basic while or by contrary order, carry out function, this should be understood by embodiments of the invention person of ordinary skill in the field.
The logic and/or the step that in flow chart, represent or otherwise describe at this, for example, can be considered to for realizing the sequencing list of the executable instruction of logic function, may be embodied in any computer-readable medium, for instruction execution system, device or equipment (as computer based system, comprise that the system of processor or other can and carry out the system of instruction from instruction execution system, device or equipment instruction fetch), use, or use in conjunction with these instruction execution systems, device or equipment.With regard to this description, " computer-readable medium " can be anyly can comprise, storage, communication, propagation or transmission procedure be for instruction execution system, device or equipment or the device that uses in conjunction with these instruction execution systems, device or equipment.The example more specifically of computer-readable medium (non-exhaustive list) comprises following: the electrical connection section (electronic installation) with one or more wirings, portable computer diskette box (magnetic device), random-access memory (ram), read-only storage (ROM), the erasable read-only storage (EPROM or flash memory) of editing, fiber device, and portable optic disk read-only storage (CDROM).In addition, computer-readable medium can be even paper or other the suitable medium that can print described program thereon, because can be for example by paper or other media be carried out to optical scanner, then edit, decipher or process in electronics mode and obtain described program with other suitable methods if desired, be then stored in computer storage.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, a plurality of steps or method can realize with being stored in memory and by software or the firmware of suitable instruction execution system execution.For example, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: have for data-signal being realized to the discrete logic of the logic gates of logic function, the special IC with suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is to come the hardware that instruction is relevant to complete by program, described program can be stored in a kind of computer-readable recording medium, this program, when carrying out, comprises step of embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can be also that the independent physics of unit exists, and also can be integrated in a module two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and also can adopt the form of software function module to realize.If described integrated module usings that the form of software function module realizes and during as production marketing independently or use, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium of mentioning can be read-only storage, disk or CD etc.
In the description of this description, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or example in conjunction with specific features, structure, material or the feature of this embodiment or example description.In this manual, the schematic statement of above-mentioned term is not necessarily referred to identical embodiment or example.And the specific features of description, structure, material or feature can be with suitable mode combinations in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, for the ordinary skill in the art, be appreciated that without departing from the principles and spirit of the present invention and can carry out multiple variation, modification, replacement and modification to these embodiment, scope of the present invention is by claims and be equal to and limit.