robagar / tello-asyncio

A library for controlling and interacting with the Tello EDU drone using modern asynchronous Python.
GNU Lesser General Public License v2.1
29 stars 6 forks source link

Drone wait for wifi network broken for Mac OS #2

Closed jsolderitsch closed 3 years ago

jsolderitsch commented 3 years ago

This command:

        await drone.wifi_wait_for_network()

leads to an error on Mac OS (catalina at least):

python clockwise_360.py 
waiting for WiFi...
...wait for WiFi failed, error: /bin/sh: iwgetid: command not found

assuming WiFi network is connected and continuing

Anything that I can do other than removing this await command?

jsolderitsch commented 3 years ago

I tried the tello-asyncio project on a Raspberry Pi and all of examples I tried there (about 5 in all) worked as expected and the wait for network did not error out as with the Mac. I tried some of the newer API command examples too like motoron.

robagar commented 3 years ago

Yes, as noted in the docs it only works in Linux, but that is a cop out. I need to find Mac OS equivalent of iwgetid -r...

jsolderitsch commented 3 years ago

Sorry I missed it in the docs. I can close the issue if this can't be fixed. Maybe a stronger warning in the README? I guess the wait command can be deleted with the understanding that the user might not know why things fail.

jsolderitsch commented 3 years ago

So, I did not review the change log part of the documentation and the linux-only comment is written there for version 1.6.0.

So I think it best to close the issue.

robagar commented 3 years ago

If it's ok with you, I'll reopen this to remind me to make it work in Mac OS

robagar commented 3 years ago

PRs welcome of course ;)

jsolderitsch commented 3 years ago

If it's ok with you, I'll reopen this to remind me to make it work in Mac OS

OK with me. I looked a little for a Mac replacement for the missing iwgetid for Mac OS and did not locate anything.

robagar commented 3 years ago

Look like networksetup -getairportnetwork en1 will do the trick...

jsolderitsch commented 3 years ago

Looks like en0 may also be the the wireless interface:

jjsretina:examples jjs$ networksetup -getairportnetwork en1
en1 is not a Wi-Fi interface.
** Error: Error obtaining wireless information.
jjsretina:examples jjs$ networksetup -getairportnetwork en0
Current Wi-Fi Network: JamesElektra 5GHz