amymcgovern / pyparrot

Python interface for Parrot Drones
MIT License
276 stars 129 forks source link

Having an issue with WifiConnection.py #209

Open Brammerz45 opened 4 years ago

Brammerz45 commented 4 years ago

I am using python 3.9 and I am new to pyparrot. When trying to connect to my Bebop 2 I come across the following error:

File "C:\Users\Michael\AppData\Local\Programs\Python\Python39\lib\site-packages\pyparrot\networking\wifiConnection.py", line 314, in _handshake self.drone_ip = ipaddress.IPv4Address(self.connection_info.address).exploded AttributeError: 'ServiceInfo' object has no attribute 'address'

The code bringing up the issue is image

I have looked up which attributes should replace self.connection_info.address and tried self.connection_info.addresses, self.connection_info.addresses_by_version(), self.connection_info.parsed_addresses() and each of those bring different errors.

Any help to resolving this issue would be great, thanks.

Ren3t commented 3 years ago

I have the same issue with Bebop 2...

Brammerz45 commented 3 years ago

For anyone else who gets this error, it is solved by reverting to an earlier version of zeroconf. This is done easily in pip via the command pip install zeroconf==0.20.0 Now I reverted to 0.20.0 and it worked instantly but I dont know what the most up to date version of zeroconf this will work with.

roverico commented 3 years ago

Hello, In my case we have solved this issue using this sentence against the Sphinx simulator (within a WMWare VirtualBox using WiFi dongle compatible Tp.link) self.bebop = Bebop(drone_type="Bebop2", ip_address="10.202.0.1") and self.bebop = Bebop(drone_type="Bebop2", ip_address="192.168.42.1") against the real bebop2 (using Administrator permissions and disconnecting any firewall/antivirus/spyware)

Cheers, roverico

jannacek commented 3 years ago

I solved the issue by downgrading to zeroconf version 0.20.0, but now I get a new problem:

ConnectionRefusedError: [Errno 61] Connection refused :(

any help please? :)

muelly2 commented 3 years ago

There was a change in zeroconf, where you have to change all instances of self.connection_info.address to self.connection_info.addresses[0] within wifiConnection.py

theodom commented 2 years ago

There was a change in zeroconf, where you have to change all instances of self.connection_info.address to self.connection_info.addresses[0] within wifiConnection.py

I did this exact thing, I changed all the lines that contains self.connection_info.address but it still gives me basically the same error: print (self.connection_info.addresses[0], self.connection_info.port) AttributeError: 'ServiceInfo' object has no attribute 'addresses' I have zeroconf on version 0.20.0.