[GH-ISSUE #1080] ERROR COMPILING FOR WeMos D1 R1 BOARD #921

Closed
opened 2026-02-28 01:27:41 +03:00 by kerem · 1 comment
Owner

Originally created by @Kenneth-ing on GitHub (Jun 16, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1080

Basic Infos

Hardware

WiFimanager Branch/Release:

  • Master
  • [ .] Development

Esp8266/Esp32:

  • [. ] ESP8266
  • ESP32

Hardware: ESP-12e, esp01, esp25

  • ESP01
  • [ .] ESP12 E/F/S (nodemcu, wemos, feather)
  • [] Other

ESP Core Version: 2.4.0, staging

  • 2.3.0
  • 2.4.0
  • [. ] staging (master/dev)

Description

I'm having errors compiling for my WeMos D1 R1 board.

Settings in IDE

Module: Wemos D1 R1

Additional libraries:

Sketch


#include <ESP8266WiFi.h>
#include <WiFiClient.h> 
#include "dht.h"
#include <ESP8266HTTPClient.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE);

dht DHT;
#define DHT11_PIN 11

const char* ssid     = "Kumi";      // SSID of local network
const char* password = "alexdoris";   // Password on network
char servername[] = "http://prefarmapi.herokuapp.com"; // remote server we will connect to

int  counter = 60;


//LiquidCrystal lcd(0x27, 2, 1, 0, 4, 5, 6,7, 3, HIGH);
void displayGettingData();
void serialMonitorData();
void displayConditions();
void setup() {
  Serial.begin(115200);
  int cursorPosition = 0;
  lcd.begin(16, 2);
  lcd.print("   Connecting");
  Serial.println("Connecting");
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    lcd.setCursor(cursorPosition, 2);
    lcd.print(".");
    cursorPosition++;
  }
  lcd.clear();
  lcd.print("   Connected!");
  Serial.println("Connected");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  delay(1000);

}

void loop() {
 HTTPClient http;         //Declare object of class HTTPClient


//=================================================================================================
  String postData;
  String Light,Moisture,Rain,Temperature,Humidity;
  float lightInt=analogRead(3);
  float moistureInt=analogRead(0);
  float rainInt=analogRead(1);
  float temperatureInt=random(50);
  float humidityInt=random(50);



   Light= String(lightInt);
   Moisture= String(moistureInt);
   Rain= String(rainInt);
   Temperature= String(temperatureInt);
   Humidity= String(humidityInt);

  postData = "temperature=" + Temperature + "&moisture=" + Moisture  + "&rain=" + Rain + "&light=" + Light + "&humidity=" + Humidity  ;
  http.begin("http://prefarmapi.herokuapp.com/api/espdata");              //Specify request destination
  http.addHeader("Content-Type", "application/x-www-form-urlencoded");    //Specify content-type header
  http.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjNlZDIxMDY1MWY3NTU5YjcxNmUzMTA1M2E2YzNmNGNkMzllNTMwNjU0YTZhNGE4M2E3YTVmMjNmMjZhZmZiYmI2YmMxNWVhOGEwOTEyOWNiIn0.eyJhdWQiOiIxIiwianRpIjoiM2VkMjEwNjUxZjc1NTliNzE2ZTMxMDUzYTZjM2Y0Y2QzOWU1MzA2NTRhNmE0YTgzYTdhNWYyM2YyNmFmZmJiYjZiYzE1ZWE4YTA5MTI5Y2IiLCJpYXQiOjE1ODkxMzQ0NzcsIm5iZiI6MTU4OTEzNDQ3NywiZXhwIjoxNjIwNjcwNDc3LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.M2EPuNhtazAkaNq9TclEQUcapBnTLKjqhCUfpxRccBIBFHggYXpImbQdHYNyTGxKdjlddspnuxQEtJWhJ_PbeSXUeGgxdG3Eqg0O1avIJ6vThFQKzPiH4nXltsgFnC8m97H_9XMohj41KsELeGZZRbW_xSP2f8_Z2yqrUUNzxhp6u0TCllOj9--IN5jAPR-cyIOEj5UdRyjdLVYgJh7rpE8GhW-WVgTCQQlPN0VtDhOnbgbVTW2cMuls07O47fc24qi6IqMTCFIAnkkc_lxWhXNfhal5BWhimK-EYckMcRHTviGu5ok9OAUCrkVV9TKIpgaXabtAunbcS6Ndc2snm3TaDz7RsdyiulcbelDXTQiz95GevuqAWCKYulA4MM3bb6M6R46UthWsIjeZcVOp_sBfl2fFw6A1ZSxQsZ4z5BjBpajcKTgVG1DLuftWkYP1QWzlX8v3Z88nPcNdkn0rTYtJlgK-UV0LJsSoP5bunDPpV27Ce0bn7T95maZvWlZp_kjqfyy7jrlWJGj8kx22_gwOeSCh6-CxP0xwOcQdd8tSrFzxvEoKWo7FudYpBAbj1ipH7nXa3sbf6Tu994JmBBKe_eHxavqvxuFQTpgsyIPnd_rAXIsRBPKD9LK0HPLJi6piKM7W3ZxtjGfiSyq-COzPU84aL2UCJfV8ifmhLHs");

  int httpCode = http.POST(postData);   //Send the request
  String payload = http.getString();    //Get the response payload

  Serial.println(httpCode);   //Print HTTP return code
  Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
  Serial.println(payload);    //Print request response payload

  http.end();  //Close connection
  
  delay(2000);  //Post Data at every 5 seconds

  //===============================================================
  if (counter == 60) //Get new data every 10 minutes
  {
    counter = 0;
    displayGettingData();
    delay(1000);
   
  } else
  {
    counter++;

    serialMonitorData();
    displayConditions();
    delay(5000);
  }
}
  
//==================================================================================================================================================================================================
  







void displayConditions(float temperatureInt, float humidityInt, float rainInt, float moistureInt, float lightInt)
{
  lcd.clear();
  int chk = DHT.read11(DHT11_PIN);
  lcd.setCursor(0,0);
  lcd.print("Temperature : ");
  //lcd.print(temperatureInt, 1);
  lcd.print(DHT.temperature);
  lcd.print((char)223);
  lcd.print("C ");

  //Printing Humidity
  lcd.setCursor(0, 1);
  lcd.print("humidity  : ");
  lcd.print(DHT.humidity);
 // lcd.print(humidityInt, 1);
  lcd.print("%");

  delay(5000);
  lcd.clear();

  //Printing rain
  lcd.setCursor(0, 0);
  lcd.print("Rain : ");
  lcd.print(rainInt, 1);
  lcd.print(" hPa");


  //Printing moisture
  lcd.setCursor(0, 1);
  lcd.print("Moisture : ");
  lcd.print(moistureInt, 1);
  lcd.print(" m/s");

  delay(5000);
  lcd.clear();

  //Printing light
  lcd.setCursor(0, 0);
  lcd.print("Light : ");
  lcd.print(lightInt, 1);
  lcd.print(" %");

}

void displayGettingData()
{
  lcd.clear();
  lcd.print("Getting data");
}

void serialMonitorData(float temperatureInt, float humidityInt, float rainInt, float moistureInt, float lightInt)
{
  Serial.print("Temp : ");
  Serial.print(temperatureInt, 1);
  Serial.print("*C ");

  Serial.print("  Hum  : ");
  Serial.print(humidityInt, 1);
  Serial.print("%");

  Serial.print(" Rain  : ");
  Serial.print(rainInt, 1);
  Serial.print(" hPa");

  Serial.print("  Moist  : ");
  Serial.print(moistureInt, 1);
  Serial.print(" % ");

  Serial.print("  Light : ");
  Serial.print(lightInt, 1);
  Serial.println(" %");
}

Debug Messages

In file included from C:\Users\USER.000\Documents\Arduino\libraries\DHT_FINAL\dht.h:18:0,

                 from C:\Users\USER.000\Documents\Arduino\libraries\DHT_FINAL\dht.cpp:30:

C:\Users\USER.000\Documents\Arduino\libraries\DHT_FINAL\dht.cpp: In member function 'int dht::_readSensor(uint8_t, uint8_t)':

C:\Users\USER.000\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Arduino.h:215:118: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in initialization

 #define portInputRegister(port)     (((port)==_PORT_GPIO16)?((volatile uint32_t*) &GP16I):((volatile uint32_t*) &GPI))

                                                                                                                      ^

C:\Users\USER.000\Documents\Arduino\libraries\DHT_FINAL\dht.cpp:116:29: note: in expansion of macro 'portInputRegister'

     volatile uint8_t *PIR = portInputRegister(port);

                             ^

exit status 1
Error compiling for board WeMos D1 R1.
Originally created by @Kenneth-ing on GitHub (Jun 16, 2020). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1080 ### Basic Infos #### Hardware **WiFimanager Branch/Release:** - [ ] Master - [ .] Development **Esp8266/Esp32:** - [. ] ESP8266 - [ ] ESP32 **Hardware: ESP-12e, esp01, esp25** - [ ] ESP01 - [ .] ESP12 E/F/S (nodemcu, wemos, feather) - [] Other **ESP Core Version: 2.4.0, staging** - [ ] 2.3.0 - [ ] 2.4.0 - [. ] staging (master/dev) ### Description I'm having errors compiling for my WeMos D1 R1 board. ### Settings in IDE Module: Wemos D1 R1 Additional libraries: ### Sketch ```cpp #include <ESP8266WiFi.h> #include <WiFiClient.h> #include "dht.h" #include <ESP8266HTTPClient.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); dht DHT; #define DHT11_PIN 11 const char* ssid = "Kumi"; // SSID of local network const char* password = "alexdoris"; // Password on network char servername[] = "http://prefarmapi.herokuapp.com"; // remote server we will connect to int counter = 60; //LiquidCrystal lcd(0x27, 2, 1, 0, 4, 5, 6,7, 3, HIGH); void displayGettingData(); void serialMonitorData(); void displayConditions(); void setup() { Serial.begin(115200); int cursorPosition = 0; lcd.begin(16, 2); lcd.print(" Connecting"); Serial.println("Connecting"); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); lcd.setCursor(cursorPosition, 2); lcd.print("."); cursorPosition++; } lcd.clear(); lcd.print(" Connected!"); Serial.println("Connected"); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); delay(1000); } void loop() { HTTPClient http; //Declare object of class HTTPClient //================================================================================================= String postData; String Light,Moisture,Rain,Temperature,Humidity; float lightInt=analogRead(3); float moistureInt=analogRead(0); float rainInt=analogRead(1); float temperatureInt=random(50); float humidityInt=random(50); Light= String(lightInt); Moisture= String(moistureInt); Rain= String(rainInt); Temperature= String(temperatureInt); Humidity= String(humidityInt); postData = "temperature=" + Temperature + "&moisture=" + Moisture + "&rain=" + Rain + "&light=" + Light + "&humidity=" + Humidity ; http.begin("http://prefarmapi.herokuapp.com/api/espdata"); //Specify request destination http.addHeader("Content-Type", "application/x-www-form-urlencoded"); //Specify content-type header http.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjNlZDIxMDY1MWY3NTU5YjcxNmUzMTA1M2E2YzNmNGNkMzllNTMwNjU0YTZhNGE4M2E3YTVmMjNmMjZhZmZiYmI2YmMxNWVhOGEwOTEyOWNiIn0.eyJhdWQiOiIxIiwianRpIjoiM2VkMjEwNjUxZjc1NTliNzE2ZTMxMDUzYTZjM2Y0Y2QzOWU1MzA2NTRhNmE0YTgzYTdhNWYyM2YyNmFmZmJiYjZiYzE1ZWE4YTA5MTI5Y2IiLCJpYXQiOjE1ODkxMzQ0NzcsIm5iZiI6MTU4OTEzNDQ3NywiZXhwIjoxNjIwNjcwNDc3LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.M2EPuNhtazAkaNq9TclEQUcapBnTLKjqhCUfpxRccBIBFHggYXpImbQdHYNyTGxKdjlddspnuxQEtJWhJ_PbeSXUeGgxdG3Eqg0O1avIJ6vThFQKzPiH4nXltsgFnC8m97H_9XMohj41KsELeGZZRbW_xSP2f8_Z2yqrUUNzxhp6u0TCllOj9--IN5jAPR-cyIOEj5UdRyjdLVYgJh7rpE8GhW-WVgTCQQlPN0VtDhOnbgbVTW2cMuls07O47fc24qi6IqMTCFIAnkkc_lxWhXNfhal5BWhimK-EYckMcRHTviGu5ok9OAUCrkVV9TKIpgaXabtAunbcS6Ndc2snm3TaDz7RsdyiulcbelDXTQiz95GevuqAWCKYulA4MM3bb6M6R46UthWsIjeZcVOp_sBfl2fFw6A1ZSxQsZ4z5BjBpajcKTgVG1DLuftWkYP1QWzlX8v3Z88nPcNdkn0rTYtJlgK-UV0LJsSoP5bunDPpV27Ce0bn7T95maZvWlZp_kjqfyy7jrlWJGj8kx22_gwOeSCh6-CxP0xwOcQdd8tSrFzxvEoKWo7FudYpBAbj1ipH7nXa3sbf6Tu994JmBBKe_eHxavqvxuFQTpgsyIPnd_rAXIsRBPKD9LK0HPLJi6piKM7W3ZxtjGfiSyq-COzPU84aL2UCJfV8ifmhLHs"); int httpCode = http.POST(postData); //Send the request String payload = http.getString(); //Get the response payload Serial.println(httpCode); //Print HTTP return code Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); Serial.println(payload); //Print request response payload http.end(); //Close connection delay(2000); //Post Data at every 5 seconds //=============================================================== if (counter == 60) //Get new data every 10 minutes { counter = 0; displayGettingData(); delay(1000); } else { counter++; serialMonitorData(); displayConditions(); delay(5000); } } //================================================================================================================================================================================================== void displayConditions(float temperatureInt, float humidityInt, float rainInt, float moistureInt, float lightInt) { lcd.clear(); int chk = DHT.read11(DHT11_PIN); lcd.setCursor(0,0); lcd.print("Temperature : "); //lcd.print(temperatureInt, 1); lcd.print(DHT.temperature); lcd.print((char)223); lcd.print("C "); //Printing Humidity lcd.setCursor(0, 1); lcd.print("humidity : "); lcd.print(DHT.humidity); // lcd.print(humidityInt, 1); lcd.print("%"); delay(5000); lcd.clear(); //Printing rain lcd.setCursor(0, 0); lcd.print("Rain : "); lcd.print(rainInt, 1); lcd.print(" hPa"); //Printing moisture lcd.setCursor(0, 1); lcd.print("Moisture : "); lcd.print(moistureInt, 1); lcd.print(" m/s"); delay(5000); lcd.clear(); //Printing light lcd.setCursor(0, 0); lcd.print("Light : "); lcd.print(lightInt, 1); lcd.print(" %"); } void displayGettingData() { lcd.clear(); lcd.print("Getting data"); } void serialMonitorData(float temperatureInt, float humidityInt, float rainInt, float moistureInt, float lightInt) { Serial.print("Temp : "); Serial.print(temperatureInt, 1); Serial.print("*C "); Serial.print(" Hum : "); Serial.print(humidityInt, 1); Serial.print("%"); Serial.print(" Rain : "); Serial.print(rainInt, 1); Serial.print(" hPa"); Serial.print(" Moist : "); Serial.print(moistureInt, 1); Serial.print(" % "); Serial.print(" Light : "); Serial.print(lightInt, 1); Serial.println(" %"); } ``` ### Debug Messages ``` In file included from C:\Users\USER.000\Documents\Arduino\libraries\DHT_FINAL\dht.h:18:0, from C:\Users\USER.000\Documents\Arduino\libraries\DHT_FINAL\dht.cpp:30: C:\Users\USER.000\Documents\Arduino\libraries\DHT_FINAL\dht.cpp: In member function 'int dht::_readSensor(uint8_t, uint8_t)': C:\Users\USER.000\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Arduino.h:215:118: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in initialization #define portInputRegister(port) (((port)==_PORT_GPIO16)?((volatile uint32_t*) &GP16I):((volatile uint32_t*) &GPI)) ^ C:\Users\USER.000\Documents\Arduino\libraries\DHT_FINAL\dht.cpp:116:29: note: in expansion of macro 'portInputRegister' volatile uint8_t *PIR = portInputRegister(port); ^ exit status 1 Error compiling for board WeMos D1 R1. ```
kerem 2026-02-28 01:27:41 +03:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@tablatronix commented on GitHub (Jun 16, 2020):

not a wm issue

<!-- gh-comment-id:644971109 --> @tablatronix commented on GitHub (Jun 16, 2020): not a wm issue
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#921
No description provided.