Git Product home page Git Product logo

arduino-library's People

Contributors

alvarolb avatar bautisflow avatar per1234 avatar tubbynl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-library's Issues

NodeMCU v1 unable to connect to thinger.io

I have recently received a couple of ESP8266 NodeMCU (v1) units and have been attempting to connect them to the thinger.io platform. Using the Arduino IDE (1.8.5), I attempted to upload the following sketch to make and initial connection:

#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingerWifi.h>

ThingerWifi thing("username", "deviceId", "deviceCredential");

void setup() {
  thing.add_wifi("wifi_ssid", "wifi_credentials");
}

void loop() {
  thing.handle();
}

But I had no such luck. I tried another unit with the same results, and while other sketches worked fine, I could not link it to thinger. Eventually, after backdating the thinger.io Arduino library to version 2.7.2 it works, but not with the latest 2.9.1 version.

Compile Error for ThingerMKRGSM

Hi, i get the following compile error when including ThingerMKRGSM.h

Arduino: 1.8.12 (Mac OS X), Board: "Arduino MKR GSM 1400"

In file included from /Users/chm/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/char_traits.h:39:0,
from /Users/chm/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/string:40,
from /Users/chm/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/stdexcept:39,
from /Users/chm/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/array:39,
from /Users/chm/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/tuple:39,
from /Users/chm/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/functional:54,
from /Users/chm/Documents/Arduino/libraries/thinger.io/src/thinger/thinger_resource.hpp:33,
from /Users/chm/Documents/Arduino/libraries/thinger.io/src/thinger/thinger.h:29,
from /Users/chm/Documents/Arduino/libraries/thinger.io/src/ThingerClient.h:28,
from /Users/chm/Documents/Arduino/libraries/thinger.io/src/ThingerMKRGSM.h:32,
from /Users/chm/Desktop/sketch_mar01a/sketch_mar01a.ino:1:
/Users/chm/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/Users/chm/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
exit status 1
Fehler beim Kompilieren für das Board Arduino MKR GSM 1400.

ESP32 Can't connect to Thinger.io

Hello sir, I'm sorry.
Previously, i have a tutorial about using thinger.io to control the esp32. But now, I follow my tutorial, the thinger.io in the website, my device still disconnect in state column. I use the example code of thinger.io/esp32 . The source is done uploading and the wifi has been connected to esp32, but thinger.io in the website still disconnect. Thank you for your support

WiFiManager doesn't start the SoftAP if its not detecting the saved WiFi

I'm having some problems dealing with this library, because it takes control of the WiFiManager lib.

I really like to be myself to handle the wifi/networking stuff.

I sometimes take my device to a new location, and I want it to "forget" the last network. Yes I know about the "clean_credentials()" function, but that would need to have some logic or add a "reset wifi" physical button.

On my projects that I use the wifimanager I let the lib handle all the wifi settings, and I sometimes even add the physical button to toggle the .startConfigPortal (turns on AP and starts the http server) or the .startWebPortal(keeps connected to the current AP and starts the http server)

If this is to complicated to handle, maybe expose the WiFiManager variable to the outside, so the user can do what he wants with the wifiManager library.

ESP8266WiFi.h: No such file or directory

when i run the scrip ESP8266.ino

arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/604091741 -hardware arduino-builder/hardware -hardware arduino-builder/packages/cores -tools arduino-builder/tools -tools arduino-builder/packages/tools -built-in-libraries arduino-builder/latest -libraries /tmp/013713526/pinned -libraries /tmp/013713526/custom -fqbn arduino:avr:uno -build-cache /tmp -verbose=false /tmp/013713526/ESP8266
/tmp/013713526/ESP8266/ESP8266.ino:1:25: fatal error: ESP8266WiFi.h: No such file or directory
#include <ESP8266WiFi.h>
^
compilation terminated.
exit status 1

How do I get the file?
This is my PIN setup
ESP 8266 E01 -> ARDUINO

TXD -> TXD
RXD -> RXD
CH_PD -> 3.3V
VCC -> 3.3V
RESET -> 3.3V
GND -> GND
GPIO0 -> GND

Error when using String type

After some hours of struggling to return a String (actually the current Time as HH:MM format, to be used in the text element on the dashboard) I believe I found a bug.

From the docs, the following statement works:

float yaw = 1;

void setup(){
  thing["yaw"] >> [](pson& out){
      out = yaw;
  };
}

But as soon as yaw is defined as a string, a compilation error occurs

String yaw = "test";//Or String yaw = "12:45";

void setup(){
  thing["yaw"] >> [](pson& out){
      out = yaw;
  };
}

On compiling, the following error occurs:

libraries/thinger.io/src/thinger/pson.h:292:27: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
             }else if(value==1) {

Am I using this wrong or is this an actual bug?
Any thoughts on returning the current time as a human readable text-line are highly appreciated!

Erro at PlatformIO

When a try to compile the library at PlatformIO this message show up

thinger.io/src/ThingerTinyGSM.h:126:19:` error: 'ThingerTinyGSM::client_' will be initialized after [-Werror=reorder]

It's easy to solve with adding a line with

build_unflags = -Werror=reorder

,but it would make some unnoticed people belive that your library don't work fine, the arduino gcc compiler is set to supres a lot of warning to make easy to new one in programing.
I just fell that a had to inform that it is happening, due your system has been extremely helpful for me :)

Typo in the example code, file: ArduinoENC28J60

Typo in file: ArduinoENC28J60, line 9. No quotation marks. Looks like this:

ThingerENC28J60 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

instead of this:

ThingerENC28J60 thing("USERNAME", "DEVICE_ID", "DEVICE_CREDENTIAL");

It is in the documentation as well.

Feature request: a button

Hi!
After playing with Thinger.io for the past few days (it's amazingly awesome) I'm missing one great feature: a possibility to fire a single event on an Arduino right from the dashboard. Similar to what would happen if you pushed a physical push button.
For instance: I'm using Thinger.io to control the LED lightning in my Aquarium. On set times a sunrise or sunset effect would start to run. But I would love to create a way to fire additional effects like:

  • stopping all current effects
  • starting a lightning-strike-effect

Are there any plans to facilitate triggers for such purposes?

schermafbeelding 2016-10-22 om 12 22 20

Thinger locks up ESP8266

I'm using the basic example 8266 sketch on a WeMos D1 Mini Pro. The module will randomly lock up hard. It seems to do it more when I'm logged into my thinger dashboard.

Any ideas of what could be causing this? I've also posted on the 8266.

Thank you

Fixe IP adress

Hello,

When I use "WiFi.config(ip)" in the setup to use fixe IP adress with MKR1000 or MKR WiFi1010, the connection to network work, but not the connection to thinger.io

Debug :

[NETWORK] Starting connection...
[NETWORK] Connecting to network xxxxxxxxxxxxxx
[NETWORK] Connected to WiFi!
[NETWORK] Getting IP Address...
[NETWORK] Got IP Address: 192.168.0.32
[NETWORK] Connected!
[_SOCKET] Connecting to iot.thinger.io:25202...
[_SOCKET] Using secure TLS/SSL connection: yes
[_SOCKET] Error while connecting!
[_SOCKET] Connecting to iot.thinger.io:25202...
[_SOCKET] Using secure TLS/SSL connection: yes
[_SOCKET] Error while connecting!
[_SOCKET] Connecting to iot.thinger.io:25202...
[_SOCKET] Using secure TLS/SSL connection: yes
[_SOCKET] Error while connecting!

Any help is greatly appreciated.
thanks

NodeMCU: WDT Reset in combination with HX711.h

I am using a NodeMCU 1.0 ESP-12E with Arduino HX711 to connect load cells.
Your library constantly produces WDT reset in combination with the HX711 library. Unfortunately this stops me from using Thinger.io
https://github.com/bogde/HX711

The code I used:
SDK:2.2.1(cfd48f3)/Core:2.4.2/lwIP:2.0.3(STABLE-2_0_3_RELEASE/glue:arduino-2.4.1-13-g163bb82)/BearSSL:6d1cefc

#include <ThingerESP8266.h>
#include <HX711.h>



#define USERNAME "xx"
#define DEVICE_ID "xx"
#define DEVICE_CREDENTIAL "xx"

#define SSID "xx"
#define SSID_PASSWORD "xx"

ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

void setup() {
  Serial.begin(74880);
  Serial.setTimeout(2000);
  // Wait for serial to initialize.
  while (!Serial) { }
  pinMode(LED_BUILTIN, OUTPUT);

  thing.add_wifi(SSID, SSID_PASSWORD);

  // digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
  thing["led"] << digitalPin(LED_BUILTIN);

  // resource output example (i.e. reading a sensor value)
  thing["millis"] >> outputValue(millis());

  // more details at http://docs.thinger.io/arduino/
}

void loop() {
  thing.handle();
}

The Error:

SDK:2.2.1(cfd48f3)/Core:2.4.2/lwIP:2.0.3(STABLE-2_0_3_RELEASE/glue:arduino-2.4.1-13-g163bb82)/BearSSL:6d1cefc
[NETWORK] Starting connection...
[NETWORK] Connecting to network wrt_2_4
mode : sta(80:7d:3a:69:30:f2) + softAP(82:7d:3a:69:30:f2)
add if0

Soft WDT reset

ctx: cont
sp: 3ffffd50 end: 3fffffd0 offset: 01b0

stack>>>
3fffff00: 426f7437 00002179 000001c8 4010020c
3fffff10: 00000000 4bc6a7f0 67ef9db2 00000000
3fffff20: 00000000 00000000 4bc6a7f0 00000000
3fffff30: 3ffefb00 000001dc 40106848 0000671a
3fffff40: 4023be76 3ffef948 00007530 00000003
3fffff50: 4023d043 0000002c 00000038 3ffefa68
3fffff60: 3fff01e4 402046d4 3ffef948 3ffefa68
3fffff70: 00005a9e 00007530 3ffef948 40202b4d
3fffff80: 00000000 3ffef8e0 0000002c 40206a1d
3fffff90: 3fffdad0 00000001 3ffef8bc 402040c5
3fffffa0: 3fffdad0 00000000 3ffef8bc 402041d8
3fffffb0: feefeffe 00000000 3ffefa60 40206bd4
3fffffc0: feefeffe feefeffe 3ffe8624 40100a49
<<<stack<<<

Arduino + Ethernet compiling error

Unable to compile the example code for arduino and ethernet.


In file included from C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerEthernet.h:29:0,
                 from C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\examples\Arduino\ArduinoEthernet\ArduinoEthernet.ino:3:
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:540:34: error: 'std::function' has not been declared
     void set_state_listener(std::function<void(THINGER_STATE)> state_listener){
                                  ^~~~~~~~
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:540:42: error: expected ',' or '...' before '<' token
     void set_state_listener(std::function<void(THINGER_STATE)> state_listener){
                                          ^
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:557:10: error: 'function' in namespace 'std' does not name a template type
     std::function<void(THINGER_STATE)> state_listener_;
          ^~~~~~~~
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function 'virtual void ThingerClient::run_reboot()':
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:20: error: 'WDTO_15MS' was not declared in this scope
         wdt_enable(WDTO_15MS);
                    ^~~~~~~~~
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:9: error: 'wdt_enable' was not declared in this scope
         wdt_enable(WDTO_15MS);
         ^~~~~~~~~~
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:361:9: note: suggested alternative: 'mutable'
         wdt_enable(WDTO_15MS);
         ^~~~~~~~~~
         mutable
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function 'virtual void ThingerClient::thinger_state_listener(ThingerClient::THINGER_STATE)':
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:425:12: error: 'state_listener_' was not declared in this scope
         if(state_listener_) state_listener_(state);
            ^~~~~~~~~~~~~~~
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:425:12: note: suggested alternative: 'set_state_listener'
         if(state_listener_) state_listener_(state);
            ^~~~~~~~~~~~~~~
            set_state_listener
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function 'void ThingerClient::set_state_listener(int)':
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:9: error: 'state_listener_' was not declared in this scope
         state_listener_ = state_listener;
         ^~~~~~~~~~~~~~~
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:9: note: suggested alternative: 'set_state_listener'
         state_listener_ = state_listener;
         ^~~~~~~~~~~~~~~
         set_state_listener
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:27: error: 'state_listener' was not declared in this scope
         state_listener_ = state_listener;
                           ^~~~~~~~~~~~~~
C:\Users\M.Arsalan\Documents\Arduino\libraries\thinger.io\src/ThingerClient.h:541:27: note: suggested alternative: 'set_state_listener'
         state_listener_ = state_listener;
                           ^~~~~~~~~~~~~~
                           set_state_listener
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Use seperate wifi connection

I like to use thinger.io but I like to setup the wifi connection via ESP8266WiFi.h since there seams to be a problem connecting to a WIFI after deep sleep of the esp8266. Is this possible?

ThingerTinyGSM.h does not compile with FreeRTOS

Olá, @alvarolb

The ThingerTinyGSM.h file needs to be fixed so that it can compile with FreeRTOS.
The correction proposal below is correct:

Here (link)

class ThingerTinyGSM : public ThingerClient

#ifdef THINGER_FREE_RTOS
,public ThingerESP32FreeRTOS
#endif

{

public:
    ThingerTinyGSM(const char* user, const char* device, const char* device_credential, Stream& serial) :
        ThingerClient(client_, user, device, device_credential),
        #ifdef THINGER_FREE_RTOS
        ThingerESP32FreeRTOS(static_cast<ThingerClient&>(*this)),
        #endif
        modem_(serial),
        client_(modem_)
    {

compile error

Arduino IDE return an compile error in thinger_resource.hpp when I include "ThingerYun.h".
enum access_type > "INTERNAL" is redefined.
This is defined in Arduino.hpp and is included by default.
I try to delete thinger_resource.hpp line 56.
It works.

Using Thinger TinyGSM library with SIM7600

I am wondering, is it possible to connect to the thinger io dashboard using the tinygsm library but using a 4g module like the sim7600g, the example in the library just shows a few modems as shown below.

// Select your modem:
#define TINY_GSM_MODEM_SIM800
//#define TINY_GSM_MODEM_SIM900
//#define TINY_GSM_MODEM_A6
//#define TINY_GSM_MODEM_A7
//#define TINY_GSM_MODEM_M590

CA_ROOT_CERTIFICATE defined as a global variable

CA_ROOT_CERTIFICATE is defined as a global in ThingerClient.h, so makes the library difficult to use when needing to add to multiple files in the same build. Possible solutions - 1) change CA_ROOT_CERTIFICATE to a #define instead of a global variable. 2) pass the cert in the constructor and let the user define the correct cert...

Arduino-Library library loops when trying to connect to websocket via GSM

I identified that, in occasional situations, after the GSM modem connects with the APN, the library is stuck trying to connect in the websocket.
Apparently, this problem might be with the TinyGSM library. (vshymanskyy/TinyGSM#62, vshymanskyy/TinyGSM#434, vshymanskyy/TinyGSM#35, vshymanskyy/TinyGSM#57, )
However, could the Arduino-Library library make some approach to work around this problem? Any approach to clear cache, or try 10 times and restart the modem?
I remember that Arduino-Library already made similar approaches when it had a problem getting the date and time from NTP (see this post).

11:03:34.551 > [NETWORK] Starting connection...
11:03:34.552 > Thinger State Listener: NETWORK_CONNECTING
11:03:34.571 > [NETWORK] Initializing Modem...
11:03:39.695 > [NETWORK] Modem Info: XXXXXXXXXXXXXX
11:03:39.716 > [NETWORK] Waiting for Network...
11:03:56.129 > [NETWORK] Network Connected!
11:03:56.148 > [NETWORK] Connecting to APN...
11:04:59.787 > [NETWORK] Connected!
11:04:59.807 > Thinger State Listener: NETWORK_CONNECTED
11:04:59.824 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:04:59.824 > [_SOCKET] Using secure TLS/SSL connection: yes
11:04:59.829 > Thinger State Listener: SOCKET_CONNECTING
11:06:14.872 > [_SOCKET] Error while connecting!
11:06:14.884 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:06:24.033 > [NETWORK] Starting connection...
11:06:24.033 > Thinger State Listener: NETWORK_CONNECTING
11:06:24.094 > [NETWORK] Connecting to APN...
11:06:30.766 > [NETWORK] Connected!
11:06:30.785 > Thinger State Listener: NETWORK_CONNECTED
11:06:30.802 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:06:30.802 > [_SOCKET] Using secure TLS/SSL connection: yes
11:06:30.808 > Thinger State Listener: SOCKET_CONNECTING
11:07:45.843 > [_SOCKET] Error while connecting!
11:07:45.861 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:07:51.000 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:07:51.008 > [_SOCKET] Using secure TLS/SSL connection: yes
11:07:51.013 > Thinger State Listener: SOCKET_CONNECTING
11:08:05.039 > [_SOCKET] Error while connecting!
11:08:05.057 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:08:10.190 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:08:10.196 > [_SOCKET] Using secure TLS/SSL connection: yes
11:08:10.202 > Thinger State Listener: SOCKET_CONNECTING
11:08:24.243 > [_SOCKET] Error while connecting!
11:08:24.264 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:08:29.394 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:08:29.400 > [_SOCKET] Using secure TLS/SSL connection: yes
11:08:29.406 > Thinger State Listener: SOCKET_CONNECTING
11:08:43.457 > [_SOCKET] Error while connecting!
11:08:43.462 > Thinger State Listener: SOCKET_CONNECTION_ERROR  
11:08:48.598 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:08:48.613 > [_SOCKET] Using secure TLS/SSL connection: yes       
11:08:48.613 > Thinger State Listener: SOCKET_CONNECTING
11:09:02.647 > [_SOCKET] Error while connecting!
11:09:02.647 > Thinger State Listener: SOCKET_CONNECTION_ERROR  
11:09:07.782 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:09:07.782 > [_SOCKET] Using secure TLS/SSL connection: yes       
11:09:07.788 > Thinger State Listener: SOCKET_CONNECTING
11:09:21.840 > [_SOCKET] Error while connecting!
11:09:21.846 > Thinger State Listener: SOCKET_CONNECTION_ERROR  
11:09:26.976 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:09:26.982 > [_SOCKET] Using secure TLS/SSL connection: yes       
11:09:26.987 > Thinger State Listener: SOCKET_CONNECTING
11:09:41.044 > [_SOCKET] Error while connecting!
11:09:41.044 > Thinger State Listener: SOCKET_CONNECTION_ERROR  
11:09:46.175 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:09:46.181 > [_SOCKET] Using secure TLS/SSL connection: yes       
11:09:46.187 > Thinger State Listener: SOCKET_CONNECTING
11:10:00.237 > [_SOCKET] Error while connecting!
11:10:00.243 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:10:05.373 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:10:05.379 > [_SOCKET] Using secure TLS/SSL connection: yes
11:10:05.384 > Thinger State Listener: SOCKET_CONNECTING
11:10:19.432 > [_SOCKET] Error while connecting!
11:10:19.432 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:10:24.561 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:10:24.568 > [_SOCKET] Using secure TLS/SSL connection: yes
11:10:24.573 > Thinger State Listener: SOCKET_CONNECTING
11:10:38.592 > [_SOCKET] Error while connecting!
11:10:38.600 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:10:43.727 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:10:43.733 > [_SOCKET] Using secure TLS/SSL connection: yes
11:10:43.746 > Thinger State Listener: SOCKET_CONNECTING
11:10:57.796 > [_SOCKET] Error while connecting!
11:10:57.796 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:11:02.927 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:11:02.933 > [_SOCKET] Using secure TLS/SSL connection: yes
11:11:02.939 > Thinger State Listener: SOCKET_CONNECTING
11:11:16.975 > [_SOCKET] Error while connecting!
11:11:16.976 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:11:22.111 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:11:22.111 > [_SOCKET] Using secure TLS/SSL connection: yes
11:11:22.117 > Thinger State Listener: SOCKET_CONNECTING
11:11:36.137 > [_SOCKET] Error while connecting!
11:11:36.142 > Thinger State Listener: SOCKET_CONNECTION_ERROR
11:11:41.272 > [_SOCKET] Connecting to xxxxxxxx.aws.thinger.io:25202...
11:11:41.277 > [_SOCKET] Using secure TLS/SSL connection: yes
11:11:41.283 > Thinger State Listener: SOCKET_CONNECTING

Is not possible thinger.io + WebSocketsServer.h

Hi.

My project uses websockets. Everything is fine until I insert in the main loop ()
"thing.handle()". Right next comes the call to the socket loop.

Then the loop function of the socket stops working or it does erratically.

There's a solution?

Got Fatal exception 28(LoadProhibitedCause) when using ThingerSmartConfig

Hi,
I'm building an MQ2 sensor on NodeMCU v3 board and I'd like to use deep sleep feature so that to run on low power profile. Having read many guides of how to build such a system with thinger IoT I came up with a code that (from my perspective) should run well, but it doesn't and I receive Fatal exception 28(LoadProhibitedCause) error.

One more note: I had to set #define DISABLE_TLS because otherwise it would fail with [_SOCKET] Error while connecting! error.

My set-up:
thinger-io 1.6.2
NodeMCU v3 LoLin 1.0

Arduino IDE 1.8.8
esp8266 2.5.2
thinger.io 2.13.0

ESP code
https://justpaste.it/5gbmh

Stack trace:
https://justpaste.it/1lig7

Bench of errors while compiling thinger code after updating to last version

Please help.
Wanting to test the console feature, I have uploaded today the complete zipped Thinger Arduino Master library from Github to my current Arduino IDE.

Now the IDE is broken and my sketches -also the old ones- do not compile for an ESP8266 any more.

Her are the errors reported.

Compiling library “thinger.io”
“C:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++” -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ “-IC:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3/tools/sdk/include” “-IC:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3/tools/sdk/lwip2/include” “-IC:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3/tools/sdk/libc/xtensa-lx106-elf/include” “-IC:\Users\MICHEL~1\AppData\Local\Temp\arduino_build_45804/core” -c -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 “-DARDUINO_BOARD=“ESP8266_NODEMCU”” -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 “-IC:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266” “-IC:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\variants\nodemcu” “-IC:\Users\RIN67630\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\Wire” “-ID:\5_Tinker\Arduino\libraries\INA2xx\src” “-ID:\5_Tinker\Arduino\libraries\ArduinoJson\src” “-ID:\5_Tinker\Arduino\libraries\TridentTD_OpenWeather-master\src” “-IC:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src” “-IC:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266HTTPClient\src” “-IC:\Users\Michel Firholz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ArduinoOTA” “-ID:\5_Tinker\Arduino\libraries\thinger.io\src” “-ID:\5_Tinker\Arduino\libraries\Arduino-Library-master\src” “-IC:\Users\RIN67630\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\EEPROM” “-IC:\Users\RIN67630\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266mDNS\src” “D:\5_Tinker\Arduino\libraries\thinger.io\src\thinger\ThingerConsole.cpp” -o “C:\Users\RIN67630\AppData\Local\Temp\arduino_build_45804\libraries\thinger.io\thinger\ThingerConsole.cpp.o”
In file included from D:\5_Tinker\Arduino\libraries\thinger.io\src\thinger\ThingerConsole.h:6:0,
from D:\5_Tinker\Arduino\libraries\thinger.io\src\thinger\ThingerConsole.cpp:1:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:89:25: error: expected ‘)’ before ‘&’ token
ThingerClient(Client& client, const char* user, const char* device, const char* device_credential) :
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:432:5: error: ‘Client’ does not name a type
Client& get_client(){
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:438:5: error: ‘Client’ does not name a type
Client& client_;
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘virtual bool ThingerClient::read(char*, size_t)’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:118:24: error: ‘client_’ was not declared in this scope
int read = client_.readBytes((char*)buffer+total_read, size-total_read);
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘bool ThingerClient::client_write(const char*, size_t)’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:213:26: error: ‘client_’ was not declared in this scope
size_t written = client_.write((uint8_t*) buffer, size);
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘virtual void ThingerClient::disconnected()’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:256:9: error: ‘client_’ was not declared in this scope
client_.stop();
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘virtual bool ThingerClient::connect_socket()’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:270:16: error: ‘client_’ was not declared in this scope
return client_.connect(host_, secure_connection() ? THINGER_SSL_PORT : THINGER_PORT);
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘bool ThingerClient::handle_connection()’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:352:12: error: ‘client_’ was not declared in this scope
if(client_.connected()) return true;
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘bool ThingerClient::connect_client()’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:370:9: error: ‘client_’ was not declared in this scope
client_.stop(); // cleanup previous socket
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘void ThingerClient::stop()’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:395:9: error: ‘client_’ was not declared in this scope
client_.stop();
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘void ThingerClient::handle()’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:402:32: error: ‘client_’ was not declared in this scope
size_t available = client_.available();
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h: In member function ‘bool ThingerClient::is_connected() const’:
D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:415:16: error: ‘client_’ was not declared in this scope
return client_.connected();
^
D:\5_Tinker\Arduino\libraries\thinger.io\src\thinger\ThingerConsole.cpp: In constructor ‘ThingerConsole::ThingerConsole(ThingerClient&)’:
D:\5_Tinker\Arduino\libraries\thinger.io\src\thinger\ThingerConsole.cpp:9:15: error: no match for ‘operator>>’ (operand types are ‘thinger::thinger_resource’ and ‘ThingerConsole::ThingerConsole(ThingerClient&)::_lambda0’)
resource >> [&](pson& out){
^
D:\5_Tinker\Arduino\libraries\thinger.io\src\thinger\ThingerConsole.cpp:9:15: note: candidate is:
In file included from D:\5_Tinker\Arduino\libraries\thinger.io\src/thinger/thinger.h:29:0,
from D:\5_Tinker\Arduino\libraries\thinger.io\src/ThingerClient.h:28,
from D:\5_Tinker\Arduino\libraries\thinger.io\src\thinger\ThingerConsole.h:6,
from D:\5_Tinker\Arduino\libraries\thinger.io\src\thinger\ThingerConsole.cpp:1:
D:\5_Tinker\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:305:10: note: void thinger::thinger_resource::operator>>(void (*)(protoson::pson&))
void operator>>(void (out_function)(protoson::pson& out)){
^
D:\5_Tinker\Arduino\libraries\thinger.io\src/thinger/thinger_resource.hpp:305:10: note: no known conversion for argument 1 from ‘ThingerConsole::ThingerConsole(ThingerClient&)::__lambda0’ to 'void ()(protoson::pson&)’
Multiple libraries were found for “ArduinoOTA.h”
Used: C:\Users\RIN67630\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ArduinoOTA
Not used: D:\5_Tinker\Arduino\libraries\ArduinoOTA
Multiple libraries were found for “ThingerESP8266.h”
Used: D:\5_Tinker\Arduino\libraries\thinger.io
Not used: D:\5_Tinker\Arduino\libraries\Arduino-Library-master

"SOCKET timeouts" causing lockups of an entire device when communicating with backend.

I am using currently using the thinger library on about 20 MKR NB devices, that connect over LTE-M or NBIOT, which is soon about to jump up to 80 devices. For that reason I desperately need a solution to this problem that I am having.

Basically, there seems to be three scenarios where the thinger library causes my devices to lockup and the only way to recover them is to use a watch-dog timer and reset the devices when detected. This has been an OK solution until now however it is happening so frequently (once per hour per device on average) that it effects the the battery life of my devices as they need to go through the startup sequence every time.

These three different errors that I get in this scenario are "Writing bytes [FAIL]", “[_SOCKET] cannot read from socket!” and "[_SOCKET] Timeout!". All cause my device to lock up indefinitely. Screenshots are attached.

The SOCKET timeouts seems to happen more frequently in some of the afternoons. It seems like then there are more people in our office building and potentially in the buildings around us (more devices connecting using the network?)

It has been a problem the whole time I have been using this library with this device but I solved it temporarily with a watchdog reset.

Someone else also seems to have had a similar issue when using the GSM version on the MKR https://community.thinger.io/t/mkr-gsm-1400-losing-connection-to-thinger-io/2991

Can someone help with this issue ASAP as it is causing us a lot of downstream problems with our product.

Thanks!

Screen Shot 2023-04-06 at 20 13 25
Screen Shot 2023-04-06 at 20 21 07
Screen Shot 2023-04-09 at 11 54 35
Screen Shot 2023-04-06 at 20 24 34
Screen Shot 2023-04-06 at 20 01 00
Screen Shot 2023-04-06 at 21 04 27
Untitled

Error compiling for esp8266

Here are the errors that i recived

In file included from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.h:6:0,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.cpp:1:

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:90:25: error: expected ')' before '&' token

     ThingerClient(Client& client, const char* user, const char* device, const char* device_credential) :

                         ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:435:5: error: 'Client' does not name a type

     Client& get_client(){

     ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:441:5: error: 'Client' does not name a type

     Client& client_;

     ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h: In member function 'virtual bool ThingerClient::read(char*, size_t)':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:119:24: error: 'client_' was not declared in this scope

             int read = client_.readBytes((char*)buffer+total_read, size-total_read);

                        ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h: In member function 'bool ThingerClient::client_write(const char*, size_t)':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:214:26: error: 'client_' was not declared in this scope

         size_t written = client_.write((uint8_t*) buffer, size);

                          ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h: In member function 'virtual void ThingerClient::disconnected()':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:257:9: error: 'client_' was not declared in this scope

         client_.stop();

         ^

In file included from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:28:0,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.h:6,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.cpp:1:

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h: In member function 'virtual bool ThingerClient::connect_socket()':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:271:34: error: 'client_' was not declared in this scope

         synchronized(bool result=client_.connect(host_, secure_connection() ? THINGER_SSL_PORT : THINGER_PORT);)

                                  ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\thinger/thinger.h:46:9: note: in definition of macro 'synchronized'

         code

         ^

In file included from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.h:6:0,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.cpp:1:

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h: In member function 'bool ThingerClient::connect_client()':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:372:9: error: 'client_' was not declared in this scope

         client_.stop(); // cleanup previous socket

         ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h: In member function 'void ThingerClient::stop()':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:397:9: error: 'client_' was not declared in this scope

         client_.stop();

         ^

In file included from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:28:0,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.h:6,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.cpp:1:

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h: In member function 'void ThingerClient::handle()':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:404:45: error: 'client_' was not declared in this scope

             synchronized(size_t available = client_.available();)

                                             ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\thinger/thinger.h:46:9: note: in definition of macro 'synchronized'

         code

         ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h: In member function 'bool ThingerClient::is_connected()':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:417:36: error: 'client_' was not declared in this scope

         synchronized(bool result = client_.connected();)

                                    ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\thinger/thinger.h:46:9: note: in definition of macro 'synchronized'

         code

         ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.cpp: In constructor 'ThingerConsole::ThingerConsole(ThingerClient&)':

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.cpp:9:15: error: no match for 'operator>>' (operand types are 'thinger::thinger_resource' and 'ThingerConsole::ThingerConsole(ThingerClient&)::__lambda0')

     resource_ >> [&](pson& out){

               ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.cpp:9:15: note: candidate is:

In file included from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\thinger/thinger.h:29:0,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerClient.h:28,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.h:6,

                 from C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\ThingerConsole.cpp:1:

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\thinger/thinger_resource.hpp:305:10: note: void thinger::thinger_resource::operator>>(void (*)(protoson::pson&))

     void operator>>(void (*out_function)(protoson::pson& out)){

          ^

C:\Users\PC-13\Documents\Arduino\libraries\Arduino-Library-master\src\thinger/thinger_resource.hpp:305:10: note:   no known conversion for argument 1 from 'ThingerConsole::ThingerConsole(ThingerClient&)::__lambda0' to 'void (*)(protoson::pson&)'

arduino +tinygsm

hello im working arduino to tinygsm but now compile and have error
my code is
#define THINGER_SERIAL_DEBUG

// Select your modem:
#define TINY_GSM_MODEM_SIM800
//#define TINY_GSM_MODEM_SIM900
//#define TINY_GSM_MODEM_A6
//#define TINY_GSM_MODEM_A7
//#define TINY_GSM_MODEM_M590

// Can be installed from Library Manager or https://github.com/vshymanskyy/TinyGSM
#include <TinyGsmClient.h>
#include <ThingerTinyGSM.h>
#include "arduino_secrets.h"

// Emulate Serial1 on pins 10/11 if HW is not present (use interrupt pin in RX for better performance)
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(10, 11); // RX, TX
#endif

ThingerTinyGSM thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL, Serial1);

void setup() {
// open serial for debugging
Serial.begin(115200);

// Serial for AT commands (can be higher with HW Serial, or even lower in SW Serial)
Serial1.begin(57600);

// set APN (you can remove user and password from call if your apn does not require them)
thing.setAPN(APN_NAME, APN_USER, APN_PSWD);

// set PIN (optional)
// thing.setPIN(CARD_PIN);

// resource input example (i.e, controlling a digitalPin);
pinMode(LED_BUILTIN, OUTPUT);
thing["led"] << digitalPin(LED_BUILTIN);

// resource output example (i.e. reading a sensor value)
thing["millis"] >> outputValue(millis());

// more details at http://docs.thinger.io/arduino/
}

void loop() {
thing.handle();
}
and error compile is
In file included from C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:28:0,
from C:\Users\Instrum\Documents\Arduino\libraries\Arduino-Library-master\examples\Arduino\ArduinoTinyGSM\ArduinoTinyGSM.ino:12:
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:540:34: error: 'std::function' has not been declared
void set_state_listener(std::function<void(THINGER_STATE)> state_listener){
^~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:540:42: error: expected ',' or '...' before '<' token
void set_state_listener(std::function<void(THINGER_STATE)> state_listener){
^
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:557:10: error: 'function' in namespace 'std' does not name a template type
std::function<void(THINGER_STATE)> state_listener_;
^~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h: In member function 'virtual void ThingerClient::run_reboot()':
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:361:20: error: 'WDTO_15MS' was not declared in this scope
wdt_enable(WDTO_15MS);
^~~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:361:9: error: 'wdt_enable' was not declared in this scope
wdt_enable(WDTO_15MS);
^~~~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:361:9: note: suggested alternative: 'mutable'
wdt_enable(WDTO_15MS);
^~~~~~~~~~
mutable
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h: In member function 'virtual void ThingerClient::thinger_state_listener(ThingerClient::THINGER_STATE)':
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:425:12: error: 'state_listener_' was not declared in this scope
if(state_listener_) state_listener_(state);
^~~~~~~~~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:425:12: note: suggested alternative: 'set_state_listener'
if(state_listener_) state_listener_(state);
^~~~~~~~~~~~~~~
set_state_listener
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h: In member function 'void ThingerClient::set_state_listener(int)':
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:541:9: error: 'state_listener_' was not declared in this scope
state_listener_ = state_listener;
^~~~~~~~~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:541:9: note: suggested alternative: 'set_state_listener'
state_listener_ = state_listener;
^~~~~~~~~~~~~~~
set_state_listener
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:541:27: error: 'state_listener' was not declared in this scope
state_listener_ = state_listener;
^~~~~~~~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerClient.h:541:27: note: suggested alternative: 'set_state_listener'
state_listener_ = state_listener;
^~~~~~~~~~~~~~
set_state_listener
In file included from C:\Users\Instrum\Documents\Arduino\libraries\Arduino-Library-master\examples\Arduino\ArduinoTinyGSM\ArduinoTinyGSM.ino:12:0:
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h: At global scope:
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:123:30: error: 'std::function' has not been declared
void setModuleReset(std::function<void()> module_reset){
^~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:123:38: error: expected ',' or '...' before '<' token
void setModuleReset(std::function<void()> module_reset){
^
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:138:10: error: 'function' in namespace 'std' does not name a template type
std::function<void()> module_reset_;
^~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h: In member function 'virtual bool ThingerTinyGSM::connect_network()':
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:59:12: error: 'module_reset_' was not declared in this scope
if(module_reset_) module_reset_();
^~~~~~~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:59:12: note: suggested alternative: 'setModuleReset'
if(module_reset_) module_reset_();
^~~~~~~~~~~~~
setModuleReset
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h: In member function 'void ThingerTinyGSM::setModuleReset(int)':
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:124:9: error: 'module_reset_' was not declared in this scope
module_reset_ = module_reset;
^~~~~~~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:124:9: note: suggested alternative: 'setModuleReset'
module_reset_ = module_reset;
^~~~~~~~~~~~~
setModuleReset
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:124:25: error: 'module_reset' was not declared in this scope
module_reset_ = module_reset;
^~~~~~~~~~~~
C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621\src/ThingerTinyGSM.h:124:25: note: suggested alternative: 'setModuleReset'
module_reset_ = module_reset;
^~~~~~~~~~~~
setModuleReset
Multiple libraries were found for "ThingerTinyGSM.h"
Used: C:\Users\Instrum\Documents\Arduino\libraries\arduino_767621
Not used: C:\Users\Instrum\Documents\Arduino\libraries\Arduino-Library-master
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Consider adding a badge from ArduBadge

Hi,
Consider adding this badge from ArduBadge:
arduino-library-badge
Markdown:
[![arduino-library-badge](https://www.ardu-badge.com/badge/thinger.io.svg?)](https://www.ardu-badge.com/thinger.io)
It shows the latest version that is available on the Arduino IDE (and that the library is indeed in the IDE's Library Manager). Also, clicking on the badge redirects to a custom page with instructions for installing thinger.io from the IDE and from a ZIP file.
I saw you have a really good and specific installations instructions yourself here. So, you might want to change the badge to redirect to that tutorial instead of ardu-badge.com. Like this:
arduino-library-badge
[![arduino-library-badge](https://www.ardu-badge.com/badge/thinger.io.svg?)](http://docs.thinger.io/arduino/)
Hope you liked it :)

Using Debug causes compiler errors

Hi,

while playing around with Thinger.io a lot ore the past few days, I found a possible bug.
I've spend several hours googling but I believe my level of knowledge of AVR behaviour is insufficient to really understand what's going on here.

Basically the situation is as follows:

  • use #define _DEBUG_on the very first line of the sketch. Works great
  • add a line like const char WiFi_Logo_bits[] PROGMEM = { and compile errors will occur

Looking at the Thinger source code I believe some enhancements are possible; after reading a lot of other topics on other platforms the Serial.println(F()) statement comes up a lot. This one could be used differently to play nicer with the PROGMEM function. But again, this may be a complete misinterpretation since my leve of knowledge of deep-level-AVR-behaviour is not sufficient at this time.

For reference: here are the pieces of code and the compiler error.
I'm very interested in further thoughts on this issue!

Compiler error one

error: WiFi_Logo_bits causes a section type conflict with __c
 const char WiFi_Logo_bits[] PROGMEM = {

Compiler error two

ThingerWifi.h:66:9: note: in expansion of macro 'THINGER_DEBUG_VALUE'
         THINGER_DEBUG_VALUE("NETWORK", "Got IP Address: ", WiFi.localIP());
         ^

Code added that causes the compiler errors, when Debug is enabled:

#define WiFi_Logo_width 60
#define WiFi_Logo_height 36

const char WiFi_Logo_bits[] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00,
  0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF,
  0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00,
  0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
  0xFF, 0x03, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0xFF, 0xFF, 0xFF, 0x07, 0xC0, 0x83, 0x01, 0x80, 0xFF, 0xFF, 0xFF,
  0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0C, 0x00,
  0xC0, 0xFF, 0xFF, 0x7C, 0x00, 0x60, 0x0C, 0x00, 0xC0, 0x31, 0x46, 0x7C,
  0xFC, 0x77, 0x08, 0x00, 0xE0, 0x23, 0xC6, 0x3C, 0xFC, 0x67, 0x18, 0x00,
  0xE0, 0x23, 0xE4, 0x3F, 0x1C, 0x00, 0x18, 0x00, 0xE0, 0x23, 0x60, 0x3C,
  0x1C, 0x70, 0x18, 0x00, 0xE0, 0x03, 0x60, 0x3C, 0x1C, 0x70, 0x18, 0x00,
  0xE0, 0x07, 0x60, 0x3C, 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C,
  0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00,
  0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x8F, 0x71, 0x3C,
  0x1C, 0x70, 0x18, 0x00, 0xC0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x08, 0x00,
  0xC0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x0C, 0x00, 0x80, 0xFF, 0xFF, 0x1F,
  0x00, 0x00, 0x06, 0x00, 0x80, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x07, 0x00,
  0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0xFF, 0xFF,
  0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00,
  0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF,
  0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  };

Compiling issue on PIO / esp32

This library always causes compiling issues and I don't know why...

grafik
It just feels like the whole library is broken...

Teensy 4.1 NativeEthernet

I have problem getting NativeEthernet library to work with thinger.io.
Everyhting should work just like Ethernet library but NativeEthernet library just gets stuck somewhere and also Debug doesn't work.
Also if I use Libraries for mbed from alvarob using mbed with platformio on same chip there is no problem.
Any help would be great.

Typo correction to docs.thinger.io

han instead of can as follows:

follow path ->

ADDING RESOURCES > Input Resources > Turn on/off a led, a relay, etc > As the pson type han hold multiple data types, we can think that the pson parameter of the input function is like a boolean.

should read:

As the pson type CAN (not han) hold multiple data types, . . .

Compile error - MKRWifi1010

Hello,

With Arduino IDE 1.8.10, ArduinoMKR1010 example return an compile error in thinger :

….arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2

 min(const _Tp& __a, const _Tp& __b, _Compare __comp)

Any idea ?

Thinger IO response timestamp to Proper time

I sending request to fetch devices and its details by using following URL

http://{myip}/v1/users/username/devices?authorization={mytoken}

and i get the following response

[
{
"device":"nodemcu",
"description":"NodeMCU With ESP8266",
"connection":{
"active":true,
"ts":1486047553711
}
}
]

I want to convert the ts "1486047553711" to proper date time.

Any help

Unable to update OTA anymore on Arduino RP2040

I am currently unable to update the firmware of my devices over the air. The procedure seems to go fine, I can see the devices online, I can push the update and I see bar progressing, but after that the device just reboots in its previous state. This happens on the devices already shipped and installed remotely.

To give some context, I am using Arduino RP2040 in stock condition. My code doesn't do anything special, just collects some data from the sensors. It used to work perfectly fine until few months ago, but I am now stuck with OTA.

I did some tests on some devices here with me. Tried uploading via USB and if I start from scratch the device get stuck and never boots correctly. That means it doesn't reach even the Serial.print at the very beginning of the setup. The only way to make it work is to exclude the ThingerMbedOTA.h from the code. In this case the device works as intended, but clearly there's no OTA anymore.

I also tried reverting to the thinger library version 2.21.0, and with this I can indeed upload with the OTA extension active. The system works then as intended but again when I update remotely the device just reboots in its previous state.

Since the devices I have shipped probably have an old thinger library version, this leads me to think there's an bug/incompatibility with the OTA thinger later versions.

Please advise.

Thanks,
Antonio

Error when building

I get the following error when i Compile the sources with PlatformIO.

Compiling .pioenvs/d1_mini_lite/src/main.cpp.o In file included from .piolibdeps/thinger.io_ID648/src/thinger/thinger.h:29:0, from .piolibdeps/thinger.io_ID648/src/ThingerClient.h:27, from .piolibdeps/thinger.io_ID648/src/ThingerSmartConfig.h:28, from src/main.cpp:1: .piolibdeps/thinger.io_ID648/src/thinger/thinger_resource.hpp:91:5: error: expected ';' at end of member declaration io_type io_type_; ^

// EDIT
Bug seems fixed in the sources. Might not up to date in PlatformIO?

OTA support in "WebConfig/WiFiManager"

In general, devices sold by companies use "WebConfig/WiFiManager", as it is the user who will indicate the SSID and password of the WIFI router.

It would be important to update "ThingerWebConfig.h" to support OTA update and ESP32 support (if WiFiManager library already supports ESP32)

Latest change has a constant Socket Connection Error

Hi,

I just updated to 2.16.0 and can no longer connect. To debug the error, I've overridden the ClientListener class and added some Serial.println statements for each connection state and connecting just gets stuck on Socket Connection Error. My code has not changed and worked just great with the previous lib version I had installed.

Any suggestions?

Thanks,
Roger

class ClientListener : public ThingerESP32{
public:
ClientListener(const char* user, const char* device, const char* device_credential) :
ThingerESP32(user, device, device_credential){}

bool NETWORK_CONNECT_STATUS_ERROR = false;
bool NETWORK_CONNECT_STATUS_CONNECTED = false;
bool Thing_Connected = false;
bool WifiConnected = false;
bool thing_NETWORK_CONNECTING = false;
bool thing_SOCKET_CONNECTING = false;
bool thing_SOCKET_TIMEOUT = false;

protected:
virtual void thinger_state_listener(THINGER_STATE state){
// call current implementation (debug)
ThingerESP32::thinger_state_listener(state);
switch(state){
case NETWORK_CONNECTING:
thing_NETWORK_CONNECTING = true;
Serial.println("Network Connecting");
break;
case NETWOR K_CONNECTED:
WifiConnected = true;
Serial.println("Wifi Connected");
break;
case NETWORK_CONNECT_ERROR:
NETWORK_CONNECT_STATUS_ERROR = true;
Serial.println("Network connect status error");
break;
case SOCKET_CONNECTING:
Serial.println("Socket Connecting");
thing_SOCKET_CONNECTING;
break;
case SOCKET_CONNECTED:
Serial.println("Socked Connected");
break;
case SOCKET_CONNECTION_ERROR:
Serial.println("Socked Connection Error");
break;
case SOCKET_DISCONNECTED:
Serial.println("Socket disconnected");
break;
case SOCKET_TIMEOUT:
thing_SOCKET_TIMEOUT;
Serial.println("Socked timeout");
break;
case THINGER_AUTHENTICATING:
Serial.println("Authenticating");
break;
case THINGER_AUTHENTICATED:x
Serial.println("Authenticated");
Thing_Connected = true;
break;
case THINGER_AUTH_FAILED:
Serial.println("Auth Failed");
break;
case THINGER_STOP_REQUEST:
Serial.println("Stop Request");
break;
default:
// turn off your led
break;
}
}
};

ClientListener thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

Arduino Mega locks up constantly

Here is my code, i have tried the public server and now also a local server
I have also swapped from my ISR using timer1 to timer3 incase that was the problem.

#define THINGER_SERVER "10.20.0.252"

#include <SPI.h>
#include <Ethernet.h>
#include <ThingerEthernet.h>
#include <TimerThree.h>

#define USERNAME "12345678"
#define DEVICE_ID "12345678"
#define DEVICE_CREDENTIAL "12345678"

ThingerEthernet thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

volatile unsigned long count = 0;
volatile bool alarming = false;
bool last_alarming = false;
volatile unsigned int readings[] = { 400,400,400,400,400,400 };
bool alarm_enabled = false;

unsigned long lockTimeout;
unsigned long rearlockTimeout;
unsigned long currentMillis;

int intercom;
bool doorlocked = false;
bool reardoorlocked = false;
bool weekdayunlock = false;
bool lightsa = false;
bool lightsb = false;

void setup() {
  pinMode(0, INPUT_PULLUP);//not used
  pinMode(1, INPUT_PULLUP);//intercom
  pinMode(2, INPUT_PULLUP);//unlock pair
  pinMode(3, INPUT_PULLUP);//unlock pair
  
  pinMode(4, OUTPUT);
  digitalWrite(4, 0);//right contactor
  pinMode(5, OUTPUT);
  digitalWrite(5, 0);//left contactor
  pinMode(6, OUTPUT);
  digitalWrite(6, 0);//rear door
  pinMode(7, OUTPUT);
  digitalWrite(7, 0);//front door

  Timer3.initialize(500000); //2Hz
  Timer3.attachInterrupt(ISR_10hz);

  thing["frontdoor"] = []() {
    doorlocked = false;
    lockTimeout = currentMillis + 2000;
  };

  thing["backdoor"] = []() {
    reardoorlocked = false;
    rearlockTimeout = currentMillis + 2000;
  };

  thing["alarm"] << [](pson& in) {
    if(in.is_empty()) {
      in = alarm_enabled;
    }
    else {
      alarm_enabled = in;
    }
  };

  thing["weekdayunlock"] << [](pson& in) {
    if(in.is_empty()) {
      in = weekdayunlock;
    }
    else {
      weekdayunlock = in;
    }
  };

  thing["frontlight"] << [](pson& in) {
    if(in.is_empty()) {
      in = lightsa;
    }
    else {
      lightsa = in;
    }
  };

  thing["rearlight"] << [](pson& in) {
    if(in.is_empty()) {
      in = lightsb;
    }
    else {
      lightsb = in;
    }
  };

  thing["bothlights"] << [](pson& in) {
    lightsa = in;
    lightsb = in;
  };
}

void loop() {
  currentMillis = millis();

  intercom = digitalRead(1);
  if(intercom == 0) {
    doorlocked = false;
    lockTimeout = currentMillis + 4000;
  }

  if (!doorlocked) {
    if (currentMillis >= lockTimeout) {
      doorlocked = true;
    }
  }

  if (!reardoorlocked) {
    alarm_enabled = false; //disable the alarm incase it was enabled
    if (currentMillis >= rearlockTimeout) {
      reardoorlocked = true;
    }
  }

  //write the reardoor
  digitalWrite(6, !reardoorlocked);

  //write the frontdoor
  if (weekdayunlock || !doorlocked || (digitalRead(2) == 0 && digitalRead(3))) {
    digitalWrite(7, 1);
    alarm_enabled = false; //disable the alarm incase it was enabled
  } else {
    //make sure door is locked
    digitalWrite(7, 0);
  }

  //check if the alarm has just been tripped
  if(alarming && !last_alarming) {
    thing.call_endpoint("alarming", thing["sensors"]);
  }
  
  last_alarming = alarming;

  //operate the lights
  digitalWrite(4, lightsa);
  digitalWrite(5, lightsb);

  thing.handle();
}

void ISR_10hz(void) {
  //TODO: keep track of state-machine here
  ++count;
  int reading;

  for (int i=0; i<6; i++) {
    reading = analogRead(i);

    //if the current reading has some problem
    if(alarm_enabled && reading < 300 || reading > 550) {
      //check if the last reading was broke too
      if(readings[i] < 300 || readings[i] > 550) {
        alarming = true;
      }
    }

    if(!alarm_enabled) {
      alarming = false;
    }

    //store the result
    readings[i] = reading;
  }
}

thing.call_endpoint crashing on ESP8266

Hey! I'm trying the call_endpoint function with the arduino library in an esp8266-12e, when I run the function sometimes it works and I receive the info but all the time the esp restarts, like it's crashing. This is my code:

thing.call_endpoint("puerta_abierta");

and esp log:

ets Jan 8 2013,rst cause:4, boot mode:(1,6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.