-
Notifications
You must be signed in to change notification settings - Fork 5
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
Answer = 401 (Unauthorized) #13
Comments
Hello, for response B, as I can remember, for remote request, you need to add a prefix (cmd_prefix = "\x02") just before the method (GET in your case). So something like this : ws.send("\x02GET /info ...") |
Look at my fork : https://github.com/SigmaPic/python_tydom |
Thanks for your answers. for B, it's not possible to use simple Javascript for Websockets if ssl is used => Node.JS is needed. for A, SigmaPic, I've tried yesterday your code https://github.com/SigmaPic/python_tydom and it's working well so it was not a security protection with Debian 11 (bullseye) or python 3.9.6 So Thanks a lot for your 2 jobs ! My Tydom is now under control. |
Hi, thank you SigmaPic, cth35 and zian31 ! @zian31: you said you add the PUT functions to SigmaPic code, is it possible to share your modifications ? Thank you very much ! |
@MichelRabozee yes, of course, you have to add this code to tydom.py :
And :
And then (example of UP, wait 2s, STOP) :
You will find ID with :
With that I can open and close my shutters...
{'name': 'position', 'validity': 'upToDate', 'value': 0} => Volet en haut (butée atteinte) |
@zian31 , thank you very much ! |
Hello, I was happy too soon, even with SigmaPic's code, I end up with error 401 :-(
Here is the test code I use (xxxxx is my password): #!/usr/bin/env python3
from tydom import Tydom
import asyncio
def callback(uri, data):
print(uri, data)
async def demo():
# create tydom instance
tydom = Tydom("001A25068836", "xxxxx", host='192.168.1.30', request_handler=callback)
# connect to tydom
await tydom.connect(keep_alive_delay=None)
# get data
while True:
data = await tydom.get_info()
print(data)
await asyncio.sleep(5)
asyncio.get_event_loop().run_until_complete(demo()) What do I do wrong ? |
Maybe a bad password : |
Thank you, I use an iPhone, but I have an Android only for these kind of tricks \o/ I installed V3 ( https://tydom.fr.aptoide.com/app?store_name=aptoide-web&app_id=58618221 ) and reset the password of the box itself !!! |
Hi.
I've tried to use the "largotef" fork (without the MQTT part) of this program with :
Raspberry with latest Raspberry Pi OS with desktop
Release date: May 3rd 2023
System: 32-bit
Kernel version: 6.1
Debian version: 11 (bullseye)
Tydom 1.0
I achieved to configure Tydom 1.0 password with an android Tydom APK V3
Python version is 3.9.6
My test is :
python main.py
The result is always 401 (Unauthorized) :
I've seen on domotics forums (jeedom...) that people have now exactly the same result 401 (Unauthorized) using this program.
But if I use a simple HTML5 websocket code on Chrome (on the Raspberry or on a PC Windows), the websocket connection is working well (but the sending message is not working : disconnection just after) :
index.html :
So here are my 2 questions :
A. Do you think the 401 answer with your software is due to a new security protection with Debian 11 (bullseye) or python 3.9.6 ?
B. With my little index.html, do you know the right data format in ws.send(data) to send a simple tydom "GET /info" ?
Thanks !
The text was updated successfully, but these errors were encountered: