bodaay / GoOpenDrop

a Go Implementation and Enhancement of the Awesome Open Source AirDrop implementation work of seemoo-lab: https://github.com/seemoo-lab/opendrop
GNU General Public License v3.0
90 stars 10 forks source link

Stuck on "Waiting for AWDL Interface (awdl0) to Start" #4

Closed IronBit-0 closed 2 years ago

IronBit-0 commented 2 years ago

On a desktop computer, Software: Ubuntu 22.04.1 LTS Go version: "go version go1.18.1 linux/amd64" Hardware device is a Ralink Technology, Corp. MT7601U Wireless Adapter.

Ran sudo iw phy phy1 interface add mon0 type monitor sudo ifconfig mon0 up

iw dev shows that mon0 exists

phy#1
    Interface mon0
        ifindex 5
        wdev 0x100000002
        addr e8:4e:06:99:0f:43
        type monitor
        txpower 20.00 dBm

Running sudo ./goopendrop ./config.json in out/amd64 returns

INFO[0000] Config File: ./config.json                   
INFO[0000] Using Wifi Interface: mon0                   
WARN[0000] Waiting for AWDL Interface (awdl0) to Start

and it does not change from that.

Thanks for the support

IronBit-0 commented 2 years ago

On raspberry pi zero w 1.1, I found a method.

Installing OWL seperately, then running sudo owl -i mon0 -N and leaving it running, then running sudo ./goopendrop ./config.json in a separate terminal/ssh window works.

I installed OWL following the instructions from owlink.org.

However, running sudo owl -i mon0 -N only works once, because every subsequent time you run it, it returns:

ERROR: pcap: unable to activate device mon0 (That device is not up)
ERROR: Could not open device: mon0
ERROR: tun: unable to set HW address
ERROR: Could not open device: awdl0
ERROR: could not initialize core

Running sudo ifconfig mon0 up doesn't help, as that returns:

SIOCSIFFLAGS: No space left on device

The only fix I have found is to run sudo reboot.

:/

IronBit-0 commented 2 years ago

I've hit another roadblock on Raspbian Lite 32 on Raspberry Pi 0 w 1.1.

I run sudo owl -i mon0 -N in one terminal, and it returns:

INFO : WLAN device: mon0 (addr e8:4e:6:99:f:43)
INFO : Host device: awdl0

I run sudo ./goopendrop ./config.json in another terminal. It returns:

INFO[0000] Config File: ./config.json
INFO[0000] Using Wifi Interface: mon0
WARN[0000] Waiting for AWDL Interface (awdl0) to Start

The terminal running OWL then returns:

Terminated

The window running goopendrop then returns:

INFO[0000] Config File: ./config.json
INFO[0000] Using Wifi Interface: mon0
WARN[0000] Waiting for AWDL Interface (awdl0) to Start
ERRO[0005] owl Interface not running: awdl0
panic: owl Interface not running: awdl0

goroutine 1 [running]:
main.initAllRequired(0x2c71710, 0x2e68be0, 0x2e4e8c0, 0x2e4e940)
        /home/pi/GoOpenDrop/init.go:142 +0x6b8
main.main()
        /home/pi/GoOpenDrop/main.go:32 +0xe0

If I don't run OWL in another terminal at all, only running goopendrop, I get stuck on:

INFO[0000] Config File: ./config.json
INFO[0000] Using Wifi Interface: mon0
WARN[0000] Waiting for AWDL Interface (awdl0) to Start

and I can't start OWL after I start goopendrop, because it always returns this:

ERROR: pcap: unable to activate device mon0 (That device is not up)
ERROR: Could not open device: mon0
ERROR: tun: unable to set HW address
ERROR: Could not open device: awdl0
ERROR: could not initialize core

until I restart the pi completely.

I'm not actually certain if I'm supposed to run OWL separately, I'm just testing things out.

IronBit-0 commented 2 years ago

Found the issue, fixed in #5. As it turns out OWL was getting terminated because goopendrop does that before it starts it's own OWL. When goopendrop tried to start OWL, it wasn't doing it with permissions, so adding sudo to owl.go worked for me. I have no idea what the problem with SIOCSIFFLAGS: No space left on device and not being able to start OWL was about, but it doesn't happen anymore.

bodaay commented 2 years ago

if you are using MT7601U chipset, you don't need to add "-n" to your owl command, since your adapter already support active monitoring mode. and you are right about owl, GoOpenDrop is killing any process that has the name of owl while starting its basically doing the following: kill any process that has owl in it disable the wifi adapter run owl

based on my testing, you never need to add mon0 interface. owl will take care of that, it will change the adapter to monitor mode

you can as well complely remove GoOpenDrop starting owl by just commenting this line in init.go

//Run Owl Interface
//  go owl.StartOwlInterface(config.OwlWlanDeviceName, config.OwlChannel, config.AWDLInterfaceName, log)

this will prevent GoOpenDrop from killing running owl, and it will just wait for "awdl0" interface to be ready

IronBit-0 commented 2 years ago

If my pull request #5 makes sense, could you merge it?

bodaay commented 1 year ago

I'l replied back to pull request

I would appreciate if you could give us your feedback on PI zero, and if the whole thing is working for you

Thank you

IronBit-0 commented 1 year ago

It's not working for me yet. I'm getting the INFO[0033] Airdrop Beacons Received from address=xx:xx:xx:xx:xx:xx, with rssi=xx. I have a folder of the name of my iPhone in OUTBOX with a png picture in it. I have not gotten my phone to detect the Pi's Airdrop receive. I have not gotten the Pi to send any files to my phone. This is probably because I'm using self-generated keys instead of apple keys. I'll update you when I've got genuine apple keys to use and test for.