Chromium wont load a page on localhost unless another network connection exists

95 views
Skip to first unread message

rack201

unread,
Nov 15, 2022, 7:07:15 PM11/15/22
to Chromium-discuss
Hope this is the right place to post..

My project is running some simple python code that outputs sensor values to a Node Red dashboard all running on the same Pi 4 in a vehicle. The Pi starts Node Red on localhost, starts the Python script and opens the dashboard URL (http://localhost:1880/ui) via Chromium in Kiosk mode on boot.

When the Pi is able to connect to WiFi (e.g. my home network) it all works fine. When the Pi doesn't have an internet connection (i.e. most of the time) the Chromium won't load the dashboard. I can't work this out as localhost should be available all the time and I have tried a delay before Chromium loads.

When this happens, if I open a hotspot on my phone that the Pi can connect to, Chromium then automatically connects to the dashboard and things work.

I can't see anything in dmesg or syslog that gives me any clues.. Any help would be great.

Julian Pastarmov

unread,
Nov 16, 2022, 5:15:31 AM11/16/22
to Chromium-discuss, rack201
You can start the developer tools in Chrome (F12) on the network tab and then load your site. I expect you will see some requests are made to the internet for loading resources like fonts or js or something else. If this is true you will need to modify your site to use locally cached versions of those resources. Make sure to clear the browser cache before you do that so that you don't end up with resources loaded from cache hiding true requests. Alternatively you can run Chrome with --log-net-log (see https://www.chromium.org/for-testers/providing-network-details/) to capture a log of all Chrome requests which might also give you a clue what else is possibly going on that needs network access at start-up time.

Cheers,
Julian

Jon Perryman

unread,
Nov 16, 2022, 1:15:47 PM11/16/22
to pasta...@google.com, Chromium-discuss, rack201
What does the browser screen display. I doubt that "won't load page" is the actual error you see? Are you getting 404 or site not responding? Does the browser simply remain empty? You may need to wait for the screen to display because of network delays caused by network not being connected.

You need to look at your web server logs. You may be having DNS delays. If you are using  a robust web server like Apache then you should easily see some sort of error. If you are using a minimalist web server like the one available as a python program, then you may need to dive deeper.

I suspect  that Chromium developer tools will simply show you the request sent but never a response.

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.
Reply all
Reply to author
Forward
0 new messages