3766 views|4 replies

63

Posts

0

Resources
The OP
 

[Micropython Tutorial] Experiment 4 Data Server Construction [Copy link]

 When I applied for pyboardCN V2, I planned to build a solar weather station based on pyboardCN V2 with multi-channel power supply charging management and data sent to the server through esp8266. Then the server is indispensable. The server uses Raspberry Pi + Peanut Shell (it can also be accessed from the external network, so you can check the home environment data anytime and anywhere, and you can also add human body sensing or camera motion detection illegal intrusion alarm and smoke alarm light. I have previously written a script in python for camera motion detection and uploading photos to Baidu Cloud). There are also many online tutorials on how to build the Raspberry Pi LNMP environment. There is also a very simple integrated environment available under Windows. You can also see my previous post on the forum next door. Let's get to the point: 1. MySQL configuration (auto-increment ID, upload device name, temperature and humidity, PM2.5, light, three-way battery voltage, automatic recording of data upload time) 2. This is the main code for server-side data parsing. Of course, there are also anti-injection, key verification, API method judgment and other codes in front of it 3. Test it with a web page first (returns normal without any problem) Look at the database In order to distinguish, the device name is specified as web during the web page test. You can see that the data has been received, indicating that there is no problem 4. Test whether the esp8266 module can upload normally. Here I flashed the nodemcu with esp8266. I used to use esp8266 as the main controller for uploading, but it only has one adc and the IO is not enough. I would like to thank the moderator @dcexpert for launching this activity, so that I can have the opportunity to try pyboardCN V2. So I use pyboardCN V2 as the main controller serial port to control esp8266 for network transmission. First, the wireless network connection is written into a power-on script. Secondly, the serial port controls the sending of the collected data. The device name is specified as esp8266 during the test. Here, by checking the database, you can see that the new data has been received and recorded in the database. This experiment is over. The next issue preview is "Data acquisition module (temperature and humidity, pm2.5, multi-channel voltage, etc.), multi-channel charge and discharge management module, and expansion circuit compatible with multi-channel discharge meter Altium Designer design (the name is long enough for the diao series)"


Latest reply

666, a very strong brother  Details Published on 2018-7-4 09:35

赞赏

2

查看全部赞赏

 
 

1w

Posts

25

Resources
2
 
 
 
 

47

Posts

0

Resources
3
 
Isn't this electronic engineering? Why is there PHP?

Comments

Learn and apply  Details Published on 2018-7-3 14:45
Personal signatureCCC、CQC、质检报告、EMC等检测认证  联系人:龙凤祥17796079776
 
 
 

63

Posts

0

Resources
4
 
felix.long posted on 2018-7-3 10:23 Isn't this electronic engineering? How come there is PHP?
Learn and sell now
 
 
 

47

Posts

0

Resources
5
 
666, a very strong brother
Personal signatureCCC、CQC、质检报告、EMC等检测认证  联系人:龙凤祥17796079776
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list