DIY remote indoor temperature monitoring equipment (tiny6410 + ds18b20 + yeelink + curl)

Source: Internet
Author: User

Spring Festival, taking advantage of the free time of the holiday, took the time to drum up the tiny6410 Development Board, found this Dongdong dust for a long time, has not been used for a long time. Like the recent Iot boom, Google acquired Nest and Its thermostat was designed to intelligently adjust and remotely control the room temperature. The UI and design philosophy were both great. Internet of Things (IOT) is something that Baidu and google can get a lot of comments or concepts. But what is it? I 'd like to try it out by DIY.

  I. PurposeDIY, an electronic device that can easily remotely monitor indoor temperature and view the temperature in the house through web/android/ios/ Ii. software and hardware environmentHardware: tiny6410 + ds18b20 + wired network or USB wifi software: linux + QT/curl/crontab/shell/YeeLink Service (cloud storage, various access methods, web/android/ios/even Weibo, emails, and social network sharing) Iii. ds18b20 drivers and ApplicationsSee reference 5. The source code is as follows: DS18B20 RAR. 4. curl porting to tiny64101. Port openssl to tiny6410. Download openssl-1.0.0l.tar.gz unzip tar xzvf openssl-1.0.0l.tar.gz configuration compilation (cross-compilation in ubuntu)
 #!/bin/ export LD_LIBARY_PATH=/opt/FriendlyARM/toolschain/./lib/ export CPPFLAGS=-I/opt/FriendlyARM/toolschain/./include/ export LDFLAGS=-L/opt/FriendlyARM/toolschain/./lib/ export CC=/opt/FriendlyARM/toolschain/./bin/arm-linux-  cd openssl-. ./config no-asm --prefix=/home/share/tool/tiny6410/openssl os/compiler:/opt/FriendlyARM/toolschain/./bin/arm-linux-   

 

2. Port curl to tiny6410. Download openssl-1.0.0l.tar.gz unzip tar xzvf curl-7.35.0.tar.gz configuration compilation (cross-compilation in ubuntu)
 #!/bin/ export LD_LIBARY_PATH=/opt/FriendlyARM/toolschain/./lib/ export CPPFLAGS=-I/opt/FriendlyARM/toolschain/./include/ export LDFLAGS=-L/opt/FriendlyARM/toolschain/./lib/ export CC=/opt/FriendlyARM/toolschain/./bin/arm-linux-  cd curl-. ./configure --host=i686 --target=arm-linux --prefix=/home/share/tool/tiny6410/curl --with-ssl=/home/share/tool/tiny6410/openssl --with-random=/dev/   

 

V. yeelink EnvironmentTo achieve remote monitoring, yeelink uses the free cloud storage server and related clients (android/IOS/service number/Weibo release) based on Iot applications as an Iot application, the platform is really good. 1. Register yeelink users, add devices, add sensors, upload data, and retrieve data. For more information, see http://www.yeelink.net/2?#yeelink's apiinterface for data transmission. Use shell scripts to call the curl tool on tiny6410 linux.
 #!/bin/   YL_ApiKey= YL_URL=http: temp=$(/dev/shm/   upcmd=   $upcmd|

6. Use busybox crontab1. Add the following red line to the crontab service to run the script once every minute. Save and exit. 2. Enable the crond Service (tiny6410 linux + qt is not enabled by default ).
 [root@FriendlyARM crontabs]# crond& [root@FriendlyARM crontabs]#        root            root               root          SW   [ksoftirqd/      root          SW   [kworker/u:      root          SW<    root             root          SW   [bdi-    root          SW<    root             root          SW<    root          SW   [kworker/:    root             root             root             root          SW<    root          SW<    root          SW<    root             root             root             root             root          SW   [pvrusb2-    root          SW   [kworker/u:    root             root          SW   [mmcqd/    root          root       S    /usr/sbin/    root       S    /usr/sbin/    root       S    /usr/bin/led-    root      S    /opt/Qtopia/bin/    root          root          root          root          root          SW   [kworker/:    root          SW   [flush-    root       S <  /opt/Qtopia/bin/    root      S N  /opt/Qtopia/bin/    root       S    /usr/sbin/telnetd -    root       S    -  root       S    /usr/sbin/telnetd -  root       S    -  root        root       R     [root@FriendlyARM crontabs]# 

 

VII. Implementation results1. Web browsing effect 2. android client display effect 3. the executable files after cross-compilation are provided below (the cross tool chain is: description:
Copy curl to usr/bin/curl/usr/bin/, copy read_ds18b20 and fuse to the memory file system of tiny6410/dev/read_ds18b20/dev/shm/post_ds18b20 b20_data_to_yeelink. /dev/shm/[root @ FriendlyARM crontabs] # crontab-*/*****/dev/shm/post_ds18b20 _ data_to_yeelink. [root @ FriendlyARM crontabs] # crond &

 

8. References1. Raspberry Pi players connect Raspberry Pi-USB camera to Yeelink within 5 minutes-best web monitor http://blog.yeelink.net /? P = 4682, remote monitor Raspberry Pi BT upload/download status http://bbs.yeelink.net/forum.php? Mod = viewthread & tid = 112 & extra = page % 3D23. How to Use cron of busybox to implement scheduled tasks http://bbs.csdn.net/topics/1900172244、linux

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.