Compare commits
No commits in common. "b522501c86f6623a6d1963285d4cc5f4ab310829" and "98680b8423aef421a60cb47b9edb0c88b1cb77a1" have entirely different histories.
b522501c86
...
98680b8423
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
.pio
|
||||
.vscode/.browse.c_cpp.db*
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
.vscode/ipch
|
10
.vscode/extensions.json
vendored
Normal file
10
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"platformio.platformio-ide"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"ms-vscode.cpptools-extension-pack"
|
||||
]
|
||||
}
|
120
.vscode/settings.json
vendored
Normal file
120
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
{
|
||||
"C_Cpp_Runner.cCompilerPath": "C:/Users/FPCLinkYZT114/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-gcc.exe",
|
||||
"C_Cpp_Runner.cppCompilerPath": "C:/Users/FPCLinkYZT114/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-g++.exe",
|
||||
"C_Cpp_Runner.debuggerPath": "C:/Users/FPCLinkYZT114/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-gdb.exe",
|
||||
"C_Cpp_Runner.cStandard": "gnu17",
|
||||
"C_Cpp_Runner.cppStandard": "gnu++17",
|
||||
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
|
||||
"C_Cpp_Runner.useMsvc": false,
|
||||
"C_Cpp_Runner.warnings": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wpedantic",
|
||||
"-Wshadow",
|
||||
"-Wformat=2",
|
||||
"-Wcast-align",
|
||||
"-Wconversion",
|
||||
"-Wsign-conversion",
|
||||
"-Wnull-dereference"
|
||||
],
|
||||
"C_Cpp_Runner.msvcWarnings": [
|
||||
"/W4",
|
||||
"/permissive-",
|
||||
"/w14242",
|
||||
"/w14287",
|
||||
"/w14296",
|
||||
"/w14311",
|
||||
"/w14826",
|
||||
"/w44062",
|
||||
"/w44242",
|
||||
"/w14905",
|
||||
"/w14906",
|
||||
"/w14263",
|
||||
"/w44265",
|
||||
"/w14928"
|
||||
],
|
||||
"C_Cpp_Runner.enableWarnings": true,
|
||||
"C_Cpp_Runner.warningsAsError": false,
|
||||
"C_Cpp_Runner.compilerArgs": [],
|
||||
"C_Cpp_Runner.linkerArgs": [],
|
||||
"C_Cpp_Runner.includePaths": [
|
||||
"F:/源码/ESP8266/SmartPlugs_esp8266/include",
|
||||
"F:/源码/ESP8266/SmartPlugs_esp8266/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/cores/esp8266",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/toolchain-xtensa/include",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip2/include",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/variants/nodemcu",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ArduinoOTA",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/DNSServer/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/EEPROM",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266AVRISP/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266HTTPClient/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266HTTPUpdateServer/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266LLMNR",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266NetBIOS",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266SSDP",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266SdFat/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WebServer/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFiMesh/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266httpUpdate/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266mDNS/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/Ethernet/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/FSTools",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/GDBStub/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/Hash/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/I2S/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/LittleFS/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/Netdump/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/SD/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/SDFS/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/SPI",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/SPISlave/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/Servo/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/SoftwareSerial/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/TFT_Touch_Shield_V2",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/Ticker/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/Wire",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/esp8266/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_Ethernet/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_PPP/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_enc28j60/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_w5100/src",
|
||||
"C:/Users/FPCLinkYZT114/.platformio/packages/framework-arduinoespressif8266/libraries/lwIP_w5500/src",
|
||||
""
|
||||
],
|
||||
"C_Cpp_Runner.includeSearch": [
|
||||
"*",
|
||||
"**/*"
|
||||
],
|
||||
"C_Cpp_Runner.excludeSearch": [
|
||||
"**/build",
|
||||
"**/build/**",
|
||||
"**/.*",
|
||||
"**/.*/**",
|
||||
"**/.vscode",
|
||||
"**/.vscode/**"
|
||||
],
|
||||
"C_Cpp_Runner.useAddressSanitizer": false,
|
||||
"C_Cpp_Runner.useUndefinedSanitizer": false,
|
||||
"C_Cpp_Runner.useLeakSanitizer": false,
|
||||
"C_Cpp_Runner.showCompilationTime": false,
|
||||
"C_Cpp_Runner.useLinkTimeOptimization": false,
|
||||
"C_Cpp_Runner.msvcSecureNoWarnings": false,
|
||||
"idf.portWin": "COM9",
|
||||
"C_Cpp.errorSquiggles": "disabled",
|
||||
"idf.adapterTargetName": "esp32s3",
|
||||
"files.associations": {
|
||||
"array": "cpp",
|
||||
"deque": "cpp",
|
||||
"list": "cpp",
|
||||
"string": "cpp",
|
||||
"unordered_map": "cpp",
|
||||
"vector": "cpp",
|
||||
"string_view": "cpp",
|
||||
"initializer_list": "cpp",
|
||||
"ranges": "cpp"
|
||||
},
|
||||
"github-enterprise.uri": "https://192.168.1.3"
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
# SmartSocket_ESP8266
|
||||
A smart socket controller program used by the MCU ESP8266
|
BIN
UDP Tester.exe
Normal file
BIN
UDP Tester.exe
Normal file
Binary file not shown.
39
include/README
Normal file
39
include/README
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
This directory is intended for project header files.
|
||||
|
||||
A header file is a file containing C declarations and macro definitions
|
||||
to be shared between several project source files. You request the use of a
|
||||
header file in your project source file (C, C++, etc) located in `src` folder
|
||||
by including it, with the C preprocessing directive `#include'.
|
||||
|
||||
```src/main.c
|
||||
|
||||
#include "header.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Including a header file produces the same results as copying the header file
|
||||
into each source file that needs it. Such copying would be time-consuming
|
||||
and error-prone. With a header file, the related declarations appear
|
||||
in only one place. If they need to be changed, they can be changed in one
|
||||
place, and programs that include the header file will automatically use the
|
||||
new version when next recompiled. The header file eliminates the labor of
|
||||
finding and changing all the copies as well as the risk that a failure to
|
||||
find one copy will result in inconsistencies within a program.
|
||||
|
||||
In C, the usual convention is to give header files names that end with `.h'.
|
||||
It is most portable to use only letters, digits, dashes, and underscores in
|
||||
header file names, and at most one dot.
|
||||
|
||||
Read more about using header files in official GCC documentation:
|
||||
|
||||
* Include Syntax
|
||||
* Include Operation
|
||||
* Once-Only Headers
|
||||
* Computed Includes
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
46
lib/README
Normal file
46
lib/README
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
This directory is intended for project specific (private) libraries.
|
||||
PlatformIO will compile them to static libraries and link into executable file.
|
||||
|
||||
The source code of each library should be placed in an own separate directory
|
||||
("lib/your_library_name/[here are source files]").
|
||||
|
||||
For example, see a structure of the following two libraries `Foo` and `Bar`:
|
||||
|
||||
|--lib
|
||||
| |
|
||||
| |--Bar
|
||||
| | |--docs
|
||||
| | |--examples
|
||||
| | |--src
|
||||
| | |- Bar.c
|
||||
| | |- Bar.h
|
||||
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
|
||||
| |
|
||||
| |--Foo
|
||||
| | |- Foo.c
|
||||
| | |- Foo.h
|
||||
| |
|
||||
| |- README --> THIS FILE
|
||||
|
|
||||
|- platformio.ini
|
||||
|--src
|
||||
|- main.c
|
||||
|
||||
and a contents of `src/main.c`:
|
||||
```
|
||||
#include <Foo.h>
|
||||
#include <Bar.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
PlatformIO Library Dependency Finder will find automatically dependent
|
||||
libraries scanning project source files.
|
||||
|
||||
More information about PlatformIO Library Dependency Finder
|
||||
- https://docs.platformio.org/page/librarymanager/ldf.html
|
22
platformio.ini
Normal file
22
platformio.ini
Normal file
@ -0,0 +1,22 @@
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
; Advanced options: extra scripting
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[platform]
|
||||
name = smartplugs_esp8266
|
||||
[env]
|
||||
upload_speed = 921600
|
||||
monitor_encoding = utf-8
|
||||
monitor_speed = 115200
|
||||
framework = arduino
|
||||
|
||||
[env:esp8266]
|
||||
platform = espressif8266
|
||||
board = nodemcu
|
||||
board_build.ldscript =eagle.flash.1m.ld
|
212
src/main.cpp
Normal file
212
src/main.cpp
Normal file
@ -0,0 +1,212 @@
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiUdp.h>
|
||||
#include <EEPROM.h>
|
||||
#include <WiFiServer.h>
|
||||
|
||||
#define relay 0
|
||||
int ledPin = 2;
|
||||
int UdpbeginPacketTest;
|
||||
int UdpendPacketTest;
|
||||
int digitalStatus;
|
||||
|
||||
WiFiUDP Udp;
|
||||
unsigned int localUdpPort = 443;
|
||||
char incomingPacket[537];
|
||||
WiFiServer server(80);
|
||||
|
||||
void loadWiFiSettings(char* ssid, char* password) { //Read WiFi settings from EEPROM
|
||||
EEPROM.begin(64); //Initialize EEPROM with size 64 bytes
|
||||
for (int i = 0; i < 32; i++) {
|
||||
char c = EEPROM.read(i);
|
||||
// Serial.print(c);
|
||||
// Serial.print(" ");
|
||||
// Serial.print((int)c);
|
||||
// Serial.print(" ");
|
||||
ssid[i] = c;
|
||||
if(c =='\0'){
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 32; i++) {
|
||||
char c = EEPROM.read(i + 32);
|
||||
// Serial.print(c);
|
||||
// Serial.print(" ");
|
||||
// Serial.print((int)c);
|
||||
// Serial.print(" ");
|
||||
password[i] = c;
|
||||
if(c == '\0'){
|
||||
break;
|
||||
}
|
||||
}
|
||||
EEPROM.end();
|
||||
}
|
||||
|
||||
void saveWiFiSettings(const char ssid[32], const char password[32]) {
|
||||
EEPROM.begin(64); //Initialize EEPROM with size 64 bytes
|
||||
for(int i=0; i<32; i++) {
|
||||
// Serial.print(ssid[i]);
|
||||
// Serial.print(" ");
|
||||
// Serial.print((int)ssid[i]);
|
||||
EEPROM.write(i, ssid[i]); //Write SSID to EEPROM
|
||||
Serial.print(ssid[i]);
|
||||
if(ssid[i] == '\0') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(int i=0; i<32; i++) {
|
||||
// Serial.print(password[i]);
|
||||
// Serial.print(" ");
|
||||
// Serial.print((int)password[i]);
|
||||
EEPROM.write(i+32, password[i]); //Write Password to EEPROM
|
||||
Serial.print(password[i]);
|
||||
if(password[i] == '\0') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Serial.println("EEPROM.end");
|
||||
EEPROM.end();
|
||||
}
|
||||
|
||||
void setup(){
|
||||
Serial.begin(115200);
|
||||
Serial.println(""); //Print firmware information
|
||||
Serial.println("Smart Socket ESP8266EX Firmware Ver.1.0");
|
||||
Serial.println("Developed by Madobi Nanami");
|
||||
Serial.println("Personal site: https://nanami.tech");
|
||||
pinMode(ledPin,OUTPUT); //Initialize LED pin
|
||||
digitalWrite(ledPin,HIGH);
|
||||
pinMode(relay,OUTPUT); //Initialize relay pin
|
||||
digitalWrite(relay,LOW);
|
||||
char ssid[32];
|
||||
char password[32];
|
||||
loadWiFiSettings(ssid, password); //Load WiFi settings from EEPROM
|
||||
if(strlen(ssid) == 0 || strlen(password) == 0){ //Check if WiFi settings are empty
|
||||
Serial.println("No WiFi settings found in EEPROM, please set them.");
|
||||
Serial.println("Please enter SSID:");
|
||||
while(!Serial.available());
|
||||
String inputSsid = Serial.readStringUntil('\n');
|
||||
inputSsid.trim();
|
||||
if(inputSsid.length() > 32) {
|
||||
Serial.println("SSID is too long, please enter a shorter one.");
|
||||
return;
|
||||
}
|
||||
Serial.println("Please enter Password:");
|
||||
while(!Serial.available());
|
||||
String inputPassword = Serial.readStringUntil('\n');
|
||||
inputPassword.trim();
|
||||
if(inputPassword.length() > 32) {
|
||||
Serial.println("Password is too long, please enter a shorter one.");
|
||||
return;
|
||||
}
|
||||
Serial.println("Trying to connect to WiFi...");
|
||||
WiFi.begin(inputSsid.c_str(), inputPassword.c_str());
|
||||
while(WiFi.status() != WL_CONNECTED){
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
Serial.println("Connected to WiFi.");
|
||||
Serial.println("Saving WiFi settings to EEPROM...");
|
||||
saveWiFiSettings(inputSsid.c_str(), inputPassword.c_str());
|
||||
Serial.println("WiFi settings saved.");
|
||||
|
||||
} else {
|
||||
Serial.println("Load WiFi settings from EEPROM.");
|
||||
Serial.print("SSID: ");
|
||||
Serial.println(ssid);
|
||||
Serial.print("Password: ");
|
||||
Serial.println(password);
|
||||
}
|
||||
WiFi.begin(ssid,password);
|
||||
while(WiFi.status() !=WL_CONNECTED){
|
||||
delay(500);
|
||||
Serial.println(".");
|
||||
}
|
||||
Serial.println("Connected.");
|
||||
server.begin();
|
||||
Udp.begin(localUdpPort);
|
||||
Serial.println("UDP server started. Listening on port 443");
|
||||
Serial.print("Use this address to connect: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
}
|
||||
|
||||
void loop(){
|
||||
int packetSize = Udp.parsePacket();
|
||||
if(packetSize){
|
||||
Serial.printf("Received %d bytes from client: %s:%d\n",packetSize,Udp.remoteIP().toString());
|
||||
int len = Udp.read(incomingPacket,536);
|
||||
if(len>0){
|
||||
incomingPacket[len] = 0;
|
||||
Serial.printf("UDP packet contents: %s\n", incomingPacket);
|
||||
if(strcmp(incomingPacket, "udp.test") == 0){
|
||||
UdpbeginPacketTest = Udp.beginPacket(Udp.remoteIP(),Udp.remotePort());
|
||||
if(UdpbeginPacketTest=1){
|
||||
Serial.println("Udp beginPacket test pass.");
|
||||
}
|
||||
Udp.write("udp test pass");
|
||||
UdpendPacketTest = Udp.endPacket();
|
||||
if(UdpendPacketTest=1){
|
||||
Serial.println("Udp endPacket test pass.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(strcmp(incomingPacket, "device.read") == 0){
|
||||
Serial.println("Device information requested.");
|
||||
Udp.beginPacket(Udp.remoteIP(),Udp.remotePort());
|
||||
Udp.write("[Chipset]ESP8266EX");
|
||||
Udp.write("[Manufacture]Espressif");
|
||||
Udp.write("[DeviceType]relayController");
|
||||
Udp.write("[FirmwareName]Smart Socket");
|
||||
Udp.write("[FirmwareVersion]1.0.stable");
|
||||
Udp.write("[FirmwareBuildVer]24");
|
||||
Udp.write("[Developer]Madobi Nanami");
|
||||
Udp.write("[BuildDate]2025.07.26");
|
||||
delay(500);
|
||||
Udp.write("[Command]EOF");
|
||||
Udp.endPacket();
|
||||
return;
|
||||
}
|
||||
if(strcmp(incomingPacket, "led.read") == 0){
|
||||
digitalStatus = digitalRead(ledPin);
|
||||
Udp.beginPacket(Udp.remoteIP(),Udp.remotePort());
|
||||
Udp.write(digitalStatus);
|
||||
Udp.endPacket();
|
||||
return;
|
||||
}
|
||||
if(strcmp(incomingPacket, "relay.read") == 0){
|
||||
digitalStatus = digitalRead(relay);
|
||||
Udp.beginPacket(Udp.remoteIP(),Udp.remotePort());
|
||||
Udp.write(digitalStatus);
|
||||
Udp.endPacket();
|
||||
return;
|
||||
}
|
||||
if(strcmp(incomingPacket, "led.on") == 0){
|
||||
digitalWrite(ledPin,LOW);
|
||||
Udp.beginPacket(Udp.remoteIP(),Udp.remotePort());
|
||||
Udp.write("led.on");
|
||||
Udp.endPacket();
|
||||
return;
|
||||
}
|
||||
if(strcmp(incomingPacket, "led.off") == 0){
|
||||
digitalWrite(ledPin,HIGH);
|
||||
Udp.beginPacket(Udp.remoteIP(),Udp.remotePort());
|
||||
Udp.write("led.off");
|
||||
Udp.endPacket();
|
||||
return;
|
||||
}
|
||||
if(strcmp(incomingPacket, "relay.on") == 0){
|
||||
digitalWrite(relay,HIGH);
|
||||
Udp.beginPacket(Udp.remoteIP(),Udp.remotePort());
|
||||
Udp.write("relay.on");
|
||||
Udp.endPacket();
|
||||
return;
|
||||
}
|
||||
if(strcmp(incomingPacket, "relay.off") == 0){
|
||||
digitalWrite(relay,LOW);
|
||||
Udp.beginPacket(Udp.remoteIP(),Udp.remotePort());
|
||||
Udp.write("relay.off");
|
||||
Udp.endPacket();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
test/README
Normal file
11
test/README
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
This directory is intended for PlatformIO Test Runner and project tests.
|
||||
|
||||
Unit Testing is a software testing method by which individual units of
|
||||
source code, sets of one or more MCU program modules together with associated
|
||||
control data, usage procedures, and operating procedures, are tested to
|
||||
determine whether they are fit for use. Unit testing finds problems early
|
||||
in the development cycle.
|
||||
|
||||
More information about PlatformIO Unit Testing:
|
||||
- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html
|
Loading…
x
Reference in New Issue
Block a user