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

Error with Sonoff Micro firmware 3.6.0 #320

Closed
dwf opened this issue Dec 21, 2020 · 2 comments
Closed

Error with Sonoff Micro firmware 3.6.0 #320

dwf opened this issue Dec 21, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@dwf
Copy link

dwf commented Dec 21, 2020

Hi,

Trying to use the custom component with a newly bought Sonoff Micro I was having an issue where None was being returned by decrypt(), and thus JSON decode was failing. I removed the exception handler from decrypt and got to the root of the issue:

2020-12-21 23:35:34 ERROR (Sonoff_LAN) [root] Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1750, in run
self._service_state_changed.fire(
File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1508, in fire
h(**kwargs)
File "/config/custom_components/sonoff/sonoff_local.py", line 183, in _zeroconf_handler
data = decrypt(properties, devicekey)
File "/config/custom_components/sonoff/sonoff_local.py", line 71, in decrypt
ciphertext = b64decode(encoded)
File "/usr/local/lib/python3.8/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Invalid base64-encoded string: number of data characters (741) cannot be 1 more than a multiple of 4
@dwf
Copy link
Author

dwf commented Dec 22, 2020

I've isolated the bug (ignoring data4 in decrypt). I will send a PR tonight.

@AlexxIT AlexxIT added the bug Something isn't working label Jan 31, 2021
@AlexxIT
Copy link
Owner

AlexxIT commented Mar 10, 2021

Fixed in latest release

@AlexxIT AlexxIT closed this as completed Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants