parent
252fb7ac9f
commit
75625a31a4
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"sketch": "Blinker01.ino",
|
"sketch": "Blinker01.ino",
|
||||||
"port": "COM4",
|
"port": "COM10",
|
||||||
"board": "esp32:esp32:esp32",
|
"board": "esp32:esp32:esp32s3",
|
||||||
"configuration": "PSRAM=disabled,PartitionScheme=min_spiffs,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none",
|
"configuration": "PSRAM=disabled,FlashMode=qio,FlashSize=16M,LoopCore=1,EventsCore=1,USBMode=hwcdc,CDCOnBoot=default,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,PartitionScheme=default,CPUFreq=240,UploadSpeed=921600,DebugLevel=none",
|
||||||
"programmer": "esp32:esptool",
|
"programmer": "esp32:esptool",
|
||||||
"output": "./build"
|
"output": "./build"
|
||||||
}
|
}
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#define ON HIGH
|
#define ON HIGH
|
||||||
#define OFF LOW
|
#define OFF LOW
|
||||||
|
#define LED_PIN_LEI 5
|
||||||
|
|
||||||
#include <Blinker.h>
|
#include <Blinker.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
@ -24,7 +25,7 @@ BlinkerNumber Num("num-yr0");
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
Blinker.begin(auth, ssid, pswd);
|
Blinker.begin(auth, ssid, pswd);
|
||||||
pinMode(LED_BUILTIN, OUTPUT);
|
pinMode(LED_PIN_LEI, OUTPUT);
|
||||||
BLINKER_TAST_INIT(); //保持Blinker连接的函数
|
BLINKER_TAST_INIT(); //保持Blinker连接的函数
|
||||||
Blinker.attachData(none_callback); //绑定数据输入,但是没有绑定的控件的回调函数
|
Blinker.attachData(none_callback); //绑定数据输入,但是没有绑定的控件的回调函数
|
||||||
httpsOtaTurnOn();
|
httpsOtaTurnOn();
|
||||||
|
@ -46,12 +47,12 @@ void button1_callback(const String & state){
|
||||||
else cont = 0;
|
else cont = 0;
|
||||||
Serial.println("Firmware online version");
|
Serial.println("Firmware online version");
|
||||||
if(state=="on"){ //开灯
|
if(state=="on"){ //开灯
|
||||||
digitalWrite(LED_BUILTIN,ON);
|
digitalWrite(LED_PIN_LEI,ON);
|
||||||
BLINKER_LOG("get button state:", state);
|
BLINKER_LOG("get button state:", state);
|
||||||
Button1.icon("fa-light fa-lightbulb-on");
|
Button1.icon("fa-light fa-lightbulb-on");
|
||||||
Button1.print("on");
|
Button1.print("on");
|
||||||
}else{ //关灯
|
}else{ //关灯
|
||||||
digitalWrite(LED_BUILTIN,OFF);
|
digitalWrite(LED_PIN_LEI,OFF);
|
||||||
BLINKER_LOG("get button state:", state);
|
BLINKER_LOG("get button state:", state);
|
||||||
Button1.icon("fa-light fa-lightbulb");
|
Button1.icon("fa-light fa-lightbulb");
|
||||||
Button1.print("off");
|
Button1.print("off");
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "httpslei.h"
|
#include "httpslei.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
static const char *url = "https://www.lshserver.com:9006/test/ota.bin"; //state url of your firmware image
|
static const char *url = "https://www.lshserver.com:9006/test/otas3.bin"; //state url of your firmware image
|
||||||
static const char *server_certificate =\
|
static const char *server_certificate =\
|
||||||
"-----BEGIN CERTIFICATE-----\n\
|
"-----BEGIN CERTIFICATE-----\n\
|
||||||
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n\
|
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n\
|
||||||
|
|
Loading…
Reference in New Issue