I am Following the document for thinger server deployment on http://docs.thinger.io/deployment/
while adding the THINGER_SERVER value as my deploy server public ip.
my device not able to connect the server .
i am just defining THINGER_SERVER value in my code as follows
#define THINGER_SERVER "my_server_ip"
#include <ESP8266WiFi.h>
#include <ThingerESP8266.h>
#include <NewPing.h>
#define USERNAME "my_username"
#define DEVICE_ID "Thinger_device_0"
#define DEVICE_CREDENTIAL "my_device_credential"
#define SSID "WiFi_ssid"
#define SSID_PASSWORD "ssid_password"
#define TRIGGER_PIN 5
#define ECHO_PIN 4
#define MAX_DISTANCE 400
unsigned int distance = 0;
unsigned long echoTime = 0;
unsigned long max_distance = 400;
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
void setup() {
thing.add_wifi(SSID, SSID_PASSWORD);
thing["ultraSonic"] >> [](pson & out) {
echoTime = sonar.ping_median(10);
distance = sonar.convert_cm(echoTime);
//float percentage = (float) (( distance * 100 ) / max_distance);
//out["percentage"] = percentage;
out["distance"] = distance;
out["echoTime"] = echoTime;
//out["max_distance"] = max_distance;
};
thing["millis"] >> [](pson & out) {
out = millis();
};
}
void loop() {
thing.handle();
}
the code is working fine with thinger.io server but not working on my server . what is missing ??