DIY remote control switch (tiny6410 + LED + yeelink + curl)

Source: Internet
Author: User

The last time I introduced how to remotely monitor the indoor temperature, I am very pleased with the enthusiastic response. But then again, the implementation can only be remote monitoring of the temperature in the home. If you find that the home is very hot and want to remotely turn on the air conditioner switch to reduce the temperature in advance, it will not be very good after you go home. How can this be done. The following describes how to implement remote control. Of course, the author's house does not have DIY air-conditioning devices that can be remotely controlled, but can't it be achieved? NO. Fortunately, the tiny6410 Development Board has LED lights that can be controlled to realize the remote switch of LED lights. Then, a relay is added to remotely control the air conditioner. The principle is similar.

DIY Remote Monitoring indoor temperature device (tiny6410 + ds18b20 + yeelink + curl) http://www.cnblogs.com/IDoIUnderstand/p/3537858.html I. PurposeDIY is a simple remote control switch that enables or disables the control switch through web/android/ios. Ii. software and hardware environmentHardware: tiny6410 + LED + wired network or USB wifi software: linux + QT/curl/crontab/shell/YeeLink Service Iii. LED Control MethodHere, the built-in led driver and control method of tiny6410 are directly used for LED control. The method is as follows: 1. Register a switch sensor according to reference 1. 2. query the status of the switch sensor based on yeelink api. Use shell scripts on tiny6410 linux.
 #!/bin/    YL_ApiKey= YL_URL=http:   upcmd=    $upcmd |   > /dev/shm/  -wq \     [ $status =  /etc/rc.d/init.d/    /etc/rc.d/init.d/   

 

 6. added the scheduled operation service.Add the following red line to the crontab service to run the script once every minute. Save and exit.The yeelink platform provides two methods. One is to connect the arduino/single-chip microcomputer to the platform through a direct socket network to maintain a persistent connection with the server, this method has relatively strong real-time control. The other method is that arduino, as the client, regularly queries the current value of the sensor (LED) from the server, if we want to change the status of arduino (such as LED lighting), we only need to change the value of the current sensor (in fact, it is to send the HTTP post command to update the current device status ), when arduino sends an HTTP get command to obtain the current LED status during the scheduled period, it finds that the recent value changes (from 0 to 1, the status of the I/O port of the LED is changed accordingly, so as to implement remote control. Note that on the arduino board, if it is a trigger operation (only one operation ), after the get data is processed, you can directly send a POST to change the status of the sensor on the server, so that it will not be repeatedly triggered on the arduino end.1. How to use arduino + ethernet shield and yeelink combined with 5 minutes to achieve web remote appliance control (code updated) http://blog.yeelink.net /? P = 942, 04-Tiny6410 linux -20110809.pdf

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.