hepcat72 / node-red-contrib-life360

GNU General Public License v3.0
3 stars 4 forks source link

Life360 server error getting circles: 502 #15

Closed rik1984 closed 1 year ago

rik1984 commented 1 year ago

The configuration of the Life360 node works fine. And the status Home is shown after the first startup. And also the Circle name in Life360 is recognized in the node configuration. But after this first connection it is stuck in 'Checking location '

Schermafbeelding 2023-03-02 155320

When checking the node-red-log on the RPI terminal I see the following error messages: [error] [Life360-Server:089825475f3e9411] Life360 server error getting circles: 502 Error: Request failed with status code 502

Schermafbeelding 2023-03-02 154733

I've tried:

Any idea on how to fix this?

hepcat72 commented 1 year ago

My first guess suggestion is to reboot your router. The problem is the timeout.

Do you have any custom firewall rules or throttling on your network? Or... and I'm not sure about this... I don't know if the underlying Life360 protocol is establishing a connection on 1 port and then communicating on another. So you could investigate what ports are being used.

rik1984 commented 1 year ago

Thanks for thinking along. The router reboot doesn't work and I don't have specific firewalls in place, just the normal one of my internet router

Is there an API call I could try out through NodeRED to find out whether Life360 responds?

hepcat72 commented 1 year ago

It's been years since I've played with the api manually, so I don't recall any of the calls offhand, but I do remember using curl to see the responses to various calls. You can look through the calls in the code here. I didn't write the original interface. I just forked an abandoned project, so your exploration of the calls would be about as adept as mine.

I question though whether it's responding at all. Your initial successful status might be a default, but that's just a wild guess, so I think trying to make the API calls manually using curl is a good sanity check. I may have some notes on having done it in the past, so if you can't figure it out in short order by looking at the code, let me know and I'll see if I can dig them up.

hepcat72 commented 1 year ago

The api calls are in index.js.

rik1984 commented 1 year ago

Thanks for your suggestions, it was my fault and the issue has been solved. Apparently this node always gives the yellow status, also when it is functioning (and I didn't see it working as I was always at another location and not at my computer to see the debugging messages when it appeared ;))