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

Allow sending discovery packets to static IP address #5

Closed
FabioDeMiranda opened this issue Apr 14, 2017 · 22 comments
Closed

Allow sending discovery packets to static IP address #5

FabioDeMiranda opened this issue Apr 14, 2017 · 22 comments

Comments

@FabioDeMiranda
Copy link

FabioDeMiranda commented Apr 14, 2017

Hi there!

I reset the WIFI pressing the home and power buttons, after that I pressed the reset, but in both cases I'm getting the same message:

mirobo discover
INFO:mirobo.vacuum:Sending discovery packet to with timeout of 5s..
INFO:mirobo.vacuum:Discovery done

I'm using a Windows 10 machine with python 3.6.1 , I scanned with nmap the vacuum IP (192.168.8.1) and it seems the only ports open are 22 and 53... Am I missing something?

Thanx for creating this script and integrating with HA!

@rytilahti
Copy link
Owner

Hi, that's odd. Maybe the robot just wasn't responding to those discovery packets? Could you try it again multiple times, for some reason the vacuum does not always answer to those calls but I'm not sure what's the cause for it.

@FabioDeMiranda
Copy link
Author

I tried it from the raspberry PI I have HA and it's happening the same thing...

I can ping the vacuum and I tried to ssh, but I'm getting "ssh: connect to host 192.168.8.1 port 22: Connection timed out".

I didn't read the post you used to create the script or took a look at you code, so I don't know what I should expect.

What I can say is that I did upgrade the firmware the first time I used the app...

@rytilahti
Copy link
Owner

The vacuum doesn't accept incoming connections, port 54321 is the only way currently to communicate with them. You could try to see with wireshark if the device responds something to those discovery packets, other than that I can't really help without more information.

@FabioDeMiranda
Copy link
Author

I had to change s.sendto(helobytes, (addr, 54321)) to s.sendto(helobytes, ('192.168.8.1', 54321)) and get the response on wireshark, after that I could use the token with everything else... I'll try the HA integration now.

Thanx anyway!

@rytilahti
Copy link
Owner

Nice to hear you got it working, did you get it working with that on Windows or on Raspberry pi?

@FabioDeMiranda
Copy link
Author

After getting the token from wireshark it's working on both and on HA.

@pulse-mind
Copy link

pulse-mind commented Apr 28, 2017

Hi, I am trying to discover it but I have the same behavior :

INFO:mirobo.vacuum:Sending discovery packet to with timeout of 5s..
INFO:mirobo.vacuum:Discovery done

I am using windows 10 with pycharm, python 3.6 in a virtualenv.
I reset wifi on vacuum and I reset the vacuum. I connected my wifi laptop to the rockrobo-xxxx. Then under pycharm (virtualenv) I did the discover.

I tried many times. I tried to set the timeout to 20s but nothing better.

I can try something with wireshark but I am not confident with it.

@rytilahti
Copy link
Owner

This sounds like that is not working correctly on windows (10?), so I'll reopen this for now. Unfortunately I have no time to put into this, but maybe someone with a windows installation can help me out?

Another possibility would be to just "broadcast" the message to that static IP for now but I feel that's the wrong way to do it (although sofar this IP has been always used by this vacuum afaik).

@rytilahti rytilahti reopened this Apr 28, 2017
@rytilahti rytilahti changed the title mirobo discover Discovery not working on windows(?) Apr 28, 2017
@pulse-mind
Copy link

pulse-mind commented Apr 29, 2017 via email

@pulse-mind
Copy link

pulse-mind commented Apr 29, 2017 via email

@pulse-mind
Copy link

pulse-mind commented Apr 29, 2017 via email

@rytilahti
Copy link
Owner

rytilahti commented May 1, 2017

Great to hear that you got it working!

As the robot is always on that given IP, maybe it makes sense at least to allow using a static IP for the discovery, so let's keep this issue open.

@1043717432
Copy link

@pulse-mind @FabioDeMiranda The same problem, the use of windows10 under the following PIP3 virtualenv interface error. I have reset the vacuum, I would like to ask you how to solve it? Please tell me the order, thank you!
Error condition:
INFO:mirobo.vacuum:Sending discovery with timeout of to 5s..
WARNING:mirobo.vacuum:error while discover results: 22] Invalid [Errno reading argument

@pulse-mind
Copy link

I do not know how to do the discover with python and how to adapt this code.
But I explained another solution to get the token. Have a look in the previous messages.

@1043717432
Copy link

@pulse-mind
Thank you, I am sorry, I read the news or do not understand what the use of tools or applications to get the token, you can step in detail the steps?

@pulse-mind
Copy link

The tool here is great. It can does a discover = display the token. And then it can get the information of the vaccum and send commands. But to get the information and to send commands, you need the token. The token is used to encrypt and decrypt the command. Without the token it is "impossible" to communicate with the vacuum.
In my previous comments I explained how to do it with windows 10. I am using a software called "packet sender" to send packets to an IP (the IP of the vacuum after a reset).

@1043717432
Copy link

@pulse-mind Thank you. I'll try it when I get home! Thanks for reply!

@1043717432
Copy link

@pulse-mind * open packet sender (portable) * hex:21310020ffffffffffffffffffffffffffffffffffffffffffffffffffffff, port:54321, ip:192.168.8.1, protocol: UDP * send * in sixteen hexadecimal answer, the last 16 characters (not counting spaces).
Is this a step? Is to send hex:21310020ffffffffffffffffffffffffffffffffffffffffffffffffffffff???

@pulse-mind
Copy link

yes.
Be sure to switch your wifi connexion to the wifi of the robot not your usual wifi otherwise it won't work.
The robot will answer by providing its token in the answer

@1043717432
Copy link

@rytilahti Thank you!! The article said that yesterday to see over the notebook computer can install the Mi application can capture. I haven't tested it yet!

@1043717432
Copy link

@pulse-mind Thank you It has been successful!

@rytilahti rytilahti changed the title Discovery not working on windows(?) Allow sending discovery packets to static IP address Jun 4, 2017
@rytilahti
Copy link
Owner

Considering that the new discovery is done over mDNS, and that the "handshake" discovery is sent to the given IP when executing any commands, I think this can be closed now.

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

4 participants