diytechtinker / pwnagotchi_plugins

GNU General Public License v3.0
28 stars 1 forks source link

hcitool inquiring but no results #2

Closed jtmkrueger closed 1 year ago

jtmkrueger commented 1 year ago

Super cool plugin thanks for putting this together!

I'm not getting results from the plugin. I sniffed around in the source code and found the sudo hcitool inq --flush being run and parsed. I ran this and the only result is Inquiring.... I have a couple devices in discoverable mode I'm trying to test against, so not sure what I could have configured incorrectly. Went through your setup and triple-checked that I had things set right. I'm on an RP 0 W, and have the device bluetooth tethered to my phone so I know the bluetooth is functioning.

Any ideas to what I have set up wrong or am missing?

jtmkrueger commented 1 year ago

so... got things working on the bt side, but found an issue with the plugin. Here's what I had to do to get things working here:

# if self.devices[mac_address]['name'] == 'Unknown' or 'name' not in self.devices[mac_address]:
name = self.get_device_name(mac_address)
# if self.devices[mac_address]['manufacturer'] == 'Unknown' or 'manufacturer' not in self.devices[mac_address]:
manufacturer = self.get_device_manufacturer(mac_address)

Made that change on line 80. I suspect that if there's no self.devices[mac_address] it's causing problems. Maybe these two statements can be precluded with something like:

if mac_address in self.devices

because I think it's failing on a key error, but I'm not totally sure that's the correct answer. I have things going now after that, and there's json in my file! Let me know what you think. I'm pretty rusty with python.

diytechtinker commented 1 year ago

Thank you for this. I have tested this and you are right. Now I have fixed the code that it works.