Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling 'BME_280_BRZO_I2C_Test.ino' #35

Closed
aderusha opened this issue Oct 9, 2017 · 7 comments
Closed

Error compiling 'BME_280_BRZO_I2C_Test.ino' #35

aderusha opened this issue Oct 9, 2017 · 7 comments
Labels
Milestone

Comments

@aderusha
Copy link

aderusha commented Oct 9, 2017

Process:

  • Unzip arduino-1.8.4 to C:\
  • Create C:\arduino-1.8.4\portable
  • Add ESP8266 board manager URL, install ESP8266 board support, and select NodeMCU 1.0 (ESP-12E Module) from Board Manager
  • Install library Brzo I2C Version 1.31 from Library Manager
  • Install library BME280 Version 2.2.0 from Library Manager
  • Open example BME280_BRZO_I2C_Test
  • Run "Verify" and the following error occurs:
Arduino: 1.8.4 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"

Archiving built core (caching) in: C:\Users\<user>\AppData\Local\Temp\arduino_cache_594038\core\core_esp8266_esp8266_nodemcuv2_CpuFrequency_80,UploadSpeed_115200,FlashSize_4M3M_8ee5fab911ac50cf47efcbc596507c23.a
sketch\BME_280_BRZO_I2C_Test.ino.cpp.o: In function `loop':

C:\arduino-1.8.4\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test/BME_280_BRZO_I2C_Test.ino:84: undefined reference to `BME280I2C_BRZO::BME280I2C_BRZO(BME280I2C_BRZO::Settings const&)'

sketch\BME_280_BRZO_I2C_Test.ino.cpp.o: In function `__static_initialization_and_destruction_0':

C:\arduino-1.8.4\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test/BME_280_BRZO_I2C_Test.ino:87: undefined reference to `BME280I2C_BRZO::BME280I2C_BRZO(BME280I2C_BRZO::Settings const&)'

sketch\BME_280_BRZO_I2C_Test.ino.cpp.o: In function `printBME280Data(Stream*)':

C:\arduino-1.8.4\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test/BME_280_BRZO_I2C_Test.ino:88: undefined reference to `BME280I2C_BRZO::begin()'

sketch\BME_280_BRZO_I2C_Test.ino.cpp.o: In function `setup':

C:\arduino-1.8.4\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test/BME_280_BRZO_I2C_Test.ino:51: undefined reference to `BME280I2C_BRZO::begin()'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
@finitespace
Copy link
Owner

finitespace commented Oct 9, 2017 via email

@finitespace finitespace reopened this Oct 9, 2017
@finitespace finitespace added the bug label Oct 9, 2017
@finitespace finitespace added this to the Version_2.2 milestone Oct 9, 2017
@aderusha
Copy link
Author

aderusha commented Oct 9, 2017

In file BME280I2C_BRZO.cpp I've removed the #ifdef _BRZO_I2C_h at line 36 and the matching #endif at line 88. No other changes from the test procedure outlined above. Compiling the example file BME_280_BRZO_I2C_Test.ino now returns the following errors:

Archiving built core (caching) in: C:\Users\<user>\AppData\Local\Temp\arduino_cache_557126\core\core_esp8266_esp8266_nodemcuv2_CpuFrequency_80,UploadSpeed_115200,FlashSize_4M3M_8ee5fab911ac50cf47efcbc596507c23.a
sketch\BME_280_BRZO_I2C_Test.ino.cpp.o: In function `loop':

C:\arduino-1.8.4\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test/BME_280_BRZO_I2C_Test.ino:84: undefined reference to `BME280I2C_BRZO::BME280I2C_BRZO(BME280I2C_BRZO::Settings const&)'

sketch\BME_280_BRZO_I2C_Test.ino.cpp.o: In function `__static_initialization_and_destruction_0':

C:\arduino-1.8.4\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test/BME_280_BRZO_I2C_Test.ino:87: undefined reference to `BME280I2C_BRZO::BME280I2C_BRZO(BME280I2C_BRZO::Settings const&)'

sketch\BME_280_BRZO_I2C_Test.ino.cpp.o: In function `printBME280Data(Stream*)':

C:\arduino-1.8.4\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test/BME_280_BRZO_I2C_Test.ino:88: undefined reference to `BME280I2C_BRZO::begin()'

sketch\BME_280_BRZO_I2C_Test.ino.cpp.o: In function `setup':

C:\arduino-1.8.4\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test/BME_280_BRZO_I2C_Test.ino:51: undefined reference to `BME280I2C_BRZO::begin()'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

@finitespace
Copy link
Owner

Pull down the latest version and try again. I wasn't getting the same compile errors as you, but I did fix some things.

I was getting a bug with :
'#define SDA_PIN = D2
#define SCL_PIN = D1'
it wasn't liking D1 & D2. I don't have time to debug it now, but I will look at it tonight. You might be able to get it working now.

@aderusha
Copy link
Author

aderusha commented Oct 10, 2017

Still no go. Test procedure is now:

  • Unzip arduino-1.8.4 to C:\arduino
  • Create C:\arduino\portable
  • Add ESP8266 board manager URL, install ESP8266 board support, and select NodeMCU 1.0 (ESP-12E Module) from Board Manager
  • Install library Brzo I2C Version 1.31 from Library Manager
  • Install library BME280 from ZIP file downloaded ~ 11:00am GMT 2017-10-10
  • Open example BME280_BRZO_I2C_Test
  • Run "Verify" and the following error occurs:
Arduino: 1.8.4 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"

In file included from C:\arduino\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test\BME_280_BRZO_I2C_Test.ino:32:0:

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:41:1: error: expected class-name before '{' token

 {

 ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:45:29: error: 'BME280I2C' has not been declared

    struct Settings : public BME280I2C::Settings

                             ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:45:40: error: expected '{' before 'Settings'

    struct Settings : public BME280I2C::Settings

                                        ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:66:13: error: 'Settings' does not name a type

       const Settings& settings = Settings());

             ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:66:43: error: ISO C++ forbids declaration of 'settings' with no type [-fpermissive]

       const Settings& settings = Settings());

                                           ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:60:4: error: invalid use of non-static data member 'BME280I2C_BRZO::Settings'

    };

    ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:66:34: error: from this location

       const Settings& settings = Settings());

                                  ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:48:7: error: 'OSR' was not declared in this scope

       OSR _tosr       = OSR_X1,

       ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:49:7: error: 'OSR' was not declared in this scope

       OSR _hosr       = OSR_X1,

       ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:50:7: error: 'OSR' was not declared in this scope

       OSR _posr       = OSR_X1,

       ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:51:7: error: 'Mode' was not declared in this scope

       Mode _mode      = Mode_Forced,

       ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:52:7: error: 'StandbyTime' was not declared in this scope

       StandbyTime _st = StandbyTime_1000ms,

       ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:53:7: error: 'Filter' was not declared in this scope

       Filter _filter  = Filter_Off,

       ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:54:7: error: 'SpiEnable' was not declared in this scope

       SpiEnable _se   = SpiEnable_False,

       ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:55:16: error: expected primary-expression before '_cr'

       uint16_t _cr    = 400

                ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:56:6: error: expression cannot be used as a function

      ): BME280I2C::Settings(_tosr, _hosr, _posr, _mode, _st, _filter, _se),

      ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:56:7: error: expected '}' before ':' token

      ): BME280I2C::Settings(_tosr, _hosr, _posr, _mode, _st, _filter, _se),

       ^

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:56:7: error: cannot convert '<brace-enclosed initializer list>' to 'int' in initialization

C:\arduino\portable\sketchbook\libraries\BME280\src/BME280I2C_BRZO.h:56:7: error: expected ';' before ':' token

BME_280_BRZO_I2C_Test:41: error: call to 'BME280I2C_BRZO::BME280I2C_BRZO(const int&)' uses the default argument for parameter 1, which is not yet defined

 BME280I2C_BRZO bme;   // Default : forced mode, standby time = 1000 ms

                ^

C:\arduino\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test\BME_280_BRZO_I2C_Test.ino: In function 'void setup()':

BME_280_BRZO_I2C_Test:36: error: expected primary-expression before '=' token

 #define SDA_PIN = D2

                 ^

C:\arduino\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test\BME_280_BRZO_I2C_Test.ino:53:19: note: in expansion of macro 'SDA_PIN'

    brzo_i2c_setup(SDA_PIN,SCL_PIN,I2C_ACK_TIMEOUT);

                   ^

BME_280_BRZO_I2C_Test:37: error: expected primary-expression before '=' token

 #define SCL_PIN = D1

                 ^

C:\arduino\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test\BME_280_BRZO_I2C_Test.ino:53:27: note: in expansion of macro 'SCL_PIN'

    brzo_i2c_setup(SDA_PIN,SCL_PIN,I2C_ACK_TIMEOUT);

                           ^

BME_280_BRZO_I2C_Test:55: error: 'class BME280I2C_BRZO' has no member named 'begin'

    while(!bme.begin())

               ^

C:\arduino\portable\sketchbook\libraries\BME280\examples\BME_280_BRZO_I2C_Test\BME_280_BRZO_I2C_Test.ino: In function 'void printBME280Data(Stream*)':

BME_280_BRZO_I2C_Test:77: error: 'BME280' has not been declared

    BME280::TempUnit tempUnit(BME280::TempUnit_Celcius);

    ^

BME_280_BRZO_I2C_Test:77: error: expected ';' before 'tempUnit'

    BME280::TempUnit tempUnit(BME280::TempUnit_Celcius);

                     ^

BME_280_BRZO_I2C_Test:78: error: 'BME280' has not been declared

    BME280::PresUnit presUnit(BME280::PresUnit_Pa);

    ^

BME_280_BRZO_I2C_Test:78: error: expected ';' before 'presUnit'

    BME280::PresUnit presUnit(BME280::PresUnit_Pa);

                     ^

BME_280_BRZO_I2C_Test:80: error: 'class BME280I2C_BRZO' has no member named 'read'

    bme.read(pres, temp, hum, tempUnit, presUnit);

        ^

BME_280_BRZO_I2C_Test:80: error: 'tempUnit' was not declared in this scope

    bme.read(pres, temp, hum, tempUnit, presUnit);

                              ^

BME_280_BRZO_I2C_Test:80: error: 'presUnit' was not declared in this scope

    bme.read(pres, temp, hum, tempUnit, presUnit);

                                        ^

BME_280_BRZO_I2C_Test:84: error: 'BME280' was not declared in this scope

    client->print("°"+ String(tempUnit == BME280::TempUnit_Celcius ? 'C' :'F'));

                                           ^

exit status 1
call to 'BME280I2C_BRZO::BME280I2C_BRZO(const int&)' uses the default argument for parameter 1, which is not yet defined

@finitespace
Copy link
Owner

finitespace commented Oct 10, 2017

Alright, I had committed the wrong file last night.

With a fresh checkout as of 10/10/2017 10:26am MST:

-Modify BME280I2C_BRZO.cpp line 35 add: #define USING_BRZO 1
-Open example BME280_BRZO_I2C_Test
-Run "Verify".

I am getting a successful compile.

@aderusha
Copy link
Author

Confirmed working! The example file now compiles with the instructions you've provided and I am now able to successfully read data from a test BME280 device connected to D1/D2 on a Wemos D1 mini. Thank you so much for your work on this and the crazy-fast turnaround on squashing bugs, I really appreciate it!

@finitespace
Copy link
Owner

Outlined in #36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants