Skip to content

Pi.Alert failing to get internet IP when IPv6 is used #12

@roberthawdon

Description

@roberthawdon

When running python ~/pialert/back/pialert.py internet_IP I get the following output:

Pi.Alert 2.52 (2021-01-11)
---------------------------------------------------------
Check Internet IP
    Timestamp: 2021-01-13 05:53:00

Retrieving Internet IP...
    Error retrieving Internet IP
    Exiting...

After examining the code, it appears that Pi.Alert has no way of handling an IPv6 response from opendns. I also couldn't find a way to make opendns respond with my IPv4 address, so to workaround the issue for now, I changed the lookup service to ipv4.icanhazip.com by changing line 160 in pialert.py to read:

curl_args = ['curl', '-s', 'http://ipv4.icanhazip.com']

Will Pi.Alert be updated to check both IPv4 and IPv6 addresses?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixedBug fixed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions