Hello all,
I tried to connect NodeMcu with Thinger platform using arduino IDE.
First, i make device definition, device resource, and also dashboard in Thinger platform.
Just using sample code that i’ve found in this forum.
This is the code i use :
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingerWifi.h>
#include <SoftwareSerial.h>
#define USERNAME “xxxxxxxxxxx”
#define DEVICE_ID “xxxxxxxxxxxx”
#define DEVICE_CREDENTIAL “xxxxxxxxxxxx”
#define SSID “mySSID”
#define SSID_PASSWORD “mypassword”
#define sakelar1 5
#define sakelar2 15
ThingerWifi thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
void setup() {
Serial.begin(115200);
//Set output mode for all IO pins
pinMode(sakelar1, OUTPUT);
pinMode(sakelar2, OUTPUT);
delay(10);
thing.add_wifi(SSID, SSID_PASSWORD);
thing[“output1”] << [](pson& in){ digitalWrite(sakelar1, in ? HIGH : LOW); };
thing[“output2”] << [](pson& in){ digitalWrite(sakelar2, in ? HIGH : LOW); };
}
void loop() {
thing.handle();
}
After verify/compilation on arduino IDE is done, i monitor the process using debug console.
The result looks strange
Does anyone experienced the same issue?
Or did i missed some stuff in the code?
Thanks.