I am monitoring several temperature sensors (DHT-11) via the IOT cloud that I put in place about a year ago. I would like to take advantage of the trigger/notification function when temperatures are outside certain limits so I decided to add some code to try to accomplish this.
Just to cover all of my bases before I started modifying the code, I tried re-verifying the existing code from sketches of functioning devices that are currently operational in the field, and am having issues getting the code to verify on my ESP-32 board sketches.
In the advanced editor it stops at an error 'PinStatus does not name a type'
Chat GPT indicates that there are library conflicts, so I tried eliminating each of the two libraries that I have in the code below.
below is the total debug with the code
/usr/local/bin/arduino-cli compile --fqbn esp32:esp32:nodemcu-32s:FlashFreq=80,UploadSpeed=921600,DebugLevel=none --build-cache-path /tmp --output-dir /tmp/2401822406/build --build-path /tmp/arduino-build-325DBCE83D3D27D0B396A714A64782EC --library /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/ArduinoBLE --library /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/Arduino_LSM6DS3 --library /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/DFRobot_DHT11 --library /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/DHT sensor library --library /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/DHT_nonblocking --library /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/LSM6 --library /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/RTCZero --library /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/WiFiNINA /tmp/2401822406/28_Clayton_apr28a
In file included from /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/WiFiNINA/src/WiFiStorage.h:23,
from /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/WiFiNINA/src/WiFi.h:38,
from /home/builder/Arduino/libraries/arduino_connectionhandler_0_8_1/src/Arduino_ConnectionHandler.h:151,
from /home/builder/Arduino/libraries/arduinoiotcloud_1_13_0/src/ArduinoIoTCloud.h:27,
from /tmp/2401822406/28_Clayton_apr28a/thingProperties.h:3,
from /tmp/2401822406/28_Clayton_apr28a/28_Clayton_apr28a.ino:19:
/mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/WiFiNINA/src/utility/wifi_drv.h:292:12: error: 'PinStatus' does not name a type
static PinStatus digitalRead(uint8_t pin);
^~~~~~~~~
Multiple libraries were found for "WiFi.h"
Used: /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/WiFiNINA
Not used: /home/builder/opt/libraries/vega_wifinina_1_0_1
Not used: /home/builder/opt/libraries/indhilib_3_0_5
Not used: /home/builder/opt/libraries/wifi_1_2_7
Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_6
Not used: /home/builder/opt/libraries/wifinina_1_8_14
Not used: /home/builder/opt/libraries/nina_wi_fi_1_0_1
Not used: /home/builder/opt/libraries/da16200_wi_fi_library_for_arduino_1_1_0
Not used: /home/builder/opt/libraries/wifiespat_1_4_3
Not used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/WiFi
Multiple libraries were found for "WiFiClientSecure.h"
Used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/WiFiClientSecure
Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_6
Multiple libraries were found for "DHT.h"
Used: /mnt/create-efs/webide/0d/3a/0d3a89629bd0be065d4efc919fe0d51d:fa20driver/libraries_v2/DHT sensor library
Not used: /home/builder/opt/libraries/ukit_explore_1_2_28
Not used: /home/builder/opt/libraries/nanoplayboard_0_1_1
Not used: /home/builder/opt/libraries/dht11esp8266examples_1_0_10
Not used: /home/builder/opt/libraries/esp826611_1_0_16
Not used: /home/builder/opt/libraries/dht118266_1_0_16
Not used: /home/builder/opt/libraries/dht11esp8266_1_0_10
Not used: /home/builder/opt/libraries/grove_temperature_and_humidity_sensor_2_0_1
Not used: /home/builder/opt/libraries/dht_sensor_library_1_4_6
Not used: /home/builder/opt/libraries/dht_kxn_3_4_4
Not used: /home/builder/opt/libraries/servodht11_1_0_10
Multiple libraries were found for "SPI.h"
Used: /home/builder/.arduino15/packages/esp32/hardware/esp32/2.0.5/libraries/SPI
Not used: /home/builder/opt/libraries/eventethernet_1_0_0
Multiple libraries were found for "Adafruit_Sensor.h"
Used: /home/builder/opt/libraries/adafruit_unified_sensor_1_1_14
Not used: /home/builder/opt/libraries/arduav_1_4_2
Error during build: exit status 1
And the code:
/*
Sketch generated by the Arduino IoT Cloud Thing "Nano"
https://create.arduino.cc/cloud/things/798304ed-58ca-4f7e-9a0d-dddc288d6aff
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
float boardHUMID;
float boardTEMP;
bool redLED;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
int myLED = 13;
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
// Defined in thingProperties.h
initProperties();
pinMode(myLED, OUTPUT);
dht.begin();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
// Your code here
delay (2000);
boardTEMP = dht.readTemperature(true);
boardHUMID = dht.readHumidity();
}
/*
Since RedLED is READ_WRITE variable, onRedLEDChange() is
executed every time a new value is received from IoT Cloud.
*/
void onRedLEDChange() {
Serial.println(redLED);
if (redLED) {
digitalWrite(myLED, HIGH);
} else {
digitalWrite(myLED, LOW);
}
// Add your code here to act upon RedLED change
}