metriful / sensor

Sensor by Metriful | Indoor environment monitoring | Documentation and code samples
https://www.sensor.metriful.com
MIT License
110 stars 37 forks source link

Error during compilation of Home_Assistant.ino #28

Closed MarcoLeti closed 3 years ago

MarcoLeti commented 3 years ago

:\Git\sensor\Arduino\Examples\Home_Assistant\Home_Assistant.ino: In function 'void sendNumericData(const HA_Attributes_t*, uint32_t, uint8_t, bool)': Home_Assistant:169:30: error: expected ')' before 'INT32' 169 | sprintf(valueText,"%s%" PRIu32, sign, valueInteger); | ~ ^ | ) Home_Assistant:172:30: error: expected ')' before '__INT32' 172 | sprintf(valueText,"%s%" PRIu32 ".%u", sign, valueInteger, valueDecimal); | ~ ^ | ) Home_Assistant:175:30: error: expected ')' before 'INT32' 175 | sprintf(valueText,"%s%" PRIu32 ".%02u", sign, valueInteger, valueDecimal); | ~ ^ | ) exit status 1 expected ')' before '__INT32'

metriful commented 3 years ago

Hi, Thanks for reporting this.

It is an error in the latest version of the ESP8266 library (3.0.0 and later). As a work-around please do the following:

  1. In the Arduino IDE menu, go to Tools > Board > Boards Manager. Search for the package named esp8266 by ESP8266 Community.

  2. In the selection box, choose version 2.7.4 (or earlier) and click "install"

  3. The programs will now compile correctly without errors.

NOTE: the IDE will think the library is out of date and may prompt you to update it. Ignore this.

You could report this problem to the developers of the ESP8266 library.