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

urlrelay seems to expire after a couple days - can we renew? #142

Open
mnopneal opened this issue Dec 21, 2022 · 7 comments
Open

urlrelay seems to expire after a couple days - can we renew? #142

mnopneal opened this issue Dec 21, 2022 · 7 comments

Comments

@mnopneal
Copy link

We are running a Jambox unattended at church, and loving it.

Although, after a couple of days, we cannot access it via URLrelay.com/go.

I brought it home, and verified that the box is alive, and IF I remember the old address, I can get to it with
http://192.168.1.235:6080/?..............

So, it's looking like urlrelay.com is clearing out registrations.

I guess I could force a reboot every day in Crontab, but is there something I could run instead to re-do the registration?

regards,

Neal

@kdoren
Copy link
Owner

kdoren commented Dec 24, 2022

@mnopneal
Where are you located and who is your internet service provider?

The urlrelay.com web service deletes stale registrations after 30 days, so the problem is not likely there.

urlrelay.com is like a mailbox that lets your raspberry pi pass its local url to your browser. Urlrelay.com matches them by their external IP address. To work, this requires that:

  1. the IP address that your raspberry pi used to register, and your browser have the same external IP address. This should be the case if your raspberry pi and your browser are behind the same router, and your external IP address has not changed since last registration.
  2. Your browser can't be using a VPN or other proxy. If that's the problem, though, it would flat-out never work.
  3. The local url of the rasperry pi (IP address) has not changed. This is quite unlikely, but I have seen routers change the raspberry pi IP address (buggy netgear orbi firmware). A workaround is to assign a static DHCP lease in your router, and/or update the router firmware.

My money is on #1, your external IP address is probably changing. You can check your browser IP address at https://whatismyip.com. If you see this change, that's you're problem.

The raspberry pi should register on boot, and every 24 hours after that. The script which does this is /usr/local/bin/urlrelay.sh. You can verify that it is running with "ps aux | grep urlrelay". Even if this script somehow broke, the registration will stay active for 30 days. But the registration will be wrong for as long as 24 hours if your IP address changes. You can make it register more frequently by changing the second-to-last line from "sleep 1d" to something short like "sleep 10m".

-Kevin

@mnopneal
Copy link
Author

Thanks for the reply. We are newly on AT&T fiber; the church is on Business Comcast. IP public addresses haven't changed for either one. I have turned off the reboot in crontab. I will make much more careful notes on this. I.E. get it to the point of urlrelay.com not providing an answer after a couple of days.

@kdoren
Copy link
Owner

kdoren commented Dec 25, 2022

@mnopneal whats your external ip?
I might be able to get more insight from the urlrelay database.

What exactly are you seeing when it fails? An error message from urlrelay?

There's always a chance that the problem is not with urlrelay, but that your pi, or vnc process, is crashing. One cross check is to see if you can ssh into the pi while it's in that state.

-Kevin

@mnopneal
Copy link
Author

mnopneal commented Dec 26, 2022 via email

@kdoren
Copy link
Owner

kdoren commented Dec 26, 2022

@mnopneal I think that what's happening is that you have 2 jamboxes behind the same router, and both have id=1.

urlrelay works "like magic" if you have a single box on your local network (same external IP as your browser). When you go to urlrelay.com/go, there is only one place to go, and you'll be redirected there.

What you apparently have is 2 boxes with default setting of id=1. In that case urlrelay.com will redirect you to the box which registered most recently. The boxes re-register every 24 hours, so if they are both powered on, you'll get redirected to one box for x hours, then the other box for 24-x hours.

If you have more than one box, you, and your boxes, need to specify the difference. This is done in the box (by setting a different NODE_ID ( i.e. set NODE_ID=2 on one of your boxes) in the file /etc/urlrelay/urlrelay.conf, then rebooting. After that you can get into either box by specifying its ID, like "urlrelay.com/go?id=2" (or id=1),

This is described here: https://github.com/kdoren/jambox-pi-gen#urlrelay

-Kevin

@mnopneal
Copy link
Author

Thanks. I'm a little skeptical, since we had these issues with the Jambox at church, with no other Jamboxen nearby, and mine is normally off, BUT in the spirit of eliminating possibilities, I have done as suggested. This time, I did the urlrelay.com/go, got normal response for .235, and Connect link worked fine. So, the 24 hours is from the anniversary of boot-up time?

@kdoren
Copy link
Owner

kdoren commented Dec 27, 2022

Yes, every 24 hours from boot up unless you've done something to change it.

You could be dealing with more than one problem. I.e. box crashes sometimes at church because hardware is flakey. You bring it home where another box has same id, and then things get really confusing.

Now that the id is fixed, you'll be in a position to see if there is an additional problem to debug

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

No branches or pull requests

2 participants