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

Bug when having multiple network interfaces (discovery) #9

Closed
pixeye33 opened this issue May 18, 2017 · 3 comments
Closed

Bug when having multiple network interfaces (discovery) #9

pixeye33 opened this issue May 18, 2017 · 3 comments

Comments

@pixeye33
Copy link

pixeye33 commented May 18, 2017

i feel kinda dumb but i'm not succeding to make it work...

(homeassistant) homeassistant@hassbian:~/.homeassistant/config $ mirobo discover
INFO:mirobo.vacuum:Sending discovery to <broadcast> with timeout of 5s..
INFO:mirobo.vacuum:Discovery done

Maybe i found a bug ?
My raspberry is wired, and i connect to it via SSH via cable.
If i a laptop on the robot's wifi and start a "mirobo discover" from the raspberry, i see no broadcast UDP packet. With the same laptop connected on my wired network i see the broadcasts. (of course my robot doesnt see the requests and doesnt give out the token)

My guess is that the discovery packet isnt using my wlan0 connection. maybe adding a interface parameter would be good ?

I think i've finally got the token (via : #5 (comment)) but when i try to use it i get :

mirobo --ip 10.11.0.78 --token 4D61447643524D63
ERROR:mirobo.vacuum:got error when receiving: timed out
Traceback (most recent call last):
  File "/srv/homeassistant/bin/mirobo", line 11, in <module>
    sys.exit(cli())
  File "/srv/homeassistant/lib/python3.4/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/srv/homeassistant/lib/python3.4/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/srv/homeassistant/lib/python3.4/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/srv/homeassistant/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/mirobo/cli.py", line 46, in cli
    ctx.invoke(status)
  File "/srv/homeassistant/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/mirobo/cli.py", line 59, in status
    res = vac.status()
  File "/srv/homeassistant/lib/python3.4/site-packages/mirobo/vacuum.py", line 150, in status
    return VacuumStatus(self.send("get_status")[0])
  File "/srv/homeassistant/lib/python3.4/site-packages/mirobo/vacuum.py", line 121, in send
    data, addr = s.recvfrom(1024)
socket.timeout: timed out

But if i use the ip of my laptop (on my home wifi, same as the one now used by the robot), i can see the packets sent by mirobot command line...

here is how i got the token :
rg_mfdo1xe_h9k5uibqenwsfjwcx44sgimqp4ieo2zpt_klo4qg7atj7bcc1neziilpq8wrkdu8vzbwcjjjypj3ye3_xqpt50sxz3g3_h3pxem5_flizzqtgterzkv1bbtgr9rbsn4r0xd6jtzsrxa69r-uru3pnnnoozzk6qztzys2i0c2srybvytxllpcyw_7dscwmyuvtfiznuq2r

or do i miss something ?

@rytilahti
Copy link
Owner

The token should be 32 characters wide, so the one you are using is too small. Anyway, it's on my todo to add a possibility to use the robot IP directly instead of broadcast, as that doesn't seem to work unproblematic on all systems.

How did you connect your wired raspberry to the wifi? If you didn't it's not a surprise it doesn't receive those packets :)

@pixeye33
Copy link
Author

pixeye33 commented May 19, 2017

Well #5 (comment) said last 16 characters... with 32 it works now !
Thanks for that :)

for the wifi, i did with wpa_cli, iwconfig says i'm connected, ifconfig says that wlan0 got an IP, and, i can ping the robot.
But maybe i have to do something on top of that ?

@rytilahti
Copy link
Owner

Glad to hear it, I created an issue to add an error message when the token seems invalid.

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

2 participants