Skip to content

make get_local_ip work offline and on hotspots - #22

Open
wddler wants to merge 1 commit into
SpesRobotics:mainfrom
wddler:fix-offline-ip
Open

make get_local_ip work offline and on hotspots#22
wddler wants to merge 1 commit into
SpesRobotics:mainfrom
wddler:fix-offline-ip

Conversation

@wddler

@wddler wddler commented Jul 27, 2026

Copy link
Copy Markdown

Hi,
Thanks for releasing this great project.
This requests fixes the issue of the original socket lookup to 8.8.8.8 failing in offline environments (I discovered it while running the project on a machine with a hotspot). Which resulted in

The phone web app should be available at https://Error: [Errno 101] Network is unreachable:4443

Please find the extended get_local_ip function in teleop/__init__.py where:

  1. It attempts the standard 8.8.8.8 socket connection method if there is internet access.
  2. If that fails, it falls back to parsing the Linux hostname -I command to fetch the local IP offline or while acting as a hotspot.
  3. If both fail, it returns "127.0.0.1".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant