arduino / ArduinoAI

Arduino AI content / demos
71 stars 48 forks source link

[AE-13] CO2 and IAQ values in Dashboard sketch always 0 #14

Open aliphys opened 1 year ago

aliphys commented 1 year ago

Describe the problem

The values for the gas sensor and air quality are not displayed on the Nicla Sense ME dashboard and are always zero.

image

To reproduce

I am following this tutorial on the docs website: https://docs.arduino.cc/tutorials/nicla-sense-me/web-ble-dashboard

  1. Open IDE 2.0.4
  2. Update libraries to latest version (if requested)
  3. Load the NiclaSenseME.ino sketch
  4. The following message is displayed in the Output window
Sketch uses 313028 bytes (59%) of program storage space. Maximum is 527616 bytes.
Global variables use 39600 bytes (61%) of dynamic memory, leaving 24688 bytes for local variables. Maximum is 64288 bytes.
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.11.0-arduino2/bin/openocd.exe" -d2 -s "C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.11.0-arduino2/share/openocd/scripts/" -f interface/cmsis-dap.cfg -c "transport select swd; adapter speed 1000" -f target/nrf52.cfg -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; program {C:\Users\user\AppData\Local\Temp\arduino\sketches\5B5C76D81A5136F18ABEB99A48521561/NiclaSenseME.ino.elf}; reset run; shutdown"
Open On-Chip Debugger 0.11.0+dev-gab95bac57-dirty (2021-05-11-10:45)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

adapter speed: 1000 kHz

Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = v1.0
Info : CMSIS-DAP: Serial# = 401D6526
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00006dc4 msp: 0x20010000
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00006dc4 msp: 0x20010000
** Programming Started **
Info : nRF52832-CIAA(build code: E0) 512kB Flash, 64kB RAM
Info : Padding image section 0 at 0x0005b854 with 4 bytes
Warn : Adding extra erase range, 0x0005c6d0 .. 0x0005cfff
** Programming Finished **
shutdown command invoked
  1. Open the Nicla Sense ME Dashboard with Chrome then pair with the Nicla BLE Sense ME
  2. The stream for the Indoor Air Quality and CO2 value is constantly zero.

Expected behavior

The value for the Indoor Air Quality and CO2 is non-zero

Arduino IDE version

2.0.4

Operating system

Windows 10

aliphys commented 1 year ago

Troubleshooting

Step 1

I uploaded the Standalone.ino sketch, included as part of the Arduino_BHY2 library located in the arduino/nicla-sense-me-fw repo.

In the Serial Monitor, I can see that the value for temperature and gas is non zero. Therefore, I infer that this is not a physical issue with the board, but a possible Bluetooth or software issue.

Step 2

In the NiclaSenseME.ino sketch, I modified the code to print the values of airQuality and co2 to the Serial Monitor. image

I get a bunch of zeros in the Serial Monitor.

image

This could relate to parsing the data.

aliphys commented 1 year ago

As a result of troubleshooting, made an issue here https://github.com/arduino/nicla-sense-me-fw/issues/82

aliphys commented 1 year ago

Might be resolved by

aliphys commented 1 year ago

The pressure in the dashboard is too high. 1009 kPa is about 10 times the pressure at sea level (101 kPa).