BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Bessoin d aide esp8266 et DS18B20

Bonjour,
complètement novice je me lance dans se projet mais je n’y arrive pas.
Serait il possible qu’une âme charitable veut bien m’aider.
Actuellement je suis le tuto:

/************************************************************** 
 * IoT Temperature Monitor with Blynk
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 * 
 * Developed by Marcelo Rovai - 05 January 2017
 ***************************************************************/
/* ESP & Blynk */
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
char auth[] = "f4HJTFhSE46vubzOdS4MdcUKuGlIOCKB";
/* WiFi credentials */
char ssid[] = "freebox_ded";
char pass[] = "fred1981";
/* TIMER */
#include <SimpleTimer.h>
SimpleTimer timer;
/* DS18B20 Temperature Sensor */
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2 // DS18B20 on arduino pin2 corresponds to D4 on physical board
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
float temp;
void setup() 
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  DS18B20.begin();
  timer.setInterval(1000L, getSendData);
}
void loop() 
{
  timer.run(); // Initiates SimpleTimer
  Blynk.run();
}
/***************************************************
 * Send Sensor data to Blynk
 **************************************************/
void getSendData()
{
  DS18B20.requestTemperatures(); 
  temp = DS18B20.getTempCByIndex(0);
  Serial.println(temp);
  Blynk.virtualWrite(10, temp); //virtual pin V10
}

Mais je n’y arrive pas voici les erreurs:

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

C:\Users\Jumbo showa kindaï.000\Documents\Arduino\sketch_mar27a\sketch_mar27a.ino: In function ‘void setup()’:

sketch_mar27a:31:39: error: no matching function for call to ‘SimpleTimer::setInterval(long int, void (&)())’

C:\Users\Jumbo showa kindaï.000\Documents\Arduino\sketch_mar27a\sketch_mar27a.ino:31:39: note: candidate is:

In file included from C:\Users\Jumbo showa kindaï.000\Documents\Arduino\sketch_mar27a\sketch_mar27a.ino:17:0:

C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\SimpleTimer/SimpleTimer.h:23:10: note: void SimpleTimer::setInterval(uint64_t)

 void setInterval(uint64_t interval);

      ^

C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\SimpleTimer/SimpleTimer.h:23:10: note: candidate expects 1 argument, 2 provided

C:\Users\Jumbo showa kindaï.000\Documents\Arduino\sketch_mar27a\sketch_mar27a.ino: In function ‘void loop()’:

sketch_mar27a:35:9: error: ‘class SimpleTimer’ has no member named ‘run’

exit status 1
no matching function for call to ‘SimpleTimer::setInterval(long int, void (&)())’

Ce rapport pourrait être plus détaillé avec
l’option “Afficher les résultats détaillés de la compilation”
activée dans Fichier -> Préférences.

@Fred_Dutot please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

Cela est il mieux ?

Your code compiles correctly for me:

Sketch uses 280820 bytes (26%) of program storage space. Maximum is 1044464 bytes.
Global variables use 29384 bytes (35%) of dynamic memory, leaving 52536 bytes for local variables. Maximum is 81920 bytes.

I guess you have an installation issue with either your Blynk library or the ESP core.
Which versions of the Blynk Library and ESP core do you have installed?

Pete.

j’utilise Blynk-0.4.3 et esp8266 community et j ai choisi type de carte nodeMCU 0.9

I hope not, the latest version is 0.6.1…

I can see from what you posted before that you chose a NodeMCU 0.9 board, but I wanted to know which version of the E£SP core you have installed…

Pete.

esp8266

J’ai changer blynk pour la version 0.6.1
la ESP8266 version 2.6.3

Mais j’ai toujours une erreur.

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

In file included from C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkApi.h:17:0,

             from C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\Blynk\src/BlynkApiArduino.h:14,

             from C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp8266.h:24,

             from C:\Users\Jumbo showa kindaï.000\Documents\Arduino\sketch_mar27a\sketch_mar27a.ino:10:

C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:36:21: error: redefinition of ‘class BlynkTimer’

#define SimpleTimer BlynkTimer

                 ^

C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\SimpleTimer/SimpleTimer.h:10:7: note: in expansion of macro ‘SimpleTimer’

class SimpleTimer {

   ^

C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:36:21: error: previous definition of ‘class BlynkTimer’

#define SimpleTimer BlynkTimer

                 ^

C:\Users\Jumbo showa kinda�.000\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:41:7: note: in expansion of macro ‘SimpleTimer’

class SimpleTimer {

   ^

exit status 1
Erreur de compilation pour la carte NodeMCU 0.9 (ESP-12 Module)

Ce rapport pourrait être plus détaillé avec
l’option “Afficher les résultats détaillés de la compilation”
activée dans Fichier -> Préférences.

Voici une capture d’écran de ma librairie.
libr

Merci pour l’aide