update
This commit is contained in:
parent
09b05f3a65
commit
f1f192932a
12
esh-actor/.vscode/extensions.json
vendored
12
esh-actor/.vscode/extensions.json
vendored
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
// for the documentation about the extensions.json format
|
// for the documentation about the extensions.json format
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"platformio.platformio-ide"
|
"platformio.platformio-ide"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -24,11 +24,12 @@ void setup(void) {
|
||||||
u8g2.setFont(u8g2_font_6x10_mf);
|
u8g2.setFont(u8g2_font_6x10_mf);
|
||||||
u8g2.setFontMode(0);
|
u8g2.setFontMode(0);
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
WiFiMulti.addAP("Darknet-IOT", "kekseFTW");
|
WiFiMulti.addAP("MSTN-WS-N", "DEADC0FFEE1234567890DEC0DE");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t adcval = 300;
|
uint16_t adcval = 300;
|
||||||
unsigned char contrast = 0;
|
unsigned char contrast = 0;
|
||||||
|
String state = "Off";
|
||||||
void loop(void) {
|
void loop(void) {
|
||||||
u8g2.firstPage();
|
u8g2.firstPage();
|
||||||
WiFiClient client;
|
WiFiClient client;
|
||||||
|
@ -45,8 +46,8 @@ void loop(void) {
|
||||||
u8g2.drawStr(0, 17, ipbuf);
|
u8g2.drawStr(0, 17, ipbuf);
|
||||||
u8g2.drawStr(0, 27, "api rq...");
|
u8g2.drawStr(0, 27, "api rq...");
|
||||||
|
|
||||||
String url = String("http://ctrans.local:5000/api") + "?mac=" + WiFi.macAddress() + "&datatype=int"
|
String url = String("http://kaby.fritz.box:5000/api") + "?mac=" + WiFi.macAddress() + "&datatype=int"
|
||||||
+ "&actortype=ESP8266_simple_actor" + "&state=Waiting";
|
+ "&actortype=ESP8266_simple_actor" + "&state=" + state;
|
||||||
|
|
||||||
if(http.begin(client, url)) {
|
if(http.begin(client, url)) {
|
||||||
int httpCode = http.GET();
|
int httpCode = http.GET();
|
||||||
|
@ -55,10 +56,12 @@ void loop(void) {
|
||||||
Serial.printf("HTTP Response Code: %d\n", httpCode);
|
Serial.printf("HTTP Response Code: %d\n", httpCode);
|
||||||
if (payload == "1"){
|
if (payload == "1"){
|
||||||
Serial.println("HIGH:" + payload);
|
Serial.println("HIGH:" + payload);
|
||||||
|
state = "On";
|
||||||
digitalWrite(D3, HIGH);
|
digitalWrite(D3, HIGH);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Serial.println("LOW:" + payload);
|
Serial.println("LOW:" + payload);
|
||||||
|
state = "Off";
|
||||||
digitalWrite(D3, LOW);
|
digitalWrite(D3, LOW);
|
||||||
}
|
}
|
||||||
if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
|
if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
"terminal.integrated.env.linux": {
|
"terminal.integrated.env.linux": {
|
||||||
"PATH": "/home/laura/.platformio/penv/bin:/home/laura/.platformio/penv:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl",
|
"PATH": "/home/laura/.platformio/penv/bin:/home/laura/.platformio/penv:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl",
|
||||||
"PLATFORMIO_CALLER": "vscode"
|
"PLATFORMIO_CALLER": "vscode"
|
||||||
|
},
|
||||||
|
"terminal.integrated.env.osx": {
|
||||||
|
"PATH": "/Users/laura/.platformio/penv/bin:/Users/laura/.platformio/penv:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/TeX/texbin:/usr/local/MacGPG2/bin:/usr/local/share/dotnet:~/.dotnet/tools",
|
||||||
|
"PLATFORMIO_CALLER": "vscode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
12
esh-sensor/.vscode/extensions.json
vendored
12
esh-sensor/.vscode/extensions.json
vendored
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
// for the documentation about the extensions.json format
|
// for the documentation about the extensions.json format
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"platformio.platformio-ide"
|
"platformio.platformio-ide"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -11,4 +11,4 @@
|
||||||
[env:nodemcuv2]
|
[env:nodemcuv2]
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
board = nodemcuv2
|
board = nodemcuv2
|
||||||
framework = arduino
|
framework = arduino
|
|
@ -22,7 +22,7 @@ void setup(void) {
|
||||||
u8g2.setFont(u8g2_font_6x10_mf);
|
u8g2.setFont(u8g2_font_6x10_mf);
|
||||||
u8g2.setFontMode(0);
|
u8g2.setFontMode(0);
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
WiFiMulti.addAP("Darknet-IOT", "kekseFTW");
|
WiFiMulti.addAP("MSTN-WS-N", "DEADC0FFEE1234567890DEC0DE");
|
||||||
pinMode(D3, INPUT_PULLUP);
|
pinMode(D3, INPUT_PULLUP);
|
||||||
pinMode(D6, INPUT_PULLUP);
|
pinMode(D6, INPUT_PULLUP);
|
||||||
pinMode(D7, INPUT_PULLUP);
|
pinMode(D7, INPUT_PULLUP);
|
||||||
|
@ -59,7 +59,7 @@ void loop(void) {
|
||||||
if (!tmp){
|
if (!tmp){
|
||||||
tmp = true;
|
tmp = true;
|
||||||
state = !state;
|
state = !state;
|
||||||
String url = String("http://ctrans.local:5000/api") + "?mac=" + WiFi.macAddress() + "&datatype=bool"
|
String url = String("http://kaby.fritz.box:5000/api") + "?mac=" + WiFi.macAddress() + "&datatype=bool"
|
||||||
+ "&sensortype=ESP8266_simple_sensor" + "&value=" + state + "&displayunit=nA";
|
+ "&sensortype=ESP8266_simple_sensor" + "&value=" + state + "&displayunit=nA";
|
||||||
if(http.begin(client, url)) {
|
if(http.begin(client, url)) {
|
||||||
int httpCode = http.GET();
|
int httpCode = http.GET();
|
||||||
|
|
Loading…
Reference in a new issue