A way to fast check if wifi access point is available

regressor
Posts: 5
Joined: Sat Aug 13, 2022 12:46 am

A way to fast check if wifi access point is available

Postby regressor » Sat Aug 13, 2022 1:11 am

I'm working on battery-powered (18650, 3.7, 3500mah, xc6220) sensor device based on esp32. This device should capture and record temperature sensors data and then send data to collector IF it available. The collector visit device once a week or even month at a random time.

Collector is device (probably android phone) with enabled wifi access point and server app. Its ok for collector to stay there 10-15 minustes so check perion can be ~15min. The amount of data per month is approximately 4 kilobytes. The device should detect collector presense, connect to its AP and send all accumulated data to server.

The wifi scanNetworks(); function is too long and therefore has a high consumption.

Is there any way to wirelessly trigger device to start connect & transmission without high power consumption?

Craige Hales
Posts: 94
Joined: Tue Sep 07, 2021 12:07 pm

Re: A way to fast check if wifi access point is available

Postby Craige Hales » Sat Aug 13, 2022 1:07 pm

I have a powered device, so never measured, but I think you might want something similar

Code: Select all

            wifi_scan_config_t scan_config = { 0 };
            scan_config.channel = 0;//nextchan; // out of 1..13
            scan_config.show_hidden = 1;
            scan_config.scan_type = WIFI_SCAN_TYPE_PASSIVE; // vs WIFI_SCAN_TYPE_ACTIVE; // vs WIFI_SCAN_TYPE_PASSIVE
            scan_config.scan_time.passive = 50+2*watch32nds; // dwell on each channel, * 11 channels, less than 1500 ms
            
            esp_err_t rc = esp_wifi_scan_start(&scan_config, false);
If you know the channel the phone will be using, the passive scan should be fast and not use any transmit power. You might be able to set the phone's beacon interval, then make sure your esp listens at least twice that long. If there are no other wifi devices around it might work well.
Craige

regressor
Posts: 5
Joined: Sat Aug 13, 2022 12:46 am

Re: A way to fast check if wifi access point is available

Postby regressor » Sun Aug 14, 2022 3:22 am

Thanks! I'll try this. Also I think I found another way: start ble server on collector with large broadcast frequency, so sensor device can periodically do passive ble scan on all 3 channels with very short window and after detecting specific ble server start wifi client and try to connect AP to send data.

Who is online

Users browsing this forum: No registered users and 48 guests