The additional information you asked for
(mod edit)
// NTPClient - Version: Latest
#include <NTPClient.h>
#include <WiFiUdp.h>
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
/*
Basic Sketch generated by the Arduino IoT Cloud Thing "bootalarm"
https://create.arduino.cc/cloud/things/3710c5cf-58ab-4c54-9ede-3ffcd73f29df
Later the sketch extended for a project called "bootalarm".
*/
#include <WiFiNINA.h>
#include "thingProperties.h"
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 6
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
int lichtAkkuPin = A4; //pinnen voor het gemak een naam geven
int gasRuimPin = A2;
int gasRoefPin = A3;
int POEPin = A1;
bool ledPin = LED_BUILTIN;
bool pompRoefPin = 0;
bool hoornPin = 1;
bool laderPin = 2;
bool pompRuimPin = 4;
bool statussenPin = 5;
int tempRuimPin = 6; //oneWire data of DS18B20
bool inbraakPin = 7;
bool hoorn; //variabelen, die via "statussen" naar IoT/cloud-gebeuren gaan
bool lader;
bool pompRoef;
bool pompRuim;
bool inbraak;
float POE;
void setup() {
pinMode(A1, INPUT); //vastleggen welke pinnen in- of uitgang zijn
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(0, INPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, INPUT);
pinMode(5, OUTPUT);
pinMode(6, INPUT);
pinMode(7, INPUT);
pinMode(LED_BUILTIN, OUTPUT); // kan beperkt ook als ingang gebruikt worden
Serial.begin(9600);
sensors.begin();
timeClient.begin();
delay(5000);
initProperties(); //IoT eigenschappen van Bootalarm binnenhalen
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
delay(7000);
Serial.println("sketch may09aaa 1/11/2019");
}
void loop() {
ArduinoCloud.update(); //nieuwe gegevens doorsturen IoT/cloud
pompRuim = digitalRead(pompRuimPin); //sensorwaardes en stuursignalen uitlezen
pompRoef = digitalRead(pompRoefPin);
inbraak = digitalRead(inbraakPin);
POE = analogRead(POEPin);
lader = digitalRead(laderPin);
hoorn = digitalRead(hoornPin);
gasRuim = analogRead(gasRuimPin);
gasRoef = analogRead(gasRoefPin);
lichtAkku = analogRead(lichtAkkuPin);
lichtAkku = 0.035 * lichtAkku;
sensors.requestTemperatures();
tempRuim = (sensors.getTempCByIndex(0));
if (pompRuim == HIGH) { //4 sensoren zonder dashbord-uitlezing
digitalWrite(statussenPin, HIGH);
}
if (pompRoef == HIGH) {
digitalWrite(statussenPin, HIGH);
}
if (inbraak == HIGH) {
digitalWrite(statussenPin, HIGH);
digitalWrite(hoornPin, HIGH);
delay(10000);
digitalWrite(hoorn, LOW);
}
POE = 0.035 * POE;
if (POE < 20) {
digitalWrite(statussenPin, HIGH);
}
delay(10000);
Serial.print("+"); //aanduiding voor elke keer,wanneer void(loop) doorlopen is
}
void onStatussenChange() { //statusrapport van alle sensoren en sturing voor bootalarm
if (statussenPin == HIGH) {
timeClient.update();
Serial.print(timeClient.getFormattedTime());
delay(1000);
Serial.println("STATUSRAPPORT");
Serial.print("gas in motorruim=");
Serial.println(gasRuim);
Serial.print("gas in roef=");
Serial.println(gasRoef);
Serial.print("temp in motorruim=");
Serial.println(tempRuim);
Serial.print("spanning lichtakku=");
Serial.println(lichtAkku);
Serial.print("230V adapter=");
Serial.println(POE);
Serial.print("ruimpompschakelaar=");
Serial.println(pompRuim);
Serial.print("roefpompschakelaar=");
Serial.println(pompRoef);
Serial.print("inbraakschakelaar=");
Serial.println(inbraak);
Serial.print("laderrelais=");
Serial.println(lader);
Serial.print("hoornrelais=");
Serial.println(hoorn);
digitalWrite(statussenPin, LOW);
}
}
void onTempRuimChange() { //4 sensoren met dashbord-uitlezing
digitalWrite(statussenPin, HIGH);
}
void onGasRuimChange() {
digitalWrite(statussenPin, HIGH);
}
void onGasRoefChange() {
digitalWrite(statussenPin, HIGH);
}
void onLichtAkkuChange() {
if (lichtAkku < 22) {
digitalWrite(laderPin, HIGH);
digitalWrite(statussenPin, HIGH);
}
if (lichtAkku > 28) {
digitalWrite(laderPin, LOW);
digitalWrite(statussenPin, LOW);
}
}
I am not familar with </>, and hope it is worked out correctly.
Before the sketch compiled and worked ok, but after including the coding-lines of NTPClient a compiler error was reported. While this did work before the NTPClient 3_2_0 version
more basic information
Windows 10 pro x 64
Google Chrome is up-to-date.Versie 78.0.3904.87 (Officiële build) (64-bits)
MKR WiFi 1010, which also works with Arduino IDE 1.8.9
USB 3.0 with com5
link to sketch https://create.arduino.cc/editor/Vleer/0661efb2-f1af-44a8-bbc6-082b25a79ff6/preview
Greetings
Vleer