Hardware:
ESP8266 module, steering gear, a micro usb data cable

Software link: https://pan.baidu.com/s/1KYT4NsAwKEwDa8WvrF9Tvw Extraction code: 9ywk
Go to Baidu to search and download large files that are not available

Install arduino

1、 Fill in the development board manager website

File - Preferences - Add Developer Board Manager URL, fill in
https://arduino.me/packages/esp8266.json
If the link cannot be opened Document View Latest json

2、 Install Library

Click Tools - Development Board - Development Board Manager
search eight thousand two hundred and sixty-six Select a version and install it (install only when GitHub access is normal)

Or add libraries manually

Project - load library - add. zip library - find the blinker package under and add it

3、 Install 8266 offline package

8266_package_xxx_arduino.cn.exe Click Auto Unzip to restart Arduino
Find the esp8266 development board you use in Tools>Development Board Generic ESP8266 Module
4、 Lighting technology APP

After the phone is installed, add an independent device - copy the key to save it, which will be used later

5、 Code modification

Copy the code to arduino, and modify the key, WiFi and steering gear rotation of Lighting Technology

 #define BLINKER_WIFI #define BLINKER_MIOT_LIGHT #include <Blinker.h> #include <Servo.h> Servo myservo;//Define the steering gear char auth[] = "xxxxx";  // Lighting Key char ssid[] = "xxxx";      // Wifi name char pswd[] = "12345678";     // Wifi password //New Component Object BlinkerButton Button1("test"); int counter = 0; Void miotPowerState (const String&state)//Power class operations { BLINKER_LOG("need set power state: ", state); if (state == BLINKER_CMD_ON) { myservo.write(0);// The steering gear rotates 110 degrees after receiving the "on" command BlinkerMIOT.powerState("on"); BlinkerMIOT.print();// Feedback status delay(500);// Delay 0.5 s myservo.write(0);// The steering gear returns to zero and vertical state } else if (state == BLINKER_CMD_OFF) { myservo.write(0);            // Steering gear deflection 70 ° BlinkerMIOT.powerState("off"); BlinkerMIOT.print(); delay(500); myservo.write(0); } } //Press the key to execute the function and change the steering gear rotation to the following void button1_callback(const String & state) { BLINKER_LOG("get button state: ", state); if (state=="on")  { myservo.write(180);// After receiving the "on" command, the steering gear rotates 150, counterclockwise delay(500);// delayed myservo.write(90);// Steering gear zeroed and vertical } else if(state=="press"||state=="tap") { myservo.write(-180);// After long pressing the switch button, the steering gear rotates 30, clockwise delay(500);// delayed myservo.write(90);// Steering gear zeroed and vertical } } //If an unbound component is triggered, its contents will be executed void dataRead(const String & data) { BLINKER_LOG("Blinker readString: ", data); counter++; } void setup() { //Initialize serial port Serial.begin(115200); BLINKER_DEBUG.stream(Serial); //Initialize the steering gear myservo.attach(2);// I/O port of steering gear, D4 port of nodemcu myservo.write(90);// When power on, the steering gear returns to zero and vertical BlinkerMIOT.attachPowerState(miotPowerState); //Initialize blinker Blinker.begin(auth, ssid, pswd); Blinker.attachData(dataRead); Button1.attach(button1_callback); } void loop() { Blinker.run(); }

6、 Burn code to firmware

Connect the 8266 module with the data cable, and click Tools Port: COMx
(If it is gray, go to the device manager to see if it can be identified normally. If it can not be identified, install it CH341SER.exe Drive)

Upload and burn directly, and the light is always on after burning
 20230115135105.png

7、 Configuration switch

Lighting technology selection equipment - interface configuration

 {config → headerColor → transparent → headerStyle → dark → background → img → assets/img/headerbg.jpg → isFull → dashboard → | {type → btn → ico → fad fa lightbulb on → mode → t0 → turn on the light t1 Text 2 {ß A ß B ß C ß E ß E ß F ß H ß I ß J Ì K ß L Í M ß N ß x Ë y ß O | ÷ R ß S ß {T} ß A ¨ deb ¨ E E E E E E E K ∨ L ß M ¨ debug ¨ x ´´ y ´´ D} ÷ actions ¨ | ε cmd ¨ switch ¨ ‡¨ text ¨ ‡ Q ¨ Open? Name ¨ off ¨ Close? Name ¨ ÷ ¨ triggers ¨ | {¨ source ¨ a ¨ source_zh ¨ Switch status ¨ state ¨ | ß Q ¨ d ÷ ¨ state_zh ¨ | ¨ Open ¨ Close ¨ ÷} ÷}

8、 connection

Steering gear: black ground wire (G), red power wire (3v), yellow pwm signal wire
 IMG_20230115.jpg

End