That is exactly what I did, and after checking with the I2C_scanner sketch, I can confirm that it works.
However, except for the "seeed_BME280" library, which compiles fine, but does not allow for two BME280 boards with two different addresses, all the other libraries gave me some error about a "nullptr" not declared. And that I don't know how to fix because I don't know what it means.
Try the Library I have attached in Post #18.
Going to try right now. I'll let you know.
When I tried to install it, it says that I have that library already installed but with a different version. The one you sent me a link to is v2.2.2, while the one I have in my IDE is v2.3.0
I tried with that one already, and I get the "nullptr" undeclared error.
Your one is seed_ something, and mine one different.
INclude the Libray in the IDE that I have attached in post #18 and then upload the following sketc and see what happens>
#include <Adafruit_BME280.h>
#include <Adafruit_Sensor.h>
float temperatureC1, temperatureC2 ;
Adafruit_BME280 bme1; //BME280 connect to ESP32 I2C (GPIO 21 = SDA, GPIO 22 = SCL)
Adafruit_BME280 bme2;
bool flag1, flag2;
void setup()
{
Serial.begin(115200); //Initialize serial
delay(5000);
if (!bme1.begin(0x76))
{
Serial.println("Could not find a valid BME1_280 sensor, check wiring!");
while (1);
}
else
{
flag1 = true;
}
if (!bme2.begin(0x77))
{
Serial.println("Could not find a valid BME2_280 sensor, check wiring!");
while (1);
}
else
{
flag2 = true;
}
void loop()
{
if(flag1 == true)
{
temperatureC1 = bme1.readTemperature();
Serialr.print("Temperature1 (ÂșC): ");
Serial.println(temperatureC1);
delay(1000);
}
if(flag2 == true)
{
temperatureC2 = bme2.readTemperature();
Serialr.print("Temperature2 (ÂșC): ");
Serial.println(temperatureC2);
delay(1000);
}
}
Isn't this the library you are mentioning?
Hi Mostafa,
I have uploaded your code into my Heltec CubeCell AB02 board, first using the Adafruit_BME280 library v2.3.0 that I already had installed in the IDE. Then, I did the same thing with your version (v2.2.2) that you sent me.
With both, I get the same result during compliling:
In file included from c:\GUY\Programs\Arduino\libraries\Adafruit_BME280_Library/Adafruit_BME280.h:26:0,
from C:\Users\gctyt\AppData\Local\Temp\.arduinoIDE-unsaved2026416-29108-1ski3pp.a9u3\sketch_may16a\sketch_may16a.ino:1:
c:\GUY\Programs\Arduino\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:18:45: error: 'nullptr' was not declared in this scope
const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0);
^
In file included from c:\GUY\Programs\Arduino\libraries\Adafruit_BME280_Library/Adafruit_BME280.h:27:0,
from C:\Users\gctyt\AppData\Local\Temp\.arduinoIDE-unsaved2026416-29108-1ski3pp.a9u3\sketch_may16a\sketch_may16a.ino:1:
c:\GUY\Programs\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:115:45: error: 'nullptr' was not declared in this scope
const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0);
^
c:\GUY\Programs\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:130:20: error: 'nullptr' was not declared in this scope
SPIClass *_spi = nullptr;
^
c:\GUY\Programs\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:131:30: error: 'nullptr' was not declared in this scope
SPISettings *_spiSetting = nullptr;
^
C:\Users\gctyt\AppData\Local\Temp\.arduinoIDE-unsaved2026416-29108-1ski3pp.a9u3\sketch_may16a\sketch_may16a.ino: In function 'void setup()':
C:\Users\gctyt\AppData\Local\Temp\.arduinoIDE-unsaved2026416-29108-1ski3pp.a9u3\sketch_may16a\sketch_may16a.ino:37:1: error: a function-definition is not allowed here before '{' token
{
^
C:\Users\gctyt\AppData\Local\Temp\.arduinoIDE-unsaved2026416-29108-1ski3pp.a9u3\sketch_may16a\sketch_may16a.ino:53:1: error: expected '}' at end of input
}
^
exit status 1
Compilation error: a function-definition is not allowed here before '{' token
Did you upload the BME280 code from the Heltec CubeCell AB02 library? (post #15)
I did it again to be sure (done so many things now that I'm getting lost), but I still get that same error about "nullptr" not being declared. Do you know what that means? Is there a way to fix it?
It is a keyword that should be defined at the very basic level by C, C++ or Arduino. Or, so I thought.
Here is one error reference... in Adafruit_I2CDevice.h:18:45
bool write(const uint8_t *buffer, size_t len, bool stop = true,
const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0);
Yes
This issue has been around a while...
I removed all my libraries and tried to "fresh install" the CubeCell library ZIP file from here: GitHub - HelTecAutomation/CubeCell-Arduino: Heltec CubeCell Series (based on ASR6501, ASR6502 chip) Arduino support. · GitHub
... but the error I received in the IDE was...

So... I installed libraries when the IDE called for them.
First error called for Adafruit_Sensor.h... but this is not in the IDE Library Manager, so I went to its github page and realized it is "Adafruit Unified Sensor" which IS in the IDE (so I installed it).
Recompiled and got the error calling for Adafruit_BME280.h... so i installed it as well as the dependencies...Adafruit BusIO and Adafruit Unified Sensor (which it recognized Already installed Adafruit Unified Sensor@1.1.15).
Recompiled and got the error calling for LoRaWan_APP.h but in LOCAL QUOTES (like it needs to be stored locally and be edited)... but the IDE does not recognize it, so searching the internet pointed me to this file being buried in the CubeCell library.
Which threw the error mentioned at the beginning of this post.
Why is this CubeCell "library" zip file not installable?
Does the IDE need to install a core in Board Manager?
Why is LoRaWan_APP.h not available?
Further, in the sketch , why is Arduino.h in "local quotes" rather than <system wakas>? Is that where nullptr is unassigned?
I had been under the assumption this was an Arduino sketch... but it appears to be ESP32, however, I see no mention of ESP32 in the entire topic.
Still searching.
[update]
@guy9ak - Are you using Arduino or ESP32 version? Did you add the BSP to the IDE >> PREFERENCES >> Board Manager list?
https://github.com/HelTecAutomation/CubeCell-Arduino/releases/download/V1.5.0/package_CubeCell_index.json
From here: Cubecell Framework installation Via Arduino Board Manager â cubecell latest documentation
I also tried installing LoRaWan_APP.h from here: CubeCell-Arduino/libraries/LoRa/src/LoRaWan_APP.h at master · HelTecAutomation/CubeCell-Arduino · GitHub
... but that lead me to installing a dozen other local files... so I stopped.
So far, I have no nullptr errors.
@guy9ak 0 From where did you get the software you installed?
I did find this previous Forum topic that started out with trying to install the CubeCell ZIP, but the topic got hijacked. Error: 13 INTERNAL: Library installation failed: - #17 by ptillisch
Error: 13 INTERNAL: Library install failed: moving extracted archive to destination dir: library not valid
@ptillisch was addressing how to manually install a library from a ZIP file. The procedure works...
... but then the Adafruit nullptr issue pops up. The internet says the nullptr error is because the IDE is not "C++11" or newer... The internet said...
add the flag -std=c++11 to your compiler options
Following instructions how to find platform.txt I found the -std flag to be...
-std=gnu99
... so I changed this to -std=c++11... but the compile still failed with nullptr
So... still searching.
Please, be calm and patient. Fllow these steps and tell in wich step you are failing:
1. Uninstall all BME librraies from your PC.
2. Install/Include the Library that I have attcahed in poat #18.
3. Connect one BME280 with address 0x76 with your Arduino Board.
4. Upload the following sketch.
#include <Adafruit_BME280.h>
#include <Adafruit_Sensor.h>
float temperatureC1;
Adafruit_BME280 bme1;
void setup()
{
Serial.begin(115200); //Initialize serial
delay(2000);
if (!bme1.begin(0x76))
{
Serial.println("Could not find a valid BME1_280 sensor, check wiring!");
while (true);
}
void loop()
{
temperatureC1 = bme1.readTemperature();
Serialr.print("Temperature1 (ÂșC): ");
Serial.println(temperatureC1);
delay(1000);
}
}
5. Check that Serial Monitor shows almost correct room temperature.
6. Now, add code with sketch of Step-4 to read pressure and humidity from BME senesor and upload the sketch.
7. Check that Serial Monitor shows correct Temperature, Pressure, and Humidity.
8. Remove BME280 (0x76) from Arduino.
9. Connect BME280 with address 0x77 and check that it is working well.
10. Now connect both sensors with Arduino and upload the following sketch.
#include <Adafruit_BME280.h>
#include <Adafruit_Sensor.h>
float temperatureC1, temperatureC2 ;
Adafruit_BME280 bme1; //BME280 connect to ESP32 I2C (GPIO 21 = SDA, GPIO 22 = SCL)
Adafruit_BME280 bme2;
void setup()
{
Serial.begin(115200); //Initialize serial
delay(2000);
if (!bme1.begin(0x76))
{
Serial.println("Could not find a valid BME1_280 sensor, check wiring!");
while (1);
}
if (!bme2.begin(0x77))
{
Serial.println("Could not find a valid BME2_280 sensor, check wiring!");
while (1);
}
void loop()
{
temperatureC1 = bme1.readTemperature();
Serialr.print("Temperature1 (ÂșC): ");
Serial.println(temperatureC1);
delay(1000);
//========================
temperatureC2 = bme2.readTemperature();
Serialr.print("Temperature2 (ÂșC): ");
Serial.println(temperatureC2);
delay(1000);
}
Because it is not a library. It is instead an Arduino boards platform (AKA "core").
Arduino IDE's "Add .ZIP Library..." feature is a tool for installing libraries. So it is expected that it will fail if you attempt to use it to install a platform instead of a library.
You should use the Arduino IDE Boards Manager to install boards platforms. You can do that by following the instructions at the link you shared:
Developers of boards platforms may bundle libraries with the platform installation:
https://arduino.github.io/arduino-cli/latest/platform-specification/#platform-bundled-libraries
These libraries are installed by Boards Manager along with the platform. The libraries bundled with a platform are accessible when compiling with a board of that platform selected from Arduino IDE's Tools > Board menu.
The "CubeCell Dev-boards" platform has a bundled library named "LoRa":
As you noticed, that library provides a header file named LoRaWan_APP.h:
Unfortunately developers in the Arduino ecosystem tend to be very sloppy in their use of #include directive syntax. So you should not assign much significance to the syntax the developer chose to use.
Ideally the double quotes syntax would be used only when referencing file via a relative path, and the angle brackets syntax would always be used when referencing a file accessed via the compiler's "search path". However, the double quotes syntax has a fallback to using the compiler search path if the file is not found at the relative path, so they can get away with using double quotes syntax even when angle brackets would be most correct. Furthermore, the Arduino build system adds libraries and the core to the search path, so they can even get away with using angle brackets syntax when double quotes syntax would be correct in many cases.
Usually a platform developer chooses to bundle a library with the platform rather than distribute it via Library Manager in the case where the library is very specific to the architecture of that platform. So I would expect this "Lora" library to work when you have installed the "CubeCell Dev-boards" platform and have a board of that platform selected, but there is no guarantee that it will if you try to use it with a different platform.
I followed your instructions (link to other post above) to install the "library" part of the CubeCell download... and that got all the libraries installed.
Then I bumped into the "nullptr" issue and did the "-std = c++11" upgrade to "platform.txt" in the CubeCell files. Still compiled to "nullptr" failure.
This issue has been around since 2020 (earliest I could find) but I have not found the resolution, and Heltec forum links are dead/dying.
It must have a solution, or Heltec would not be around. I am guessing there is an "undefine" somewhere, and order-of-existance is the cause.
After finding the CubeCell core link, I installed the board supporr with Arduino IDE.
@ptillisch - Just want to call your attention for dangers associated with this...
SOLUTION FOR nullptr (or so I found it to compile past the nullptr issue)
Issue: "nullptr not declared"
Reason: nullptr is C++11 and newer (editing platform.txt -std=gnu99 did not resolve issue)
Solution: replace all nullptr to the pre-C++11; NULL
The error report will give all the path/filenames. Open those path/files in a text editor and replace all nullptr with NULL.
You should not see any nullptr errors... but... you will see the BME280 has some ugly errors.... see post #41 for the next errors to be seen...
Hi xfpd,
First, thanks a million for putting that much of an effort to resolve this issue, and I must say that your sleuthing skills are amazing. Of course, as a rather novice at programing in C and C++, this whole thing seems really over my head.
I will try this solution very soon (after dinner) and am really eager to see if it will work for me, although you are scaring a little with your report of ugly errors with the BME280. Do you think that it might be workable though?
This whole thing is very frustrating because either I find a board that works well with the various libraries, but draw a bunch of power (Heltec LoRa 32 v2), or I find a board that draws very little power (Heltec CubeCell AB02) but bombs with 50% of the examples I try. Very frustrating.
Thanks again
Hi Mostafa,
I assure you, I am very calm, but my patience is waring thin as I go through the process of trying to program those boards to do what I'd like them to do. It doesn't help that I am not a skilled programmer in C or C++ by any means, so this is a real challenge to begin with.
So, I really appreciate that there are people like you who spend their time trying to resolve my problems. So, Thank you!
I will try your solutions soon (after dinner) and will report the results to you right after.

