WisBlock Environmental Sensor RAK1906 Example compilation errors

Good night,

Recently I bought some WisBlock board and Sensors. I mount a board with the sensors RAK1906 and RAK1903. I compiled the examples for RAK1903 without problems, but when I tried to compile the example for RAK1906 for BOSH BME680 I am receiving a lot of compilation errors (pasted below):
Could you help me?

Library BSEC_Software_Library has been declared precompiled:
Precompiled library in “F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src\cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard\fpv4-sp-d16-hard” not found
Precompiled library in “F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src\cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard” not found
f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: libraries\BSEC_Software_Library\BSEC_Software_Library.a(bsec.cpp.o): in function Bsec::beginCommon()': F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:157: undefined reference to bsec_init’
f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: libraries\BSEC_Software_Library\BSEC_Software_Library.a(bsec.cpp.o): in function Bsec::getVersion()': F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:317: undefined reference to bsec_get_version’
f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: libraries\BSEC_Software_Library\BSEC_Software_Library.a(bsec.cpp.o): in function Bsec::updateSubscription(bsec_virtual_sensor_t*, unsigned char, float)': F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:180: undefined reference to bsec_update_subscription’
f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: libraries\BSEC_Software_Library\BSEC_Software_Library.a(bsec.cpp.o): in function Bsec::setState(unsigned char*)': F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:286: undefined reference to bsec_set_state’
f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: libraries\BSEC_Software_Library\BSEC_Software_Library.a(bsec.cpp.o): in function Bsec::readProcessData(long long, bsec_bme_settings_t)': F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:385: undefined reference to bsec_do_steps’
f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: libraries\BSEC_Software_Library\BSEC_Software_Library.a(bsec.cpp.o): in function Bsec::run(long long)': F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:202: undefined reference to bsec_init’
f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:210: undefined reference to bsec_update_subscription' f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:216: undefined reference to bsec_sensor_control’
f:/users/claudio rosa/documents/arduinodata/packages/raknrf/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: F:\Users\Claudio Rosa\Documents\Arduino\libraries\BSEC_Software_Library\src/bsec.cpp:246: undefined reference to `bsec_get_state’
collect2.exe: error: ld returned 1 exit status
exit status 1
Erro compilando para a placa WisBlock Core RAK4631 Board

Bosch BSEC library changed in November 2020.
In order to get it compiled for WisBlock you need to change one line in the RAK BSP.

Please locate the file boards.txt inside the RAK BSP. On Windows the path is:
C:\Users\>USERNAME<\AppData\Local\Arduino15\packages\raknrf\hardware\nrf52\0.21.1
>USERNAME< should be replaced with your username.

Open boards.txt with a text editor (notepad or similar, NOT WORD) and look for this line:
WisCoreRAK4631Board.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
it should be line 38.
Change the line to:
WisCoreRAK4631Board.build.mcu=cortex-m4
and save the file. Close ArduinoIDE, open it again and try to compile the example again.

I am sorry for the inconvenience. We are in the process to update the BSP and will release a new version soon.

Hi Bernd,

Thank you by your support.

I am working on it now.

I will send the News as soon as possible.

Cláudio

Well much better now!

I still have some “warnings”. Could you help me to fix them?

Cláudio

Can you send me the warnings?

Some warnings are caused by libraries and cannot be resolved by us.

Thank you by your support.

With regard to your new error (which should have been posted here, not in another thread):

c:/users/claudio rosa/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/7.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: cannot find -lalgobsec

This would seem to indicate that somehow the setup isn’t providing the path to it as a -L flag to the linker. It seems like the linker search -L flags aren’t literally part of the library distro itself but need to somehow come from the IDE, eg, for each elected library adding a -L to the appropriate target archiecture subdirectory.

Worth noting that https://github.com/BoschSensortec/BSEC-Arduino-library/tree/master/src/cortex-m4 seems like is may now offer both soft and hardfloat versions

Overall blame for all of this should fall on Bosch, in that they’re so much more concerned about secrecy than functionality, that they ship this code only in extremely awkward, problem-causing binary form, and not portable, maintainable source form. You might want to try using the sensor in plain mode without the problematic BSEC.

Sorry, but you are mixing two differents cases in two differents environments:

  1. This case was in Arduino IDE environment, and Bernd fixed it;
  2. The other is the same WisBlock solution (RAK1906+RAK1903) but with PlatformIO IDE, where I am receiving the error message that you metioned and you got in the other case “Error on link process - cannot find -lalgobsec”

@beegee,

Could you publish the RAK1906 library in the PlatformIO? The example that we have it is for Arduino but I already verified that your RAK1906 (BME680) library isn´t available in the PlatformIO.

Thank you.

ClosedCube BME680 library is available in PlatformIO
Install in platformio.ini of your project with

[env:wiscore_rak4631]
platform = raknrf
board = wiscore_rak4631
framework = arduino
lib_deps = 
	closedcube/ClosedCube BME680 

Bosch BSEC is available in PlatformIO as well.
Install in platformio.ini of your project with

[env:wiscore_rak4631]
platform = raknrf
board = wiscore_rak4631
framework = arduino
lib_deps = 
	boschsensortec/BSEC Software Library 


Thank you :slight_smile:

The library ClosedCube BME680 has 3 years old, well maybe something changed during this time.

Below you will see a basic the compilation error: not declared

Blockquote
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:wiscore_rak4631]
platform = nordicnrf52
board = wiscore_rak4631
framework = arduino
lib_deps = closedcube/ClosedCube [email protected]^1.2.0
Blockquote

Blockquote
Dependency Graph
|-- 1.2.0
| |-- 1.0
|-- 1.0
Building in release mode
Compiling .pio\build\wiscore_rak4631\src\main.cpp.o
Compiling .pio\build\wiscore_rak4631\liba84\Wire\Wire_nRF52.cpp.o
Compiling .pio\build\wiscore_rak4631\libf9e\ClosedCube BME680\ClosedCube_BME680.cpp.o
Compiling .pio\build\wiscore_rak4631\FrameworkArduinoVariant\variant.cpp.o
Compiling .pio\build\wiscore_rak4631\FrameworkArduino\HardwarePWM.cpp.o
Compiling .pio\build\wiscore_rak4631\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\wiscore_rak4631\FrameworkArduino\Print.cpp.o
Compiling .pio\build\wiscore_rak4631\FrameworkArduino\RingBuffer.cpp.o
src\main.cpp: In function ‘void loop()’:
src\main.cpp:46:36: error: ‘readAndPrintStatus’ was not declared in this scope
ClosedCube_BME680_Status status = readAndPrintStatus();
^~~~~~~~~~~~~~~~~~
*** [.pio\build\wiscore_rak4631\src\main.cpp.o] Error 1
====================================================================== [FAILED] Took 2.36 seconds ======================================================================
The terminal process “C:\Users\Claudio Rosa.platformio\penv\Scripts\pio.exe ‘run’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Blockquote

The BSEC by Bosh Library is newer 2 months and it is working fine. I did some changes :slight_smile:

Blockquote

Timestamp [ms] = 3017
raw temperature [°C] = 28.21
pressure [hPa] =100843.00
raw relative humidity [%] = 61.11
gas [Ohm] = 28246.00
IAQ = 25.00
IAQ accuracy = 0
temperature [°C] = 28.15
relative humidity [%] = 61.25
Static IAQ = 25.00
CO2 equivalent = 500.00
breath VOC equivalent = 0.50

Blockquote

Blockquote

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.