Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.51 KB | None | 0 0
  1. // Uncomment this for debug
  2. #define _DEBUG_
  3. #define THINGER_USE_STATIC_MEMORY
  4. #define THINGER_STATIC_MEMORY_SIZE 512
  5.  
  6. #define TINY_GSM_MODEM_ESP8266
  7. #include <SPI.h>
  8. #include <TinyGsmClient.h>
  9. #include <ThingerESP8266AT.h>
  10.  
  11. #define USERNAME "xx"
  12. #define DEVICE_ID "xx"
  13. #define DEVICE_CREDENTIAL "xx"
  14.  
  15. #define SSID "xx"
  16. #define SSID_PASSWORD "xx"
  17.  
  18. // Emulate Serial1 on pins 10/11 if HW is not present (use interrupt pins for better performance)
  19. #ifndef HAVE_HWSERIAL1
  20. #include <SoftwareSerial.h>
  21. SoftwareSerial Serial1(6,7); // RX, TX
  22. #endif
  23.  
  24. ThingerESP8266AT thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL, Serial1);
  25.  
  26. void setup() {
  27.   // uncomment this for debug over serial
  28.   Serial.begin(115200);
  29.  
  30.   /* Notice: initialize serial for ESP8266 at your ESP8266 baud rate
  31.    * You can change the baud rate of ESP8266 sending a command like "AT+UART_DEF=9600,8,1,0,0\r\n"
  32.    * Test with different rates, and use the higher one that works with your setup.
  33.    */
  34.   Serial1.begin(9600);
  35.  
  36.   thing.add_wifi(SSID, SSID_PASSWORD);
  37.  
  38.   // more details at http://docs.thinger.io/arduino/
  39. }
  40.  
  41. void loop() {
  42.   thing.handle();
  43. }
  44.  
  45.  
  46.  
  47. LOG:
  48.  
  49. [NETWORK] Starting connection...
  50. [NETWORK] Connected!
  51. [_SOCKET] Connecting to iot.thinger.io:25200...
  52. [_SOCKET] Using secure TLS/SSL connection: no
  53. [_SOCKET] Error while connecting!
  54. [NETWORK] Starting connection...
  55. [NETWORK] Connected!
  56. [_SOCKET] Connecting to iot.thinger.io:25200...
  57. [_SOCKET] Using secure TLS/SSL connection: no
  58. [_SOCKET] Error while connecting!
  59. etc....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement