>>> Join Us in the Fight Against Air Pollution

AirGradient Forum

Unable to connect to Wifi after flashing firmware

I pulled one of my DIY Basic kits out of the cupboard and powered it on. It connected to my Wifi hotspot but I needed to join a different hot spot. I tried factory resetting but it wouldn’t work so decided to flash the firmware following the instructions here The AirGradient DIY Air Quality Sensor (Basic Version PCB Version < 3.0)

I loaded the DIY_BASIC sketch into the arduino software and pushed it to the basic, it appeared to work however there were a couply of warnings.

The OLED display is showing quality data and when powering on it says:

Connect Wifi AG-
Warm Up Serial #

Any suggestions about what I could be doing wrong and how to fix?
I installed version 2.4.7 of the AG arduino package, I might try and older one.

Thanks.

\Arduino\libraries\AirGradient_Air_Quality_Sensor\AirGradient.cpp: In member function 'TMP_RH AirGradient::returnError(TMP_RH_ErrorCode)':
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;
      |              ^~~~
\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 31844 / 80192 bytes (39%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ DATA     1512     initialized variables
╠══ RODATA   3236     constants       
╚══ BSS      27096    zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 62667 / 65536 bytes (95%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ ICACHE   32768    reserved space for flash instruction cache
╚══ IRAM     29899    code in IRAM    
. Code in flash (default, ICACHE_FLASH_ATTR), used 348152 / 1048576 bytes (33%)
║   SEGMENT  BYTES    DESCRIPTION
╚══ IROM     348152   code in flash   
esptool.py v3.0
Serial port COM4
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: a8:48:fa:dd:2c:51
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 386944 bytes to 274754...
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 386944 bytes (274754 compressed) at 0x00000000 in 6.4 seconds (effective 484.7 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Trying and older version of the firmware didn’t seem to work, I did run a program to just connect to my wifi hotspot, and that was successful and did recieve an IP address, so I know the Wifi module is working.

I seem to have gotten it to work.
I powered off my Access Point and it seems to have reset itself.
Didn’t realise the wifi settings would persist after a firmware upgrade.

It does remember by default. I saw this note in the Arduino code:
arduino/examples/DIY_PRO_V4_2/DIY_PRO_V4_2.ino at master · airgradienthq/arduino · GitHub

Line 410: //WiFi.disconnect(); //to delete previous saved hotspot

So I think you would remove the two slashes at the beginning of that line and then upload the code and it would forget existing networks