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

MI_ESP32: add lights, yeerc, decryption and more #8892

Merged
merged 1 commit into from
Jul 12, 2020

Conversation

Staars
Copy link
Contributor

@Staars Staars commented Jul 12, 2020

Description:

This is quite a big update with some notable changes:
-adding generic decryption using mbedtls, as this is built-in for the ESP32
-adding NLIGHT,MJYD2S and YEERC
-adding a custom scan interval and window, which (in my internal tests) capture a ton more packets
-a lot of internal refactoring

I'll add more info in the comments.

Checklist:

  • The pull request is done against the latest dev branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR.
  • The code change is tested and works on core ESP8266 V.2.7.2
  • The code change is tested and works on core ESP32 V.1.12.2
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@arendst arendst merged commit 763c8b6 into arendst:development Jul 12, 2020
@Staars
Copy link
Contributor Author

Staars commented Jul 12, 2020

For the moment there is a compile flag in the driver:
#define USE_MI_DECRYPTION

This means for the LYWSD03MMC that a bind_key is required to read the data from advertisements. With this (default) option there will be no automatic connection to the sensor as before.

New devices added like in the recent release of the NRF24-driver (NLIGHT, MJYD2S and YEE-RC).

New command:
MI32Key expects a 44 characters long string (key+MAC) in capitals. Same principle as in the NRF24-driver. No special "light"-command needed as the ESP32 is a real Bluetooth-chip and can read a whole packet to get the needed info automatically.

After testing many different settings via trial and error, the scan interval and window setting shows much improved functionality in internal testing. I.E. the NLIGHT was totally invisible before.

This is all still W.I.P., please expect glitches.

@G1K
Copy link

G1K commented Mar 21, 2021

@Staars I apologize for writing in PR, but maybe you can tell me where to look. on ESP32, the YEERC remote catches packets, but cannot decrypt them.
I tried to find the information for a very long time, but I couldn't find where to get the bindKey / beacon_key. The PR for NRF seems to indicate that it should be determined automatically

17:41:46.543 M32: Payload encrypted but no key
17:41:46.796 M32: Payload encrypted but no key
17:41:46.811 M32: Payload encrypted but no key
17:41:46.834 MQT: stat/tasmota_8959E4/SENSOR = {"Time":"2021-03-21T17:41:46","YEERCe0c3fa":{"mac":"f82441e0c3fa","Pair":1,"RSSI":-59}}
17:41:46.940 M32: Payload encrypted but no key
17:41:47.531 MQT: stat/tasmota_8959E4/SENSOR = {"Time":"2021-03-21T17:41:47","YEERCe0c3fa":{"mac":"f82441e0c3fa","Pair":1,"RSSI":-59}}
17:41:47.631 M32: Payload encrypted but no key

The link with no key leads to the page for thermometers, and it fails to connect to the remote control even if you press OFF + M to get the bindKey

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants