evilsocket / pwnagotchi

(⌐■_■) - Deep Reinforcement Learning instrumenting bettercap for WiFi pwning.
https://pwnagotchi.ai/
Other
7.8k stars 1.16k forks source link

Custom plugin doesn't find python libraries installed with pip #1168

Open ChopsKingsland opened 1 year ago

ChopsKingsland commented 1 year ago

I am trying to write a plugin for the Pimoroni LED shim, so I installed the library by:

  1. cloning Pimoroni library on Mac (as couldn't get internet sharing working)
  2. copy folder over SSH
  3. go into folder and install library with python3 -m pip install .

However, when I start the Pwnagotchi, I get the error error while loading /home/pi/custom_plugins/led_shim.py: No module named 'ledshim'. This is odd to me, as I can run the examples, and other code using the ledshim library just fine... is there anything I'm missing?

edit: I have also correctly set the custom plugin directory in my config

ChopsKingsland commented 1 year ago

I have somehow now got it to work (mainly by keep uninstalling and reinstalling the package), but am now faced with another issue: on_deauthentication and on_handshake don't work, with the errors: takes 3 positional arguments but 4 were given and takes 3 positional arguments but 5 were given respectively. the error for on_handshake also says File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/plugins/__init__.py", line 85, in locked_cb. I have looked at line 85 in __init__.py and there is nothing in there to do with on_handshake...

Because of this, I have put it down to my plugin, but my code only gives 3 positional arguments to both

def on_deauthentication(self, agent, access_point):
        logging.info("ledshim plugin on_deauthentication() called")

and

def on_handshake(self, agent, access_point):
        logging.info("ledshim plugin on_handshake() called")

edit: any ideas how to fix this?