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

The hex data is the same every time? #1

Open
biogerm opened this issue Apr 9, 2017 · 5 comments
Open

The hex data is the same every time? #1

biogerm opened this issue Apr 9, 2017 · 5 comments

Comments

@biogerm
Copy link

biogerm commented Apr 9, 2017

Hi,

I have been trying to reproduce the procedure you have suggested on my Mi power outlet. I don't own a vacuum robot, so what I found from the power outlet are:

  1. the hex payload is different every time...
  2. most of time the packet is sent from a server outside my LAN...
  3. packages are even not with equal size
  4. payload sent from my phone directly to the device is bigger than the package from cloud

Does the vacuum robot's package appear in the same way? Can you please describe a little about the package you captured? Maybe it can give me a little help to find out a way to home bridge the outlets. Thanks!

BR
Ryan

@tobiaslins
Copy link
Owner

Hi,

The hex payload is the same every time (at least for the vacuum)
Be sure that you just selected the "Data" field within Wireshark.
If you don't select it, the payload will be different every time!
https://github.com/jghaanstra/com.robot.xiaomi-mi/raw/master/assets/readme/wireshark_data.png?raw=true

@biogerm
Copy link
Author

biogerm commented Apr 9, 2017

Sure it's the data. I guess the vacuum is implemented differently than the power plug then... For me it's more like it's encrypted by an algorithm.

@aholstenson
Copy link

The actual data sent over the network uses encryption based on a token associated with a device. For the Mi Robot Vacuum the token can only be fetched before it is configured to with the correct WiFi settings.

If you are interested in the structure of the packets I found this documentation to be good: https://github.com/OpenMiHome/mihome-binary-protocol

I've been working on adding support for the Mi Robot Vacuum in my miio library (not a Homebridge plugin) and as long as you have the right token communicating with the vacuum should be quite easy. The same is true for many other types of Mi Home devices.

@biogerm
Copy link
Author

biogerm commented Apr 18, 2017

@aholstenson your repo seems very well documented :) what is it used for? Controlling Mi devices from browser? btw where can you buy Mi devices in Sweden? (where i am living too)

@aholstenson
Copy link

The library is just an easy to use API for as many devices as I can support. There is no actual control interface, but it could be used for example in this library to control the vacuum, or to build a web interface.

I usually buy my devices from Aliexpress, it takes a few weeks for stuff to get to Sweden but it works.

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

No branches or pull requests

3 participants