Buenas tardes:
Tengo instalado en ESP-01 en el puerto Serial1 del Mega2560:
El problema es que al ejecutar el Sketch de ejemplo de la librería thingerIO no se conecta al servidor
A continuación transcribo el programa de Arduino y la el DEBUG
Programa Arduino:
#define DEBUG
#define DISABLE_TLS
#include <ThingerESP8266AT.h>
#define USERNAME “ferchou2”
#define DEVICE_ID “DHT11”
#define DEVICE_CREDENTIAL “N8jt7DOrdV#X”
#define SSID “rt-123456”
#define SSID_PASSWORD “no surrender”
#define HAVE_HWSERIAL1
// Emulate Serial1 on pins 10/11 if HW is not present (use interrupt pins for better performance
#ifndef HAVE_HWSERIAL1
#include “SoftwareSerial.h”
SoftwareSerial Serial1(10,11); // RX, TX
#endif
ThingerESP8266AT thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL, Serial1);
void setup() {
// uncomment this for debug over serial
delay(200);
Serial.begin(57600);
/* Notice: initialize serial for ESP8266 at your ESP8266 baud rate
- You can change the baud rate of ESP8266 sending a command like “AT+UART_DEF=9600,8,1,0,0\r\n”
- Test with different rates, and use the higher one that works with your setup.
*/
Serial1.begin(115200);
thing.add_wifi(SSID, SSID_PASSWORD);
delay(200);
// digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
pinMode(LED_BUILTIN, OUTPUT);
thing[“led”] << digitalPin(LED_BUILTIN);
delay(200);
// resource output example (i.e. reading a sensor value)
thing[“millis”] >> outputValue(millis());
delay(200);
// more details at http://docs.thinger.io/arduino/
}
void loop() {
thing.handle();
}
Respuesta:
[NETWORK] Starting connection…
[NETWORK] Connected!
[_SOCKET] Connecting to iot.thinger.io:25200…
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Connected!
[THINGER] Authenticating. User: ferchou2 Device: DHT11
[THINGER] Writing bytes: 42 [FAIL]
[THINGER] Expected:42
[THINGER] Wrote:0
[THINGER] Auth Failed! Check username, device id, or device credentials.
[_SOCKET] Is now closed!
[_SOCKET] Connecting to iot.thinger.io:25200…
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Error while connecting!
[NETWORK] Starting connection…
[NETWORK] Connected!
[_SOCKET] Connecting to iot.thinger.io:25200…
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Connected!
[THINGER] Authenticating. User: ferchou2 Device: DHT11
[THINGER] Writing bytes: 42 [FAIL]
[THINGER] Expected:42
[THINGER] Wrote:0
[THINGER] Auth Failed! Check username, device id, or device credentials.
[_SOCKET] Is now closed!
Muchas Gracias,
Fernando