Coder Social home page Coder Social logo

arduino-libraries / arduinoiotcloud Goto Github PK

View Code? Open in Web Editor NEW
102.0 22.0 73.0 2.05 MB

Home Page: https://app.arduino.cc

License: Other

C 84.46% C++ 15.33% CMake 0.10% Python 0.11%
arduino iot cloud arduino-iot-cloud arduinocloud arduinoiotcloud arduinoiot

arduinoiotcloud's Introduction

ArduinoIoTCloud

Check Arduino status Compile Examples Spell Check Unit Tests codecov

What?

The ArduinoIoTCloud library is the central element of the firmware enabling certain Arduino boards to connect to the Arduino IoT Cloud. The following boards are supported:

How?

  1. Register your Arduino IoT Cloud capable board via Arduino IoT Cloud (Devices Section).
  2. Create a new logical representation known as a Thing.

Arduino IoT Cloud Components

  • Devices: Physical objects built around a board (e.g. MKR WiFi 1010). This is the hardware which runs the sketch, reads sensors, controls actuators and communicates with the Arduino IoT Cloud.

  • Things: Logical representation of a connected object. They embody inherent properties of the object, with as little reference to the actual hardware or code used to implement them. Each Thing is represented by a collection of Properties (e.g., temperature, light, pressure...).

  • Properties: Qualities defining the characteristics of a system. A Property can be defined as read-only (READ) to indicate that Arduino IoT Cloud can read the data, but cannot change the value of such Property. On the other end, it may be designated to be read-and-write (READWRITE), allowing Arduino IoT Cloud to remotely change the property’s value and trigger an event notification on the device. It is also possible to mark properties as write-only (WRITE) which means the cloud can write to this property but not read its value (this limits data transmission for properties which are used to trigger events only).

How-to-use

  • thingProperties.h
void onLedChange();
/* ... */
bool led;
int seconds;
/* ... */
void initProperties() {
  ArduinoCloud.setThingId("ARDUINO-THING-ID");
  ArduinoCloud.addProperty(led, WRITE, ON_CHANGE, onLedChange);
  ArduinoCloud.addProperty(seconds, READ, ON_CHANGE);
}
/* ... */
WiFiConnectionHandler ArduinoIoTPreferredConnection("SECRET_SSID", "SECRET_PASS");
  • MyCloudApplication.ino
#include "thingProperties.h"

void setup() {
  Serial.begin(9600);
  while(!Serial) { }
  pinMode(LED_BUILTIN, OUTPUT);

  initProperties();
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
}

void loop() {
  ArduinoCloud.update();
  seconds = millis() / 1000;
}

void onLedChange() {
  digitalWrite(LED_BUILTIN, led);
}

FAQ

Watchdog

The 1.0.0 release of this library adds watchdog functionality to all ATSAMD21G18 based cloud connected boards. A watchdog is simply an electronic timer counting down from a preset start value which, upon reaching zero, triggers a reset of the microcontroller. It can be used to automatically recover from temporary hardware faults or unrecoverable software errors. In order to avoid the watchdog from reaching zero the countdown timer needs to be regularly re-set to its start value. This is happening within ArduinoCloud.update() which is periodically called at the start of the loop() function. Although the watchdog is automatically enabled it can be disabled by setting the second parameter of ArduinoCloud.begin(...) to false:

ArduinoCloud.begin(ArduinoIoTPreferredConnection, false).

Whatchdog is enabled by default using the following boards: MKR 1000, MKR WiFi 1010, MKR GSM 1400, MKR NB 1500, MKR WAN 1300/1310, Nano 33 IoT, Portenta H7, Nano RP2040 Connect, Nicla Vision, OPTA WiFi, OPTA RS485, OPTA Lite, GIGA R1 WiFi

Device can not subscribe to THING_ID

ArduinoIoTCloudTCP::handle_SubscribeMqttTopics could not subscribe to /a/t/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/e/i

In this case either the device has not been associated with the thing within the Arduino IoT Cloud GUI configuration or there's a typo in the thing ID.

OTA

OTA is supported by the following boards: MKR WiFi 1010, Nano 33 IoT, Portenta H7, Nano RP2040 Connect, Nicla Vision, OPTA WiFi, OPTA RS485, OPTA Lite, GIGA R1 WiFi, Nano ESP32, ESP32

Authentication

Boards can authenticate to the ArduinoIoTCloud servers using 3 methods:

arduinoiotcloud's People

Contributors

aentinger avatar agdl avatar alranel avatar andreagilardoni avatar cmaglie avatar dependabot[bot] avatar eclipse1985 avatar fabik111 avatar facchinm avatar ilcato avatar jorgetrujilloroman avatar karlsoderby avatar lorenzoromagnoli avatar luigigubello avatar manchoz avatar mastrolinux avatar matteosuppo avatar mattiabertorello avatar mbanzi avatar mirkokurt avatar pennam avatar per1234 avatar physicsuofraui avatar pratyush1606 avatar sandeepmistry avatar sid23 avatar ubidefeo avatar umbynos avatar zfields 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  avatar  avatar

arduinoiotcloud's Issues

MKRNB1500 + Arduino IoT Cloud Connection Issues

Board I am using: MKR NB 1500

Sensors: multiple IC sensors for physical environment readings

Power source: LiPo battery pack via on-board JST port

Other libraries: Arduino LowPower for SAMD

My problem is that I cannot get the board to maintain a connection consistently with the Arduino IoT cloud. I’m attempting to use the LowPower library to save power, but putting the board into sleep mode tends to disrupt the connection. I disabled sleep mode and the connection was maintained for a few hours last night, however it also seems to have been disrupted. I’ve also disabled the watchdog at this point because the code in my loop runs sometimes longer than the ~16 second timer, and a reset is undesirable.

I am looking to deploy the modules ‘in the field’ over extended periods. Is there a way I can ensure that my board stays connected, and to re-establish a connection to the Arduino IoT Cloud in the case that it disconnects? (I am exploring subscribing to the DISCONNECT event which triggers a callback that runs the ArduinoCloud.begin() method, thoughts on this?)

Thanks in advance and best regards,
Brennan.

Cannot connect to ArduinoIoTCloud

I get this every time I try to connect, any ideas?

[ 42816 ] Connected to [wifi]
[ 42817 ] Connecting to Arduino IoT Cloud...
[ 43124 ] Bogus NTP time from API, fallback to UDP method
[ 45229 ] Bogus NTP time from API, fallback to UDP method
[ 47206 ] Bogus NTP time from API, fallback to UDP method

Fix c++ warnings

After merging #66 and looking at the Travis build logs, it looks like this library triggers many c++ warnings.
Even if most of them are innocuos I think that it's worth trying to solve them anyway since sometimes they reveal some very hidden bugs.

Build and run unit tests during CI

#118 contains host buildable and executable unit-tests which test the OTA business logic. This unit tests shall be built and executed upon a commit to master or any other branch and failure to build the unit tests or the occurence of an error during execution shall be back-propagated to the user.

Instructions for building the unit tests:

cd extras/test
mkdir build && cd build
cmake ..
make && bash -c bin/testArduinoIoTCloud

Open the dashboard tab first

hi,
it would be nice to open the dashboard tab after the thing selection.
now it opens always showing the properties tab, but when the thing is up and running, it's more comfortable to go directly to the dashboard .

Screenshot 2019-11-14 11 40 18

Screenshot 2019-11-14 11 40 05

ArduinoCloud doesn't automatically reconnect?

The simple example projects to light up an LED work fine, but the whole thing stops working when WiFi connection gets momentarily lost, and it doesn't reconnect, requiring a reset.
If this is normal, then what is the recommended way to detect a disconnect and reconnect?
Thanks

Include property timestamp in CBOR message

Currently there are a couple of timestamps tracked with each property (_last_updated_millis, _last_local_change_timestamp, _last_cloud_change_timestamp). In future applications it might be interesting to include the timestamp of the value change into the CBOR message.

Implement property update policy OnDemand

Currently properties can either be updated via periodic time intervals (TimeInterval) or when the value does change significantly (OnChange). A 3rd update policy (OnDemand) shall be added which allows the transmission of all properties upon the call of a public available function, e.g. ArduinoIoTCloud.push.

ArduinoIoTCloud and ESPAsync_WiFiManager are not compatible.

Describe the bug

When trying to use an access point provided by ESPAsync_WiFiManager with the ArduinoIoTCloud functionality in the same Sketch, simply adding #include <ArduinoIoTCloud.h> to an ESPAsync_WiFiManager example project causes the access point web server to hang. This issue has been filed against ESPAsync_WiFiManager as well.

Steps to Reproduce

Add #include <ArduinoIoTCloud.h> to an ESPAsync_WiFiManager example. When the AP is accessed, the web server hangs.

Expected behavior

I expected to be able to use ESPAsync_WiFiManager to maintain a wifi connection, and when the connection was active, use ArduinoIoTCloud to control an ESP8266 node.

Actual behavior

When the Captive Portal is accessed by a web browser, the web server hangs and a blank page results.

Debug and AT-command log (if applicable)

It appears that the page is rendered correctly, but the web server hangs when it is served.

Screenshots

It's a blank page.

Information

Take any ESPAsync_WifiManager example and put the header #include <ArduinoIoTCloud.h> into the .ino and the captive web page will hang.

Please ensure to specify the following:

Arduino IDE version 1.8.15
ESP8266 D1 mini
Contextual information (e.g. what you were trying to achieve): I'd like to have the WiFi configuration provided by ESPAsync_WifiManager keep the ESP8266 connected so that I can use the Arduino IoT Cloud to control the device. So to start with I set up a ESPAsync_WiFiManager project and simply put the ArduinoIoTCloud header into the project.
Simplest possible steps to reproduce:
Steps to reproduce:

Get the most recent ArduinoIoTCloud and ESPAsync_WiFiManager libraries.
Set up an ESPAsync_WifiManager manager project such as Async_AutoConnectWithFeedbackLED
add #include <ArduinoIoTCloud.h> to the project.
It will compile, load to the ESP8266 and run.
When you try to connect to the Captured Portal, the browser will connect, the correct content appears to be delivered by viewing the source in the browser's development mode, but the page will be blank.

add a ArduinoIoTCloudClass::end() function for a regulated shutdown

I suggest to add a ArduinoIoTCloudClass::end() function for a regulated shutdown and restart of the whole cloud function. This would allow arduinos to shut down the cloud functions for power reasons (for example sleep mode) and enable them later again.

For example:

void ArduinoIoTCloudClass::end() {
  _connection->end();  // power down network interface - reduces power consumption from serveral mAs to a few uAs
  ECCX08.end();     // power down ECC508 - reduces power consumption from 800 uA to 6 uA
}

and add to the ConnectionManager a public end function. For the MKR WIFI 1010 for example WiFi.end();

Thank you

Analog Read Fluctuations after calling ArduinoCloud.begin(ArduinoIoTPreferredConnection)

I have an Arduino MKR Wifi 1010 board with a simple circuit setup. I'm doing an analogRead() from A0 for TMP36 temperature sensor. Everything works just fine when not using the Arduino IoT Cloud. As soon as a call is made to ArduinoCloud.begin(ArduinoIoTPreferredConnection); the values being read start to fluctuate all over the place. I don't have enough knowledge to know if I'm doing something that is not supported, or if there is a problem with the Arduino Cloud library.

Feature Request: LoRaWan Example for the Portenta with LoRa Vision Shield

@pennam

Feature Request: LoRaWan Example for the Portenta with LoRa Vision Shield

I can test out anyone's code, I might be able to make a stab at this.

Note: I use the very popular Helium Network, see coverage map here to see if there is a hexagon in your city. The final sketch should be similar to a sketch connecting to the TTN, coverage map here . Anyone who makes a login to the https://console.helium.com/ gets 10,000 data credits. Each send of data uses about 1 data credit.

MKRBN1500 Arduino IoT Cloud Connection Issue

Hello,

I just got an MKRNB 1500 and I am trying to connect it to the Arduino IoT Cloud platform and toggle ON/OFF the on-board LED but for some reason it is not working. I am tried multiple methods and ways to flash different examples and when I try to do it from the IoT Clould web IDE the board keeps rebooting endlessly and never connects to the cloud. The only example that I have managed to confirm working is a simple BLINK running but all the other MKRNB examples for IoT Cloud are not working. It is shown in tutorials that it could be done in minutes but I have been trying half a day without any luck yet.

I saw similar behaviour happening to other people on the Arduino Forum but no one got it to work and has mentioned it working.

Can you please advise what you should be done ?

Looking forward to hearing from you

Thanks,
ANC

Callback Sync only works once after reboot

Sync-Callback works fine but only once after reboot of device. Is it because of ESP32-board? Thing is connected and values are uploaded to IoT-Cloud, but the Sync-Event does not call the function again.

Internal compiling error

Hi!

I'm getting this compiling errors while trying ArduinoIoTCloud-Basic example with NodeMCU 1.0.

IDE: 1.8.10;
Library version: 1.0.2
OS: Ubuntu 18.04

/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c: In function 'hexDump':
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c:195:32: error: expected ')' before '__INT8'
  195 |         err = stream(out, "%02" PRIx8, *buffer++);
      |                                ^
      |                                )
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c: In function 'utf8EscapedDump':
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c:251:39: error: expected ')' before '__INT32'
  251 |             err = stream(out, "\\u%04" PRIX32 "\\u%04" PRIX32,
      |                                       ^
      |                                       )
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c:257:39: error: expected ')' before '__INT32'
  257 |             err = stream(out, "\\u%04" PRIX32, uc);
      |                                       ^
      |                                       )
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c: In function 'value_to_pretty':
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c:382:34: error: expected ')' before '__INT64'
  382 |             err = stream(out, "%" PRIu64, val);
      |                                  ^
      |                                  )
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c:387:39: error: expected ')' before '__INT64'
  387 |                 err = stream(out, "-%" PRIu64, val);
      |                                       ^
      |                                       )
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c:457:30: error: expected ')' before '__INT64'
  457 |         err = stream(out, "%" PRIu64 "%s(", tag, get_indicator(it, flags));
      |                              ^
      |                              )
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c:473:37: error: expected ')' before '__INT8'
  473 |         err = stream(out, "simple(%" PRIu8 ")", simple_type);
      |                                     ^
      |                                     )
/home/fernandogarcia/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/cborpretty.c:531:36: error: expected ')' before '__INT64'
  531 |             err = stream(out, "%s%" PRIu64 ".%s", val < 0 ? "-" : "", ival, suffix);
      |                                    ^
      |                                    )

Best regards.

Firmware update necessary

On my MKR1000 there was the WINC1501 Model B (19.4.4) firmware and the board didn't manage to connect to my wifi router, but it worked well with a smartphone hotspot.
The example sketch Wifi101->CheckWifi101FirmwareVersion logged:

WiFi101 firmware check.

WiFi101 shield: DETECTED
Firmware version installed: 19.4.4
Latest firmware version available : 19.5.4

Check result: NOT PASSED
 - The firmware version on the shield do not match the
   version required by the library, you may experience
   issues or failures.

I updated the firmware using the WiFi101 Firmware Updater tool to version 19.5.2 and my MKR1000 immediately connected to the router.

Running again the Wifi101->CheckWifi101FirmwareVersion example I obtain this log:

WiFi101 firmware check.

WiFi101 shield: DETECTED
Firmware version installed: 19.5.2
Latest firmware version available : 19.5.4

Check result: NOT PASSED
 - The firmware version on the shield do not match the
   version required by the library, you may experience
   issues or failures.

Regardless of this log, my board seems to work properly now, but in the list of available firmwares the 19.5.4 doesn't appear:
screen shot 2018-03-26 at 16 01 47

ArduinoCloud does not reconnect

The simple example projects to light up an LED work fine, but the whole thing stops working when WiFi connection gets momentarily lost, and it doesn't reconnect, requiring a reset.
If this is normal, then what is the recommended way to detect a disconnect and reconnect?
Thanks

Remove `#if !defined(__AVR__)` to improve code clarity.

All those

#if !defined(__AVR__)
    /* ... */
#endif

statements can be safely removed (of course preserving the statements within those ifdef/endif parts), i.e.

-#if !defined(__AVR__)
  DEBUG_ERROR("Check your thing configuration, and press the reset button on your board.");
-#endif

Reason: Those statements where introduced to save flash when running Arduino IoT Cloud on the very ressource constrained Arduino Uno WiFi Rev. 2, however the idea of running the cloud stack on this board has long since been given up (and is now more impossible than ever before, due to continous growth of the firmware stack).

Why RBDimmer Lib. not capable with Arduino Iot cloud LIB

Hello everyone i am trying to match Rbdimmer lib:
Link:- https://github.com/RobotDynOfficial/RBDDimmer

with this lib but I am getting errors with my sketch

Arduino: 1.8.12 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Arduino.h:29:0,

                 from sketch\Untitled_oct06b.ino.cpp:1:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:32:11: error: 'OFF' redeclared as different kind of symbol

     OFF = false,

           ^

In file included from C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/ArduinoIoTCloud.h:33:0,

                 from sketch\thingProperties.h:3,

                 from C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino:2:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/AIoTC_Const.h:26:19: error: previous declaration of 'const bool OFF'

 static bool const OFF = false;

                   ^

In file included from C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Arduino.h:29:0,

                 from sketch\Untitled_oct06b.ino.cpp:1:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:33:10: error: 'ON' redeclared as different kind of symbol

     ON = true

          ^

In file included from C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/ArduinoIoTCloud.h:33:0,

                 from sketch\thingProperties.h:3,

                 from C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino:2:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/AIoTC_Const.h:25:19: error: previous declaration of 'const bool ON'

 static bool const ON  = true;

                   ^

C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino: In function 'void setup()':

Untitled_oct06b:101:31: error: no matching function for call to 'dimmerLamp::begin(DIMMER_MODE_typedef, const bool&)'

   dimmer.begin(NORMAL_MODE, ON);

                               ^

C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino:101:31: note: candidate is:

In file included from C:\Users\jamsa\OneDrive\Desktop\updates\Untitled_oct06b\Untitled_oct06b\Untitled_oct06b.ino:5:0:

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:14: note: void dimmerLamp::begin(DIMMER_MODE_typedef, ON_OFF_typedef)

         void begin(DIMMER_MODE_typedef DIMMER_MODE, ON_OFF_typedef ON_OFF);

              ^

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:14: note:   no known conversion for argument 2 from 'const bool' to 'ON_OFF_typedef'

Multiple libraries were found for "IRremote.h"
 Used: C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\IRremote
 Not used: C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\Arduino-IRremote-master
exit status 1
no matching function for call to 'dimmerLamp::begin(DIMMER_MODE_typedef, const bool&)'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
` 
```

anyone can explain why this happing 

Reintegrate Arduino_ConnectionHandler with ArduinoIoTCloud

Initially a part of ArduinoIoTCloud the Arduino_ConnectionHandler has been extracted into a separate library. Unfortunately this has turned out to be a bad decision because the constant changes to both ArduinoIoTCloud and Arduino_ConnectionHandler require regular modifications to both which either need to be released simultaneously or require an intricate update strategy. Since this has happened multiple times in the past it has become clear that Arduino_ConnectionHandler should be reintegrated with ArduinoIoTCloud.

First attempt at `getTime()` always returns bad value

@ilcato for some reason since the last round of lifting I have never been able to obtain a valid time from the module(s).
When we used to have a STATE_GET_TIME it would go through it a couple times and return a valid value, while now it doesn't make it in time and falls back to NTP.
I know you've been pushing for reducing the amount of cycles, but if we're sure it never gets it maybe we're just adding cycles for the sake of giving priority to time being obtained from the module via SPI because it's faster.
I know @facchinm is an advocate for this, but can we find a meeting point?
We ran a workshop with 45 people a couple days ago and this – essentially – failure message was being received as a problem with the platform.
Let's try and make this better by either reintroducing the extra state or agreeing on just using the fallback alone :)

Getting Error while compiling just on/off 1 relay switch using arduinoiotcloud

Here is the error

Arduino: 1.8.12 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c: In function 'hexDump':
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:195:32: error: expected ')' before '__INT8'
  195 |         err = stream(out, "%02" PRIx8, *buffer++);
      |                                ^
      |                                )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c: In function 'utf8EscapedDump':
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:251:39: error: expected ')' before '__INT32'
  251 |             err = stream(out, "\\u%04" PRIX32 "\\u%04" PRIX32,
      |                                       ^
      |                                       )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:257:39: error: expected ')' before '__INT32'
  257 |             err = stream(out, "\\u%04" PRIX32, uc);
      |                                       ^
      |                                       )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c: In function 'value_to_pretty':
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:382:34: error: expected ')' before '__INT64'
  382 |             err = stream(out, "%" PRIu64, val);
      |                                  ^
      |                                  )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:387:39: error: expected ')' before '__INT64'
  387 |                 err = stream(out, "-%" PRIu64, val);
      |                                       ^
      |                                       )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:457:30: error: expected ')' before '__INT64'
  457 |         err = stream(out, "%" PRIu64 "%s(", tag, get_indicator(it, flags));
      |                              ^
      |                              )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:473:37: error: expected ')' before '__INT8'
  473 |         err = stream(out, "simple(%" PRIu8 ")", simple_type);
      |                                     ^
      |                                     )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cborpretty.c:531:36: error: expected ')' before '__INT64'
  531 |             err = stream(out, "%s%" PRIu64 ".%s", val < 0 ? "-" : "", ival, suffix);
      |                                    ^
      |                                    )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c: In function 'add_value_metadata':
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:297:39: error: expected ')' before '__INT64'
  297 |         if (fprintf(out, "\"tag\":\"%" PRIu64 "\"%s", status->lastTag,
      |                                       ^
      |                                       )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:316:40: error: expected ')' before '__INT64'
  316 |         if (fprintf(out, ",\"v\":\"%c%" PRIx64 "\"", flags & NumberWasNegative ? '-' : '+',
      |                                        ^
      |                                        )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c: In function 'tagged_value_to_json':
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:351:35: error: expected ')' before '__INT64'
  351 |         if (fprintf(out, "{\"tag%" PRIu64 "\":", tag) < 0)
      |                                   ^
      |                                   )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:359:39: error: expected ')' before '__INT64'
  359 |             if (fprintf(out, ",\"tag%" PRIu64 "$cbor\":{", tag) < 0 ||
      |                                       ^
      |                                       )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c: In function 'value_to_json':
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:578:38: error: expected ')' before '__INT8'
  578 |         if (fprintf(out, "\"simple(%" PRIu8 ")\"", simple_type) < 0)
      |                                      ^
      |                                      )
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src\cbor\lib\tinycbor\src\cbortojson.c:637:39: error: expected ')' before '__INT64'
  637 |                 r = fprintf(out, "%s%" PRIu64, val < 0 ? "-" : "", ival);
      |                                       ^
      |                                       )
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

please can someone help me

Missing feature of tls authentication authorityKeyIdentifier

It would be good to implement the X509v3 Authority Key Identifier extension but should be optional to provide back compatibility.
The main reason are:

  • Performance to find the right CA without try all of them
  • Best practise
  • Compatibility with CFSSL that generate the certificate with an subject id and consequently our go tool generate the client certificate with the authority key identifier

https://www.v13.gr/blog/?p=293

Thanks

How to use Catch2 with Arduino.h

Hello, Please could someone explain to be how to use Catch2 with Arduino.h? I'm really interested in starting to use it. And as it appears in your project, you guys are successfully using it!

Could you gentleman please share a bit of this knowledge?

Obviously I know how to use Catch2, What I don't know is how to enable Arduino framework into GNU so the compiler could interpret things such as : Serial or String.. etc!

Or maybe I'm thinking about this the wrong way, and I should be using avr-g++ to compile catch2? idk.

Thank you for your time!

ArduinoIoTCloudClass::update() stuck when internet connection fails

Hi all,
I'm having trouble keeping a nano33iot running when the internet connection (but not wifi) fails/drops for a short period of time.
It gets stuck in the function void ArduinoIoTCloudClass::update(CallbackFunc onSyncCompleteCallback) called from the loop() code.

After the connection fails, the board will have 45/60 seconds of life before getting completely stuck inside that function. No trying to reconnect occurs.
Even if the internet connection fails for only a couple of seconds, the board will freeze in 45/60 seconds.
The only solution is to reset either the board or the access point (the latter will trigger a wifi drop and the board will come back to life again searching for the wifi network).

Tested repeatedly in the last few days in many ways:

  • unplugging the ethernet cable on a wifi accesspoint
  • disabling the mobile network on android in hotspot mode
  • casually walking away from the AP with the board in hands (this sometimes will trigger the wifi drop+reconnection)
  • different accesspoint/networks
  • on a mkrwifi1010

With some Serial.print-fu I was able to narrow it a little bit to the call _mqttClient->poll() inside the update() function.

Tested sketch is fresh template generated by the Arduino Create IoT Cloud compiled with the latest release of ArduinoIoTCloud (and dependencies).

MKR ENV example

Is there an example showing how to have data from the MKR ENV shield added to the IoTCloud?

Add one example per available cloud data type

Currently the examples for this library only show the usage for a few select types. In order to allow new users to see how to use this library it would be beneficial to have one example for each cloud data type.

Outdated function calls in the README

Hey, confused beginner here...

In the README section regarding the watchdog timer shouldn't the function calls be

ArduinoCloud.update()
ArduinoCloud.begin(...) 

instead of

ArduinoIoTCloud.update()
ArduinoIoTCloud.begin(...)

Value transmission is lost when MQTT connection is terminated

  1. After some time someone (application load balancer?) kills the connection, but - and here is the crucial point - the connection kill is not noticed by the WiFi module and not reported to the firmware (and also not detected by the mqtt client since there is no keep-alive ping) which is why ...

  2. ... when the data transmission is due (let's say after 10 minutes) it dutifully transmits the data ...

11:41:07.150 -> TX[49]: 30 3B 00 2D 2F 61 2F 74 2F 39 66 66 33 62 61 31 61 2D 65 62 30 30 2D 34 38 65 36 2D 38 31 38 36 2D 63 30 34 39 38 61 39 64 30 30 37 33 2F 65 2F 6F 
11:41:07.150 -> 0;-/a/t/9ff3ba1a-eb00-48e6-8186-c0498a9d0073/e/o
11:41:07.150 -> TX[12]: 9F A2 00 65 77 61 74 65 72 04 F5 FF 
11:41:07.150 -> ⸮⸮ewater⸮⸮
  1. ... only to find the connection to the cloud broken ...
11:41:07.349 -> Arduino IoT Cloud Connection status: DISCONNECTED
  1. ... so the connection with the cloud is reestablished ...
11:41:07.349 -> Arduino IoT Cloud Connection status: RECONNECTING
11:41:10.102 -> TX[50]: 10 30 00 04 4D 51 54 54 04 02 0E 10 00 24 32 36 61 33 39 62 66 38 2D 31 33 37 38 2D 34 31 32 61 2D 38 39 62 34 2D 63 66 30 61 34 32 36 39 39 64 36 66 
11:41:10.102 -> 0MQTT$26a39bf8-1378-412a-89b4-cf0a42699d6f
11:41:10.401 -> RX: 20
11:41:10.401 -> RX: 02
11:41:10.401 -> RX: 00
11:41:10.401 -> RX: 00
11:41:10.401 -> TX[52]: 82 32 00 01 00 2D 2F 61 2F 64 2F 32 36 61 33 39 62 66 38 2D 31 33 37 38 2D 34 31 32 61 2D 38 39 62 34 2D 63 66 30 61 34 32 36 39 39 64 36 66 2F 73 2F 69 00 
11:41:10.401 -> ⸮2-/a/d/26a39bf8-1378-412a-89b4-cf0a42699d6f/s/i
11:41:10.600 -> RX: 90
11:41:10.600 -> RX: 03
11:41:10.600 -> RX: 00
11:41:10.600 -> RX: 01
11:41:10.600 -> RX: 00
11:41:10.633 -> TX[52]: 82 32 00 02 00 2D 2F 61 2F 74 2F 39 66 66 33 62 61 31 61 2D 65 62 30 30 2D 34 38 65 36 2D 38 31 38 36 2D 63 30 34 39 38 61 39 64 30 30 37 33 2F 65 2F 69 00 
11:41:10.633 -> ⸮2-/a/t/9ff3ba1a-eb00-48e6-8186-c0498a9d0073/e/i
11:41:10.932 -> RX: 90
11:41:10.932 -> RX: 03
11:41:10.932 -> RX: 00
11:41:10.932 -> RX: 02
11:41:10.932 -> RX: 00
11:41:10.932 -> TX[57]: 82 37 00 03 00 32 2F 61 2F 74 2F 39 66 66 33 62 61 31 61 2D 65 62 30 30 2D 34 38 65 36 2D 38 31 38 36 2D 63 30 34 39 38 61 39 64 30 30 37 33 2F 73 68 61 64 6F 77 2F 69 00 
11:41:10.932 -> ⸮72/a/t/9ff3ba1a-eb00-48e6-8186-c0498a9d0073/shadow/i
11:41:11.230 -> RX: 90
11:41:11.230 -> RX: 03
11:41:11.230 -> RX: 00
11:41:11.230 -> RX: 03
11:41:11.230 -> RX: 00
11:41:11.230 -> ArduinoCloud.reconnect(): 1
11:41:11.230 -> Arduino IoT Cloud Connection status: CONNECTED
11:41:11.230 -> TX[49]: 30 49 00 2D 2F 61 2F 64 2F 32 36 61 33 39 62 66 38 2D 31 33 37 38 2D 34 31 32 61 2D 38 39 62 34 2D 63 66 30 61 34 32 36 39 39 64 36 66 2F 73 2F 6F 
11:41:11.230 -> 0I-/a/d/26a39bf8-1378-412a-89b4-cf0a42699d6f/s/o
11:41:11.230 -> TX[26]: 48 65 6C 6C 6F 20 66 72 6F 6D 20 43 6C 6F 75 64 20 53 65 72 69 61 6C 21 0D 0A 
11:41:11.230 -> Hello from Cloud Serial!
11:41:11.230 -> 
11:41:11.230 -> TX[54]: 30 4A 00 32 2F 61 2F 74 2F 39 66 66 33 62 61 31 61 2D 65 62 30 30 2D 34 38 65 36 2D 38 31 38 36 2D 63 30 34 39 38 61 39 64 30 30 37 33 2F 73 68 61 64 6F 77 2F 6F 
11:41:11.264 -> 0J2/a/t/9ff3ba1a-eb00-48e6-8186-c0498a9d0073/shadow/o
11:41:11.264 -> TX[22]: 81 A2 00 63 72 3A 6D 03 6D 67 65 74 4C 61 73 74 56 61 6C 75 65 73 
11:41:11.264 -> ⸮⸮cr:mmgetLastValues
...
  1. But the one value which should have been transmitted has in fact been lost because the connection was broken when it should have bent sent which only came up after trying to sent that message. You can also see that on reconnection we did again a sync with cloud (not a good idea, because this overrides the local values and also very data consuming since we again subscribe to all topics).

Connect via IP adresses when DNS resolution is not available

Not all NB-IoT networks come with integrated DNS resolution. Therefore it is necessary to have the IP addresses for the Arduino IoT Cloud services stored as a back-up solution.

mqtts-sa.iot.arduino.cc

34.206.248.111
3.209.5.114

time.arduino.cc

35.204.74.237
34.73.181.129

Missing keywords.txt

This library contains no keywords.txt which is normally used for providing synthax highlighting for Arduino libraries.

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.