s60sc/ESP32_AdBlocker

Infinitely “Connection failed with error: connection refused”.

PospelovDaniil opened this issue · 10 comments

ESP32-WROVER

I keep getting an error:

[00:00:11.753 startPing] Started ping monitoring
[00:00:11.766 getLocalNTP] Using NTP server: pool.ntp.org
[00:00:11.767 WARN getLocalNTP] Not yet synced with NTP 
[00:00:11.771 startWebServer] Starting web server on port: 80
[00:00:11.771 checkMemory] Free: heap 196296, block: 110580, pSRAM 4177119
[00:00:12.064 resetWatchDog] WatchDog started using task: ping
[00:00:12.186 loadBlockList] Initial load of latest blocklist
[00:00:12.188 downloadFile] Downloading https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

[00:00:12.280 ERROR @ appSpecific.cpp:200] Connection failed with error: connection refused 
[00:00:12.281 doRestart] Controlled restart: Failed to complete blocklist download, retry ... 
[00:48:34.001 onWiFiEvent] WiFi Station disconnected

What can be done about it?

It cant connect to the github server which could be for various reasons. Show the initial part of the log

All the output that there is, then it reboots and it happens again:

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13220
ho 0 tail 12 room 4
load:0x40080400,len:3028
entry 0x400805e4

[00:59:17.828 ramLogClear] Setup RAM based log
[00:59:17.831 listFolder] Sketch size 1302kB
[00:59:18.127 listFolder] File: /data/AdBlocker.htm, size: 16800
[00:59:18.132 listFolder] File: /data/common.js, size: 26697
[00:59:18.143 listFolder] File: /data/configs.txt, size: 1114
[00:59:18.144 listFolder] LittleFS: Total bytes 131072, Used bytes 69632
[00:59:18.162 loadConfig] Load config
[00:59:18.206 printResetReason] Software reset via esp_restart
[00:59:18.207 printWakeupReason] Wakeup by reset
[00:59:18.426 setWifiSTA] Wifi Station IP from DHCP
.[00:59:18.612 onWiFiEvent] WiFi Station connection to [DELETED], using hostname: ESP32_AdBlocker_581EA39EF0C8
.[00:59:19.407 onWiFiEvent] Wifi Station IP, use 'http://192.168.1.129' to connect
[00:59:19.454 onWiFiEvent] Wifi AP stopped: ESP32_AdBlocker_581EA39EF0C8
[00:59:19.454 onWiFiEvent] Wifi AP SSID: ESP32_AdBlocker_581EA39EF0C8 started, use 'http://192.168.4.1' to connect
[00:59:27.087 startWifi] Wifi stats for [DELETED] - signal strength: -17 dBm; Encryption: WPA2_PSK; channel: 9
[00:59:27.093 startPing] Started ping monitoring
[00:59:27.097 getLocalNTP] Using NTP server: pool.ntp.org
[00:59:27.098 startWebServer] Starting web server on port: 80
[00:59:27.109 checkMemory] Free: heap 199492, block: 110580, pSRAM 4177119
[00:59:27.109 showLocalTime] Got current time from NTP: 19/05/2024 00:59:27 with tz: GMT0
[00:59:27.413 resetWatchDog] WatchDog started using task: ping
[00:59:27.535 loadBlockList] Initial load of latest blocklist
[00:59:27.536 downloadFile] Downloading https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

[00:59:27.622 ERROR @ appSpecific.cpp:200] Connection failed with error: connection refused 
[00:59:27.623 doRestart] Controlled restart: Failed to complete blocklist download, retry ... 
[00:59:29.636 onWiFiEvent] WiFi Station disconnected
[00:59:29.637 onWiFiEvent] Wifi Station stopped [DELETED]
[00:59:29.638 onWiFiEvent] Wifi AP stopped: ESP32_AdBlocker_581EA39EF0C8
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13220
ho 0 tail 12 room 4
load:0x40080400,len:3028
entry 0x400805e4

From a computer or phone, this link opens without problems https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

I also noticed a problem the first time I connected to a WiFi network, my network name and password had special characters in it: ''!@ '-;: and it couldn't connect. Then I removed all the special characters and it was able to connect

NTP connected so internet connection ok. I dont know why github refuses connection for your setup. I have a later version of the app I will upload later that addresses the special chars, but I dont think it will help with the github problem

Okay, thanks for your help.

also another esp32-s3...

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x420d6d5a
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbe4
load:0x403cc700,len:0x2a38
entry 0x403c98d4

[12:27:11.725 ramLogClear] Setup RAM based log
[12:27:11.728 listFolder] Sketch size 1213kB
[12:27:11.851 listFolder] File: /data/AdBlocker.htm, size: 16800
[12:27:11.857 listFolder] File: /data/common.js, size: 38524
[12:27:11.875 listFolder] File: /data/configs.txt, size: 1114
[12:27:11.876 listFolder] LittleFS: Total bytes 1441792, Used bytes 81920
[12:27:11.903 loadConfig] Load config
[12:27:11.953 printResetReason] Software reset via esp_restart
[12:27:11.954 printWakeupReason] Wakeup by reset
[12:27:12.111 setWifiSTA] Wifi Station IP from DHCP
.[12:27:12.283 onWiFiEvent] WiFi Station connection to [DELETED], using hostname: ESP32_AdBlocker_882EFFA1DF7C
..[12:27:13.157 onWiFiEvent] Wifi Station IP, use 'http://192.168.1.113' to connect
[12:27:13.631 onWiFiEvent] Wifi AP stopped: ESP32_AdBlocker_882EFFA1DF7C
[12:27:13.631 onWiFiEvent] Wifi AP SSID: ESP32_AdBlocker_882EFFA1DF7C started, use 'http://192.168.4.1' to connect
[12:27:13.654 setupMdnsHost] mDNS service: http://ESP32_AdBlocker.local
[12:27:17.467 startWifi] Wifi stats for [DELETED] - signal strength: -24 dBm; Encryption: WPA2_PSK; channel: 2
[12:27:17.469 startPing] Started ping monitoring
[12:27:17.470 startWebServer] Starting web server on port: 80
[12:27:17.471 checkMemory] Free: heap 244456, block: 233460, pSRAM 8358131
[12:27:17.485 getLocalNTP] Using NTP server: pool.ntp.org
[12:27:17.486 showLocalTime] Got current time from NTP: 19/05/2024 12:27:17 with tz: GMT0
[12:27:17.686 resetWatchDog] WatchDog started using task: ping
[12:27:17.874 loadBlockList] Initial load of latest blocklist
[12:27:17.874 downloadFile] Downloading https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

[12:27:17.995 ERROR @ appSpecific.cpp:200] Connection failed with error: connection refused 
[12:27:17.996 doRestart] Controlled restart: Failed to complete blocklist download, retry ... 
[12:27:19.863 onWiFiEvent] WiFi Station disconnected
[12:27:19.864 onWiFiEvent] Wifi Station stopped [DELETED]
[12:27:19.864 onWiFiEvent] Wifi AP stopped: ESP32_AdBlocker_882EFFA1DF7C
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x420d6d5a
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbe4
load:0x403cc700,len:0x2a38
entry 0x403c98d4

uploaded v2.2

ESP32-S3, it seems to be working now, thank you.

[10:51:13.480 startWifi] Wifi stats for [DELETED] - signal strength: -17 dBm; Encryption: WPA2_PSK; channel: 2
[10:51:13.482 startPing] Started ping monitoring - On
[10:51:13.485 resetWatchDog] WatchDog started using task: ping
[10:51:13.486 getLocalNTP] Using NTP server: pool.ntp.org
[10:51:13.486 startWebServer] Starting web server on port: 80
[10:51:13.486 showLocalTime] Got current time from NTP: 21/08/2006 10:51:13 with tz: GMT0
[10:51:13.486 startWebServer] Remote server certificates not checked
[10:51:13.749 loadBlockList] Initial load of latest blocklist
[10:51:14.006 wgetFile] Downloading /data/common.js from /s60sc/ESP32_AdBlocker/main/data/common.js
[12:39:46.626 downloadBlockList] Downloading https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

[12:39:47.135 wgetFile] Downloaded /data/common.js, size 38524 bytes
[12:39:47.656 downloadBlockList] File size: 4018590 bytes
[12:39:47.656 downloadBlockList] 7.4MB memory available for download
[12:39:47.799 wgetFile] Downloading /data/AdBlocker.htm from /s60sc/ESP32_AdBlocker/main/data/AdBlocker.htm
0.8%
[12:39:48.277 wgetFile] Downloaded /data/AdBlocker.htm, size 16745 bytes
1.5%
2.2%

[DELETED]

17.0%
17.7%
[12:40:15.734 setAlarm] Alarm scheduled at 20/05/2024 04:00:00
[12:40:15.734 WARN loadBlockList] Ignore request as download in progress 
18.4%
19.2%

[DELETED]

99.1%
99.7%
[12:45:08.919 downloadBlockList] Download complete, processed 3.8MB in 321 secs
[12:45:08.920 downloadBlockList] Loaded 83715 blocked domains, using 7.4MB of 7.4MB 
[12:45:08.922 prepDNS] DNS Server started on 192.168.1.113:53
[12:45:09.023 checkMemory]  Free: heap 241092, block: 143348, min: 143520, pSRAM 24155
[12:45:09.024 loop] =============== Total tasks: 14 ===============

it seems to be working, although some of the ads are still there.
I have set the DNS server in the router settings - ip esp32 and port 53

image

as per readme, it wont work for ip6
Under Show Log, select Verbose to see what it is blocking and allowing