The 4-hole socket of Gizwits IoT platform is open source and open source content

1. Control 4-way jacks, single control and full control.

2. Creation of scheduled tasks

3. Control 5v2.1A mobile phone charging port switch

4. Open source hardware wiring has reference design

5. Power-down memory switch status

6. Remote upgrade

hardware reference

1. This design uses ESP12F as the main control and WiFi network communication chip. The minimal system is shown in the figure below.

2. The wiring method in this design has the IO control status as follows:

Button GPIO0 active low, long press softap (hotspot configuration), short press to control full open

Relay 1 GPIO5 Active low socket switch control

Relay 2 GPIO4 Active low socket switch control

Relay 3 GPIO13 Active low socket switch control

Relay 4 GPIO12 Active low socket switch control

USB GPIO14 active high USB mobile phone charging port switch

LINK GPIO16 Active low socket switch status indicator

USBLED GPIO2 Active low USB switch status indicator

3. The reference hardware is as follows

4. If you don't have the relevant hardware, you can buy a 4-way relay board, a 5V2.1A power board, a socket with a large internal space (you can customize the socket if you have the conditions), and an ESP12F minimum system board to build it.

Cloud Deployment 1. Enter Gizwits New Version Developer Center https://developer.gizwits.com/menu/dashboard and click Create in the upper left corner.

2. Since I did not add a metering module here, I choose an unmetered four-way socket.

3. Select Product Development, edit the data points, keep the following data points.

4. Click MCU development on the left, select SOC solution 32M, and generate 32m code.

5. Click Download to download the generated code to the computer for backup.

6. Go back to the home page and click Create in the upper right corner to create a mobile application.

7. Associate related products to the application.

7. Other personalized theme designs can be directly clicked to replace.

8. Build the application and generate the corresponding mobile application installation package

9. Download the built application to the mobile phone for installation

Espressif ESP12 programming 1. Unzip the previously downloaded spare code.

2. Import the project with Espressif IDE software. If you don't have the software, you can go to the QQ group 438373554 to download it. Unzip the file to a non-Chinese path to use it. No installation is required. It must be a non-Chinese path.

3. Configure the import code according to the following figure

4. Modify the project compilation information as shown below

5. Define the global switch state variable STATE [5],

6. Write a cloud-delivered response program

7. Modify the key program, here one key is used.

8. Real-time pin processing function.

9. Power-down memory program

10. Compile and burn.

11. Remote OTA firmware upgrade

Verify firmware

12. APP related display.

This is the end of the tutorial. The actual code is subject to the open source attached. The screenshots are for reference only. The intelligent control chooses Gizwits, which is convenient and quick to complete the project in hand.

Leave a Reply

Your email address will not be published.