Compilation error when uploading DIY Basic sketch


Get the following error when uploading sketch to DIY basic unit Ive built:

c:\Users\User\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\AirGradient.cpp: In member function ‘TMP_RH AirGradient::returnError(TMP_RH_ErrorCode)’:
c:\Users\User\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\AirGradient.cpp:684:14: warning: converting to non-pointer type ‘float’ from NULL [-Wconversion-null]
684 | result.t = NULL;
| ^~~~
c:\Users\User\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\AirGradient.cpp:685:15: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
685 | result.rh = NULL;
| ^~~~
. Variables and constants in RAM (global, static), used 31864 / 80192 bytes (39%)
╠══ DATA 1512 initialized variables
╠══ RODATA 3280 constants
╚══ BSS 27072 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 62695 / 65536 bytes (95%)
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 29927 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 346440 / 1048576 bytes (33%)
╚══ IROM 346440 code in flash v3.0
Serial port COM3
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: c8:c9:a3:54:80:9e
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 460800
Configuring flash size…
Auto-detected Flash size: 4MB
Compressed 385312 bytes to 273660…
Writing at 0x00000000… (5 %)
Writing at 0x00004000… (11 %)
Writing at 0x00008000… (17 %)
Writing at 0x0000c000… (23 %)
Writing at 0x00010000… (29 %)
Writing at 0x00014000… (35 %)
Writing at 0x00018000… (41 %)
Writing at 0x0001c000… (47 %)
Writing at 0x00020000… (52 %)
Writing at 0x00024000… (58 %)
Writing at 0x00028000… (64 %)
Writing at 0x0002c000… (70 %)
Writing at 0x00030000… (76 %)
Writing at 0x00034000… (82 %)
Writing at 0x00038000… (88 %)
Writing at 0x0003c000… (94 %)
Writing at 0x00040000… (100 %)
Wrote 385312 bytes (273660 compressed) at 0x00000000 in 6.8 seconds (effective 456.1 kbit/s)…
Hash of data verified.

Hard resetting via RTS pin…

The DIY unit works and I can add to my WiFi but no data seen on Dashboard and sometimes temp and humidity show Zero on units mini display.

Any ideas please to try and resolve?

kind regards



I noticed the device kept rebooting so after reading some forum recompiled with revert down to v3.0.2 for board manager. Compilation error did not appear.

Added device to Dashboard but dont see any data yet? How long before Dashboard shows
data? How can I check data flow?

kind regards


Reverting to v3.0.2 has solved the reboot issues.
Closing this topic.

Just be aware that v3.0.2 utilizes an older SoftwareSerial library that still has a bug that will be unable to properly read your serial data if the last packet is 0xFF. You may notice a CO2 reading of -3 when the CO2 level hits certain specific values as a symptom of this. You can leave it as is, but if you want to work around, the only way is to manually replace the SoftwareSerial library with the second-to-latest ( v6.17.1) one. It will have the fix for this bug, but not cause the exception 0 crashes.

Thanks for the info ken830

On another point I read it takes the Sense8 sensor a week or so to self calibrate . . . is this correct?

The Sensair S8 Residential sensor user guide is here:

This is what it says about the ABC (Automatic Baseline Calibration) and calibration:

Each ABC period is 8 days. It basically assumes the lowest readings over that time period is fresh air (400ppm), so it will slowly calibrate itself to that lowest reading.

Additionally there is also an example in the AirGradient library to make an immediate calibration to 400ppm.

 This is the code for forced calibration of the SenseAir S8 sensor. The sensor also has a one-week automatic baseline calibration that should calibrate the sensor latest after one week.0
 However if you need a faster calibration please proceed as following:

 1. Flash this code
 2. Bring the sensor outside into fresh air and leave it there for at least 10 minutes
 3. Power on the sensor
 4. Follow the instructions on the display
 5. After the calibration has been done, flash back the previous code for AQ measurements

 The codes needs the following libraries installed:
  “S8_UART” by Josep Comas tested with version 1.0.1
  “U8g2” by oliver tested with version 2.32.15

Many thanks to Josep Comas of the S8_UART library from which parts of below code are borrowed.


Thank you both. Appreciated.