/usr/local/bin/arduino-cli compile --fqbn arduino:samd:mkrwifi1010 --build-cache-path /tmp --output-dir /tmp/1107650264/build --build-path /tmp/arduino-build-EDA8EF42831256D242010EED0B715A4A --library /mnt/create-efs/webide/9b/8c/9b8ce888d8c5f8cac548ec99e04b2a30:struharov/libraries_v2/DallasTemperature --library /mnt/create-efs/webide/9b/8c/9b8ce888d8c5f8cac548ec99e04b2a30:struharov/libraries_v2/IntervalCallback --library /mnt/create-efs/webide/9b/8c/9b8ce888d8c5f8cac548ec99e04b2a30:struharov/libraries_v2/Logger --library /mnt/create-efs/webide/9b/8c/9b8ce888d8c5f8cac548ec99e04b2a30:struharov/libraries_v2/OneWire /tmp/1107650264/new_sketch_1712480254561
/tmp/arduino-build-EDA8EF42831256D242010EED0B715A4A/sketch/new_sketch_1712480254561.ino.cpp.o: In function `__static_initialization_and_destruction_0':
/tmp/1107650264/new_sketch_1712480254561/new_sketch_1712480254561.ino:5: undefined reference to `DallasTemperature::DallasTemperature(OneWire*)'
collect2: error: ld returned 1 exit status
Multiple libraries were found for "OneWire.h"
Used: /mnt/create-efs/webide/9b/8c/9b8ce888d8c5f8cac548ec99e04b2a30:struharov/libraries_v2/OneWire
Not used: /home/builder/opt/libraries/onewire_2_3_7
Not used: /home/builder/opt/libraries/onewireng_0_13_3
Not used: /home/builder/opt/libraries/max31850_onewire_1_1_3
Not used: /home/builder/opt/libraries/sdu_ags_sensorboard_1_0_0
Multiple libraries were found for "DallasTemperature.h"
Used: /mnt/create-efs/webide/9b/8c/9b8ce888d8c5f8cac548ec99e04b2a30:struharov/libraries_v2/DallasTemperature
Not used: /home/builder/opt/libraries/dallastemperature_3_9_0
Not used: /home/builder/opt/libraries/max31850_dallastemp_1_1_6
Not used: /home/builder/opt/libraries/sdu_ags_sensorboard_1_0_0
Error during build: exit status 1
I see you have imported a "DallasTemperature" library to your Arduino Cloud account. It seems that whatever version of that library you imported does not have an API that is compatible with your sketch.
Did you have some specific reason for importing the "DallasTemperature" library to your Arduino Cloud account? If not, you should be able to solve the problem by removing the bad version of the library you imported from your account. Once you have done that, the latest release of the library from the Arduino Library Manager (which is pre-installed on Arduino Cloud) will be used when compiling your sketch. I have verified that your sketch will compile with that version of the library.
I'll provide instructions you can follow to do that:
Click the following link to open the list of your Arduino Cloud sketches in the web browser: https://app.arduino.cc/sketches
Click on your sketch sketch, or use the CREATE > New sketch button to create a new sketch.
The sketch will open in Arduino Cloud Editor.
Click the icon that looks like shelved books ("Libraries") in the bar on the left side of the Cloud Editor page.
The "Libraries" panel will open.
Select the "Custom" tab from the "Libraries" panel.
You will see text near the top of the panel:
Show libraries for: <board name>
(where <board name> is the name of the board you have selected in Arduino Cloud Editor)
Click the board name in that text.
The text will now change to:
Show libraries for: ALL DEVICES
Scroll down through the list of custom libraries until you find the entry for the "DallasTemperature" library.
Hover the mouse pointer over the entry.
A ⋮* icon will appear to the right of the library name.
Click the ⋮ icon.
A menu will open.
Select "Delete Library" from the menu.
A "Delete custom library" dialog will open.
Click the "YES, DELETE" button in the dialog.
If you do need the imported "DallasTemperature" library, let me know (including a detailed description of why) and I'll help you find an alternative solution.
This is great & works well!
I am not aware of importing these custom versions to Cloud account myself.
Could that possibly be a default behavior of the Arduino IDE when syncing the sketch to Cloud?
No, Arduino IDE doesn't have any capability for importing libraries to your Arduino Cloud account; only sketches.
Arduino Cloud does have a feature where you can import a zip file of your entire sketchbook, sketches and libraries both. That import is done via the Arduino Cloud website interface, by clicking the icon that looks like an upward pointing arrow on the "Libraries" panel of Cloud Editor, or the "Sketches" panel ("Import local file"):
Hi @ptillisch
Do you know any solution cause I'm having a problems about multiple libraries were used but I'm importing my own libraries but It still show up the same problems. I have also tried to make the libraries version that I use favorite but nothing works.
#include <ThingsBoard.h>
#include <ESP8266WiFi.h> // Include the appropriate library for your board
#include <SoftwareSerial.h>
#include <elapsedMillis.h>
#include <stdlib.h>
#include <ArduinoJson.h>
char THINGSBOARD_SERVER[] = "thingsboard.cloud";
// #define TOKEN "espTB_in"
#define TOKEN "0J3KhGk65t7Y7Af7ycSE"
// TTDI-01 pxjx8156kcy7hliq8d1e
// TTDI-02 2f06kyz2aahmgt5xdthj
// TTDI-03 yrhpv2erivfmxlu28y3e
// TTDI-04 s7em3zf88iko5jzr67tl
// TTDI-05 xjsz82jksczivi9ok4wu
// TTDI-06 6r0211fisldaztvi349q
#define NOP __asm__("nop\n\t")
WiFiClient wifiClient;
ThingsBoard tb(wifiClient);
int status = WL_IDLE_STATUS;
unsigned long lastSend;
int threshold = 0;
// const char* ssid = "HUAWEI_H122_EE7C";
// const char* password = "9LLR6RBYDGN";
const char* ssid = "FLOW STUDIOS";
const char* password = "Fssb5060";
elapsedMillis timeElapsed; //declare global if you don't want it reset every time loop runs
unsigned long interval = 3.6e+6; // 1 min. interval data update 3.6e+6 1.8e+6 300000 1200000
unsigned long data_timeout = 200; // timeout value before process incoming modbus data
byte zero = 0;
float soiln;
float soilp;
float soilk;
byte values[20];
// SoftwareSerial mySerial(D6, D5); // RX, Soil 7in1 for sensor 1
SoftwareSerial mySerial(D5, D6); // RX, Soil pH for sensor 2
// Floats for ADC voltage & Input voltage
float adc_voltage = 0.0;
float in_voltage = 0.0;
// Floats for resistor values in divider (in ohms)
float R1 = 30000.0;
float R2 = 7500.0;
// Float for Reference Voltage
float ref_voltage = 3.15;
// Integer for ADC value
int adc_value = 0;
int moisturePercentage = 0;
/* 0- General */
#define S0 D0 /* Assign Multiplexer pin S0 connect to pin D0 of NodeMCU */
#define S1 D1 /* Assign Multiplexer pin S1 connect to pin D1 of NodeMCU */
#define S2 D2 /* Assign Multiplexer pin S2 connect to pin D2 of NodeMCU */
#define S3 D3 /* Assign Multiplexer pin S3 connect to pin D3 of NodeMCU */
#define SIG A0 /* Assign SIG pin as Analog output for all 16 channels of Multiplexer to pin A0 of NodeMCU */
int decimal = 2; // Decimal places of the sensor value outputs
int sensor0; /* Assign the name "sensor0" as analog output value from Channel C0 */
int sensor1; /* Assign the name "sensor1" as analog output value from Channel C1 */
void InitWiFi()
{
Serial.println("Connecting to AP ...");
// attempt to connect to WiFi network
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Connected to AP");
}
void reconnect() {
// Loop until we're reconnected
while (!tb.connected()) {
status = WiFi.status();
if ( status != WL_CONNECTED) {
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("Connected to AP");
}
Serial.print("Connecting to ThingsBoard node ...");
if ( tb.connect(THINGSBOARD_SERVER, TOKEN) ) {
Serial.println( "[DONE]" );
} else {
Serial.print( "[FAILED]" );
Serial.println( " : retrying in 5 seconds]" );
// Wait 5 seconds before retrying
delay( 1000 );
}
}
}
void Analog0(){
// Channel 0 (C0 pin - binary output 0,0,0,0)
digitalWrite(S0,LOW); digitalWrite(S1,LOW); digitalWrite(S2,LOW); digitalWrite(S3,LOW);
// Read the Analog Input
adc_value = analogRead(SIG);
// Determine voltage at ADC input
adc_voltage = (adc_value * ref_voltage) / 1024.0;
// Calculate voltage at divider input
in_voltage = adc_voltage / (R2/(R1+R2)) ;
}
void Analog1(){
// Channel 1 (C1 pin - binary output 1,0,0,0)
digitalWrite(S0,HIGH); digitalWrite(S1,LOW); digitalWrite(S2,LOW); digitalWrite(S3,LOW);
sensor1 = analogRead(SIG);
moisturePercentage = map(sensor1, 0, 1023, 100, 0);
}
void read_npk(){
mySerial.write(0x01);
mySerial.write(0x03);
mySerial.write(zero);
mySerial.write(0x1E);
mySerial.write(zero);
mySerial.write(0x03);
mySerial.write(0x65);
mySerial.write(0xCD);
timeElapsed = 0; // Reset timer value
// Wait for imcoming data_timeout
while (timeElapsed < data_timeout) NOP;
}
void process_mois_npk(){
if (mySerial.available()) {
for(byte i=0;i<=11;i++){
values[i] = mySerial.read();
float Soil_N = (values[3] << 8 | values[4]);
soiln = Soil_N;
float Soil_P = (values[5] << 8 | values[6]);
soilp = Soil_P;
float Soil_K = (values[7] << 8 | values[8]);
soilk = Soil_K;
}
}
}
void setup() { /* Put your codes here to run only once during micro controller startup */
Serial.begin(115200); /* to display readings in Serial Monitor at 9600 baud rates */
mySerial.begin(9600);
delay(10);
InitWiFi();
/* 0- General */
pinMode(S0,OUTPUT); /* Define digital signal pin as output to the Multiplexer pin SO */
pinMode(S1,OUTPUT); /* Define digital signal pin as output to the Multiplexer pin S1 */
pinMode(S2,OUTPUT); /* Define digital signal pin as output to the Multiplexer pin S2 */
pinMode(S3,OUTPUT); /* Define digital signal pin as output to the Multiplexer pin S3 */
pinMode(SIG, INPUT); /* Define analog signal pin as input or receiver from the Multiplexer pin SIG */
lastSend = 0;
}
void loop() { /* Put your codes here to run over and over again endlessly */
if ( !tb.connected() ) {
reconnect();
}
if (timeElapsed > interval ) {
/* 0- General */
Analog0();
Analog1(); // Read the value every second
read_npk();
process_mois_npk();
Serial.print("Voltage Sensor: "); Serial.print(in_voltage - 0.21); Serial.println("V");
Serial.print("Soil Moisture: "); Serial.print(moisturePercentage); Serial.println("%");
Serial.print("Nitrogen: "); Serial.print(soiln);Serial.println(" mg/kg");
Serial.print("Phosphorus: "); Serial.print(soilp);Serial.println(" mg/kg");
Serial.print("Potassium: ");Serial.print(soilk);Serial.println(" mg/kg");
Serial.println("");
//Working Data
String payload1 = "{";
payload1 += "\"Voltage\":";payload1 += 10; payload1 += ",";
payload1 += "\"Moisture\":";payload1 += 50; payload1 += ",";
payload1 += "\"Nitrogen\":";payload1 += 8; payload1 += ",";
payload1 += "\"Phosphorous\":";payload1 += 10; payload1 += ",";
payload1 += "\"Potassium\":";payload1 += 12;
payload1 += "}";
char tel[2000];
payload1.toCharArray(tel, 2000);
tb.sendTelemetryJson(tel);
Serial.println("Thingsboard sent");
}
tb.loop();
}
The "Multiple libraries were found for ..." messages you see in the Cloud Editor compilation output are only informational in nature. The mere presence of such a message doesn't indicate a problem, and in fact you can expect to see them frequently since >6700 libraries are preinstalled.
You only need to be concerned about these messages if they show that a different library than the intended one was used.
So if you see that the wrong library is being used, then please provide details about the problem. Otherwise, you can simply ignore the messages and carry on with your project.