Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tries to solve the issue with zeroconf #129

Closed
wants to merge 1 commit into from
Closed

Conversation

pepelisu
Copy link
Contributor

@pepelisu pepelisu commented Sep 7, 2020

using here hostnam+".local" does not work all the time
The loop while is not protected against permanently being stuck, without time.sleep(), resources could go to 100% in cpu and maybe block the rpi.

using here hostnam+".local" does not work all the time
The loop while is not protected against permanently being stuck, without time.sleep(), resources could go to 100% in cpu and maybe block the rpi.
@ggilestro
Copy link
Member

I am a bit concerned about that while loop. If the ethoscope reboots in an environment that is without a network what is going to happen? Tracking will not resume until an IP address is detected, right? Can you check before I merge this? Perhaps it gets out of the loop immediately returning 127.0.0.1 ?

@pepelisu
Copy link
Contributor Author

pepelisu commented Sep 7, 2020

I thought that it was exactly what was happening until now if not internet or IP assigned. The loop should have a failsave, for example if no IP after 1 or 2 minutes then return with 127.0.0.1.

In my case now, if I disconnect from the network it keeps giving me the last IP (maybe until the lease ends), In a virtual machine I am getting 127.0.0.1 after disconnecting the adapter.

@pepelisu
Copy link
Contributor Author

pepelisu commented Sep 7, 2020

Also I have another issue, because zeroconf is registered with an IP address. It happens that when an ethoscopes losses internet and dhcp server gives another IP after reconnecting, then the service is wrong registered and it does not update on the node. The ethoscope appears again offline (when in fact is online and tracking, but under other ip address)

Ethoscope backup needs to be restarted or it will not pick up the changes. I think the next step here is to redesign the network based on separate services from tracking, like you said, and make a more robust zeroconf implementation.

ggilestro added a commit that referenced this pull request Sep 7, 2020
@ggilestro
Copy link
Member

Yes - of course. The while loop is my fault :)
I've included your changes in this commit: 4e8e2c2

There is also a failsafe mechanism that leaves the loop after about a minute.

@ggilestro ggilestro closed this Sep 7, 2020
@ggilestro ggilestro deleted the zeroconf-patch branch September 7, 2020 15:58
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.

2 participants