chrisz / pyhusmow

Control your Husqvarna automower
GNU General Public License v3.0
59 stars 29 forks source link

401 Client Error: Unauthorized for url: https://amc-api.dss.husqvarnagroup.net/v1/mowers #21

Closed detlefpoth closed 6 years ago

detlefpoth commented 6 years ago

The grass is growing and wants to get cut again ;-) But after the winter pause my pyhusmow does not work any more.
Finally I got the new token which is still valid until May 2nd. The pyhusmow http server starts and confirms : logger configured. But any browser command e.g. http://ipaddress:port/start on the defined ip and port gets the following response:

Try to execute /start 401 Client Error: Unauthorized for url: https://amc-api.dss.husqvarnagroup.net/v1/mowers [ERROR] Retrying to send the command 2 Done 401 Client Error: Unauthorized for url: https://amc-api.dss.husqvarnagroup.net/v1/mowers [ERROR] Retrying to send the command 1 Done [ERROR] Failed to send the command 192.168.46.81 - - [01/May/2018 15:17:02] "GET /start HTTP/1.1" 500 - Done

The password in the automaker.cfg is correct as the http server seems to be able to login. The iOS APP using the same credentials works fine.

My husqvarna 310 does not like to be steered by the iPhone App as it is sending him out no matter what the weather conditions are. ;-)

Any ideas highly appreciated Thanks Detlef

simlu commented 6 years ago

Any progress in resolving this yet?

Have you tried using curl to see if you can get any other endpoints to respond? Even though the endpoint indicates auth error it might just been moved / changed?

I haven't looked into the code, but can you find out what request method is used?

If you iPhone is jailbroken you should be able to see what requests are being made by monitor requests of the app (have only done it on android though)

detlefpoth commented 6 years ago

Hi Chris -

Thanks for asking. I tried it today again and got a new token while executing your pyhusmow server on OSX. All my installations under WIN10 did not manage to download a new token. So I copied the new token from my Mac to the WIN10 systems.

This worked. :-)

Am 14.05.2018| KW20 um 17:10 schrieb simlu notifications@github.com:

Any progress in resolving this yet?

Have you tried using curl to see if you can get any other endpoints to respond? Even though the endpoint indicates auth error it might just been moved / changed?

I haven't looked into the code, but can you find out what request method is used?

If you iPhone is jailbroken you should be able to see what requests are being made by monitor requests of the app (have only done it on android though)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chrisz/pyhusmow/issues/21#issuecomment-388852268, or mute the thread https://github.com/notifications/unsubscribe-auth/AempwyeNE3ddtNgu5x6lZNHIRim_7xWiks5tyZ5LgaJpZM4Tt8AV.

simlu commented 6 years ago

Hi Detlef. Great you worked it out! This is Lukas though, not Chris - I'm not the creator of this project.

Important: I would recommend that you remove your personal information from your post as it is publicly exposed! Unless you enjoy spam email / phone calls :)

Feel free to close this ticket and open a new one if you have further problems! L~

chrisz commented 6 years ago

Hi @detlefpoth,

If you have the problem only on win10, maybe there is an issue specific to this os. I have no win10 to test.

I just tried to start the server with or without the token.cfg and all seems to be ok. If there is no token.cfg or if the token is expired, a new token is retrieved.

Chris

detlefpoth commented 6 years ago

Hi Chris -

Thx for your feedback! I will x-check how the next token update eof May will work out on my WIN10 and get back to you in case of an reoccurring retrieval issue.

Thx. & best Detlef