motion-blinds icon indicating copy to clipboard operation
motion-blinds copied to clipboard

Access token error

Open WilliamCrockett opened this issue 3 years ago • 55 comments

Hi,

Last night my CMD-01 bridge lost power and restarted. This morning I noticed I have no control of my blinds from HA, and that the bridge was flashing green, which the manual says stands for "bridge firmware update".

When I started looking at the logs, etc, I noticed that there is an error with the heading AccessToken error. I will copy the full text below.

The integration has been working flawlessly until this happened. So I am wondering if my firmware of my CMD-01 did infact update and this has caused an issue? according to the Motion app, my firmware version is: A1.0.5_B0.1.6, there is also no update available for the firmware.

Obviously, this could be unrelated, but I am hoping someone could help guide me into solving this problem?

Many thanks

Error text:

Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220623124125219', 'data': {'operation': 0}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'msgID': '20220623144121537', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'

Additional info:

Logger: motionblinds.motion_blinds Source: /usr/local/lib/python3.9/site-packages/motionblinds/motion_blinds.py:504

WilliamCrockett avatar Jun 23 '22 12:06 WilliamCrockett

We are facing the same issue from multiple users. Will get the firmware versions.

rjulius23 avatar Jun 24 '22 07:06 rjulius23

Yep the same happened in our case with HomeAssisstatn.

Firmware version: A1.0.3_B0.1.2

I have checked with python interpreter and recieved the very same issue:

>>> for blind in m.device_list.values():
...   blind.Update()
...   print(blind)
...
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220624114813499', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220624134812705', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220624114818536', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220624134817724', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220624114823555', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220624134822842', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220624114828670', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220624134827879', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220624114833729', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220624134832980', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Timeout of 5.0 sec occurred on 5 attempts while waiting on multicast push from update request, communication between gateway and blind might be bad.
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/yabutech/.local/lib/python3.7/site-packages/motionblinds/motion_blinds.py", line 1241, in Update
    mcast_response = self._wait_on_mcast_report(mcast)
  File "/home/yabutech/.local/lib/python3.7/site-packages/motionblinds/motion_blinds.py", line 974, in _wait_on_mcast_report
    mcast_data, (ip, _) = mcast_socket.recvfrom(SOCKET_BUFSIZE)
socket.timeout: timed out

With that I think something has been changed with the new firmware.

Hardware: DD 7002 B bridge

bocsitomcsi avatar Jun 24 '22 11:06 bocsitomcsi

One more thing that maybe can help or maybe just bring more noise :D

We have two sites where we have identically the same DD 7002 B bridge with the very same firmware with the very same setup

#First System
<MotionGateway ip: 192.168.0.19, mac: 34ab958ddb9c, protocol: 0.9, firmware: A1.0.3_B0.1.2, N_devices: 11, status: Working, RSSI: -33 dBm>

#Second System (faulty)
<MotionGateway ip: 192.168.8.103, mac: 246f28444c1c, protocol: 0.9, firmware: A1.0.3_B0.1.2, N_devices: 15, status: Working, RSSI: -24 dBm>

I have used the very same version of motion blind python (0.6.4 and also tried with 0.6.8) version.

With the first bridge we have managed to gather the devices while with the second one it fails with the above issue. The biggest change that first one is running since 2-3 month without any restart while the second just powered up yesterday (2022-06-23).

I have realised that the token value is the very same for both of the system:

>>> print(m.token)
967DC7CD55376DA9

Can it be that this token is outdated or overtimed and that cause the issue?

bocsitomcsi avatar Jun 24 '22 12:06 bocsitomcsi

Last night my CMD-01 bridge lost power and restarted. This morning I noticed I have no control of my blinds from HA, and that the bridge was flashing green, which the manual says stands for "bridge firmware update".

This has happend to my CMD-01 bridge more than once. The only way to resolve it and get it working again is resetting the bridge and adding all blinds back. :-( Now the bridge is plugged into an UPS.

PRoomberg avatar Jun 24 '22 12:06 PRoomberg

Last night my CMD-01 bridge lost power and restarted. This morning I noticed I have no control of my blinds from HA, and that the bridge was flashing green, which the manual says stands for "bridge firmware update".

This has happend to my CMD-01 bridge more than once. The only way to resolve it and get it working again is resetting the bridge and adding all blinds back. :-(

Now the bridge is plugged into an UPS.

Thanks. I did that thinking it would resolve the issue, but unfortunately it did not... 😕

WilliamCrockett avatar Jun 24 '22 14:06 WilliamCrockett

I was on vacation, so red this only now. I do not have any problems on my own system, but I am using a CM-20 bridge instead of the mini.

@rjulius23 Do you work for a company manufacturing smart blinds? (since you said multiple users?)

@bocsitomcsi are you sure the key is the same for both systems?

This unfortunately seems to be a firmware issue, I will discuss it with the manufacturer.

I will also add an aditional check if the token might have changed (from the error response) but I guess that is not the case.

starkillerOG avatar Jun 28 '22 14:06 starkillerOG

I checked for two cases, my own and some one else. Verified the key, verified the token. Even checked the key/token combination with the procedure from the documentation. It all checkes out, but the bridge no longer accepts it.

Also worth noting, normally after resetting the bridge and adding the blinds again, they got their original mac back if you added them in the same order. Now after a reset the macs get numbered where it left off before, so the bridge isn't fully resetting everything. It definitely seems to be caused by the latest firmware.

So the weird thing is: the firmware works fine until you reset and pair again. If it is a token thing, then the bridge is sending outdated tokens.

And all the time the original Motion Blinds app is working like a charm, but I know that uses a different way to control the bridge.

EDelsman avatar Jun 28 '22 15:06 EDelsman

@starkillerOG I hope you had a great vacation and welcome back

The key is different but the token is the same, maybe it is device specific.

I did some further check based on this documentation: https://github.com/alexbacchin/ConnectorBridge

And what makes really hard to understand - at least for me - that I have managed to get information about the controller and even the devices type and numbers. But when I try to gather information about the devices like the above mentioned way I get the access token error. Based on my understanding for this sequence I would also need access token:

>>> from motionblinds import MotionGateway
>>> m = MotionGateway(ip = "192.168.8.103", key = "?????????")
>>> m.GetDeviceList()
{'246f28444c1c0001': <MotionBlind mac: 246f28444c1c0001, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0002': <MotionBlind mac: 246f28444c1c0002, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0003': <MotionBlind mac: 246f28444c1c0003, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0004': <MotionBlind mac: 246f28444c1c0004, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0005': <MotionBlind mac: 246f28444c1c0005, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0006': <MotionBlind mac: 246f28444c1c0006, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0007': <MotionBlind mac: 246f28444c1c0007, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0008': <MotionBlind mac: 246f28444c1c0008, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0009': <MotionBlind mac: 246f28444c1c0009, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000a': <MotionBlind mac: 246f28444c1c000a, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000b': <MotionBlind mac: 246f28444c1c000b, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000c': <MotionBlind mac: 246f28444c1c000c, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000d': <MotionBlind mac: 246f28444c1c000d, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000f': <MotionBlind mac: 246f28444c1c000f, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0010': <MotionBlind mac: 246f28444c1c0010, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>}
>>> m.Update()
>>> print(m.status)
Working
>>> print(m)
<MotionGateway ip: 192.168.8.103, mac: 246f28444c1c, protocol: 0.9, firmware: A1.0.3_B0.1.2, N_devices: 15, status: Working, RSSI: -24 dBm>
>>> for blind in m.device_list.values():
...   blind.Update()
...   print(blind)
...
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'XXXXX', 'msgID': '20220628201534884', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220628221533793', 'token': '???', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'XXXXXX', 'msgID': '20220628201539917', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220628221538933', 'token': '???', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': XXXXX', 'msgID': '20220628201545055', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220628221544032', 'token': '???', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'XXXXXXX', 'msgID': '20220628201550155', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220628221549153', 'token': '???', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'XXXXXXXXXX', 'msgID': '20220628201555276', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220628221554278', 'token': '???', 'actionResult': 'AccessToken error'}'
Timeout of 5.0 sec occurred on 5 attempts while waiting on multicast push from update request, communication between gateway and blind might be bad.
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/yabutech/.local/lib/python3.7/site-packages/motionblinds/motion_blinds.py", line 1225, in Update
    mcast_response = self._wait_on_mcast_report(mcast)
  File "/home/yabutech/.local/lib/python3.7/site-packages/motionblinds/motion_blinds.py", line 960, in _wait_on_mcast_report
    mcast_data, (ip, _) = mcast_socket.recvfrom(SOCKET_BUFSIZE)
socket.timeout: timed out

bocsitomcsi avatar Jun 28 '22 20:06 bocsitomcsi

Hi @starkillerOG , thanks for getting back to me here.

I have pip installed the package and attempted to run it locally and try debug the issue. So far no head way. But please let me know if there's anything I can provide you to help the debugging.

Many thanks William

WilliamCrockett avatar Jun 29 '22 06:06 WilliamCrockett

@bocsitomcsi The m.GetDeviceList() does not require and does not use the AccesToken, so that makes sense. The m.Update() actually does not require the AccesToken, however it is sent as part of the message, this is because in some firmware version there was a change in which the AccesToken was required all of a sudden for the m.Update(), then in a latter firmware version they reverted that behaviour after I told them and now it is again not required. However sending the AccesToken when not required is allowed and is backwards compatible with all versions of the firmware as far as I am aware.

blind.Update() does require the AccesToken so in that way it makes sense.

starkillerOG avatar Jun 29 '22 10:06 starkillerOG

@bocsitomcsi what version of motionblinds are you using? the accestoken en token schould have been obscured as xxxxx in the logs for the latest motionblinds versions (security risk). In general it is not a good idea to post accestokens publicly on the internet....

starkillerOG avatar Jun 29 '22 10:06 starkillerOG

I just released version 0.6.9 of the motionblinds library which add a check if the token has changed when a AccesToken error is received.

Could someone update using pip3 install --upgrade motionblinds and test the python script again to see if you get some Gateway token has changed from actionResult warning?

starkillerOG avatar Jun 29 '22 10:06 starkillerOG

Thanks for the clarification it makes sense, then the very first moment when we need really the accesstoken is the blind.Updates() part.

I have removed the accesstoken from the above comment thanks for highlighting it. I have not realised that it has been printed out. I have reverted back to 0.6.4 version, the one that is used by HomeAssisstant 2022.4.x as well.

I have updated to 0.6.8 version and recieved the same error:

>>> for blind in m.device_list.values():
...   blind.Update()
...   print(blind)
...
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629105754496', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629125753324', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629105759519', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629125758444', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629105804638', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629125803564', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629105809758', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629125808684', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629105818740', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629125817659', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Timeout of 5.0 sec occurred on 5 attempts while waiting on multicast push from update request, communication between gateway and blind might be bad.
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/yabutech/.local/lib/python3.7/site-packages/motionblinds/motion_blinds.py", line 1241, in Update
    mcast_response = self._wait_on_mcast_report(mcast)
  File "/home/yabutech/.local/lib/python3.7/site-packages/motionblinds/motion_blinds.py", line 974, in _wait_on_mcast_report
    mcast_data, (ip, _) = mcast_socket.recvfrom(SOCKET_BUFSIZE)
socket.timeout: timed out

bocsitomcsi avatar Jun 29 '22 10:06 bocsitomcsi

@starkillerOG yes I can confirm that I see the warning message

>>> for blind in m.device_list.values():
...   blind.Update()
...   print(blind)
...
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629110115256', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629130114131', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
**Gateway token has changed from actionResult.**
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629110120328', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629130119251', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629110125447', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629130124371', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629110130562', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629130129388', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629110135585', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629130134508', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Timeout of 5.0 sec occurred on 5 attempts while waiting on multicast push from update request, communication between gateway and blind might be bad.
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/yabutech/.local/lib/python3.7/site-packages/motionblinds/motion_blinds.py", line 1247, in Update
    mcast_response = self._wait_on_mcast_report(mcast)
  File "/home/yabutech/.local/lib/python3.7/site-packages/motionblinds/motion_blinds.py", line 980, in _wait_on_mcast_report
    mcast_data, (ip, _) = mcast_socket.recvfrom(SOCKET_BUFSIZE)
socket.timeout: timed out

bocsitomcsi avatar Jun 29 '22 11:06 bocsitomcsi

@starkillerOG I am getting it too with my CMD-01

WilliamCrockett avatar Jun 29 '22 11:06 WilliamCrockett

Alright that is really weared, could someone run the following python code and report all output (all warnings etc): Note that this script will print the token of your gateway, so beware if you do not want to share that you can mask them but check very carefully if the two tokens that are printed are exactly identicall or not and tell me that.

from motionblinds import MotionGateway
m = MotionGateway(ip = "192.168.1.IP", key = "?????????")
m.GetDeviceList()
m.Update()
blind_1 = list(m.device_list.values())[0]
print("token before blind update")
print(m.token)
blind_1.Update_trigger()
print("token after blind update")
print(m.token)
print("second update try")
blind_1.Update_trigger()

starkillerOG avatar Jun 29 '22 11:06 starkillerOG

Here's my output:

NOTE - in the second line I have removed some of the token and replaced it with X. If you need to full token let me know!

token before blind update
05066XXXXXD1CXXX
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629112432474', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'msgID': '20220629132421276', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Gateway token has changed from actionResult.
token after blind update
xxxxxxxxxxxxxxxx
second update try
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629112432489', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'msgID': '20220629132421291', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'

WilliamCrockett avatar Jun 29 '22 11:06 WilliamCrockett

>>> from motionblinds import MotionGateway
>>> m = MotionGateway(ip = "192.168.8.103", key = "53579a56-2127-45")
>>> m.GetDeviceList()
{'246f28444c1c0001': <MotionBlind mac: 246f28444c1c0001, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0002': <MotionBlind mac: 246f28444c1c0002, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0003': <MotionBlind mac: 246f28444c1c0003, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0004': <MotionBlind mac: 246f28444c1c0004, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0005': <MotionBlind mac: 246f28444c1c0005, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0006': <MotionBlind mac: 246f28444c1c0006, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0007': <MotionBlind mac: 246f28444c1c0007, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0008': <MotionBlind mac: 246f28444c1c0008, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0009': <MotionBlind mac: 246f28444c1c0009, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000a': <MotionBlind mac: 246f28444c1c000a, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000b': <MotionBlind mac: 246f28444c1c000b, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000c': <MotionBlind mac: 246f28444c1c000c, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000d': <MotionBlind mac: 246f28444c1c000d, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c000f': <MotionBlind mac: 246f28444c1c000f, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>, '246f28444c1c0010': <MotionBlind mac: 246f28444c1c0010, type: None, status: None, position: None %, angle: None, limit: None, battery: None, None %, None V, RSSI: None dBm, com: None>}
>>> m.Update()
>>> blind_1=list(m.device_list.values())[0]
>>> print("token before blind update")
token before blind update
>>> print(m.token)
967DC7CD5XXXXXXX
>>> blind_1.Update_trigger()
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629112506843', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629132505684', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
Gateway token has changed from actionResult.
>>> print("token after blind update")
token after blind update
>>> print(m.token)
xxxxxxxxxxxxxxxx
>>> print("second update try")
second update try
>>> blind_1.Update_trigger()
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629112535645', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '246f28444c1c0001', 'deviceType': '10000000', 'msgID': '20220629132534459', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'

bocsitomcsi avatar Jun 29 '22 11:06 bocsitomcsi

Alright found one bug: the log_hide function was altering the actual response. I just published 0.6.10, could you update again using pip3 install --upgrade motionblinds and run the above script again?

starkillerOG avatar Jun 29 '22 11:06 starkillerOG

here you go:

(I know I have masked the tokens. But I checked closely and they are identical

token before blind update
05066XXXXXD1CXXX
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629114222068', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'msgID': '20220629134213577', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'
token after blind update
05066XXXXXD1CXXX
second update try
Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629114225112', 'data': {'operation': 5}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'msgID': '20220629134213609', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'

WilliamCrockett avatar Jun 29 '22 11:06 WilliamCrockett

Thanks @WilliamCrockett that indeed confirms the token stays the same, so that is not the problem. It really looks like some internal firmware issue where it is not accepting the AccesToken while it is correct. Maybe somehow the internal key has changed withouth the app showing a diffrent key.

You have checked the key in the app right? that is still identical to the one you use for this python script right? The app is still able to control the blinds? (Move up and down)? Maybe move the blinds in the app and then check the key of the app again?

starkillerOG avatar Jun 29 '22 11:06 starkillerOG

We can also look if the gateway also refuses moving the blind: Note that this will move your first blind in the list to 60%

from motionblinds import MotionGateway
m = MotionGateway(ip = "192.168.1.IP", key = "?????????")
m.GetDeviceList()
m.Update()
blind_1 = list(m.device_list.values())[0]
blind_1.Set_position(60)

starkillerOG avatar Jun 29 '22 11:06 starkillerOG

@starkillerOG

yes, the key in the app is still the same and has not changed. So yes, maybe internal key has changed.

I wonder if I should try create a new account, and link the CMD-01 to that account, and re-link the blinds, and see what happens...

I have full control of the blinds through the app, and have been using the motion app to control my blinds for a few days now, the key hasn't changed.

I tried logging out and back in, and the key is still the same!

WilliamCrockett avatar Jun 29 '22 11:06 WilliamCrockett

We can also look if the gateway also refuses moving the blind: Note that this will move your first blind in the list to 60%

from motionblinds import MotionGateway
m = MotionGateway(ip = "192.168.1.IP", key = "?????????")
m.GetDeviceList()
m.Update()
blind_1 = list(m.device_list.values())[0]
blind_1.Set_position(60)

just ran this and received same error:

Received actionResult: 'AccessToken error', when sending message: '{'msgType': 'WriteDevice', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'AccessToken': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'msgID': '20220629115348643', 'data': {'targetPosition': 60}}', got response: '{'msgType': 'WriteDeviceAck', 'mac': '500291d0b4cd0001', 'deviceType': '10000000', 'msgID': '20220629135337042', 'token': 'xxxxxxxxxxxxxxxx', 'actionResult': 'AccessToken error'}'

WilliamCrockett avatar Jun 29 '22 11:06 WilliamCrockett

I just got off the phone with the manufacturer due to this very issue. They claim there is a bug in the hardware of the CMD-01 that cannot be resolved by a firmware update and they are sending me a new hub.

I read similar stories in both product reviews and tech forums and everyone who received a new hub say this seems to have fixed the issue.

EDIT: Once I receive the new hub I will tear it apart to check the internals to see if there is a difference though my gut says its mostly just a partition issue resulting in the EEPROM not working correctly.

NNMavy avatar Jun 29 '22 12:06 NNMavy

@ConnectorGit Do you know anything more about this "hardware bug"?

starkillerOG avatar Jun 29 '22 12:06 starkillerOG

Who can we contact about a replacement? And what details do they need? Would love to get rid of the reset and reconnect bug.

PRoomberg avatar Jun 29 '22 13:06 PRoomberg

I just paired my bridge to a whole new motion account, with a new key, and I get the same issue - AccessToken error.

edit - yes of course it's the same. Apologies

WilliamCrockett avatar Jun 29 '22 14:06 WilliamCrockett

I just paired my bridge to a whole new motion account, with a new key, and I get the same issue - AccessToken error.

edit - yes of course it's the same. Apologies

Hi William,

I'm part of the development team, it seems something went wrong with the bridge itself, could you please provide your APP account (no password required) and send 'Feedback' when your bridge is online (LED solid blue). I'd like to check the details of your hub to see what happened. It may help us figure out the root cause.

It may help to reset the bridge (long press 10 seconds) before pairing it again. Reset the bridge, pair it, add blinds to the bridge, and then link to HA.

heyryan29 avatar Jun 30 '22 06:06 heyryan29

I just paired my bridge to a whole new motion account, with a new key, and I get the same issue - AccessToken error. edit - yes of course it's the same. Apologies

Hi William,

I'm part of the development team, it seems something went wrong with the bridge itself, could you please provide your APP account (no password required) and send 'Feedback' when your bridge is online (LED solid blue). I'd like to check the details of your hub to see what happened. It may help us figure out the root cause.

It may help to reset the bridge (long press 10 seconds) before pairing it again. Reset the bridge, pair it, add blinds to the bridge, and then link to HA.

Hi @heyryan29

My account is william at sailing .co .za

I have just done a "failure report" within the app. My bridge is online and working.

I have tried a reset, ie I held down the button for longer than 10 seconds, but there was no real feedback on the hub to suggest anything had happened.

I will try do it again later. But in the mean time, there's the info.

Many thanks

WilliamCrockett avatar Jun 30 '22 07:06 WilliamCrockett