Jump to content

Need help installing a Python library for tcpdump post processing script on Pineapple Nano SD card


Recommended Posts

Hi All,

I’m working on a research project to capture all packets going through my Pineapple Nano, filter them for specific metadata, and send periodic data reports to an FTP site. I have the Pineapple configured to launch tcpdump to capture packets, then launch a Python script to filter/process the pcap data, and then write the output to a small data file and then FTP it to a site for analysis. However, I’m having trouble getting the Python library I need (DPKT) to install on the Pineapple.

I've tried using the PIP package manager to do the installation, but when trying to install PIP (via the get-pip.py script), it says one of the libraries (the Logging module)  can’t be found. So, the installation fails. 

Does anyone have any experience installing PIP on a Pineapple (to the external SD card), or any ideas on why this is happening, or what to try next?

I’m open to alternative methods to achieve the same goals, but I have the script working on an Ubuntu machine. So, I don’t understand why it’s not working on the Pineapple.



Link to comment
Share on other sites

OK. As I'm really hoping to get this work done soon, I've decided to offer $50 to the first person who can help me find a solution to this problem. There may also be more paid contract opportunities for helping with this project in the near future.

If there's a more appropriate forum, or a Pineapple Support channel where I should post issue, please let me know.



Link to comment
Share on other sites

Still working on this problem. I've switched to opkg installer, but am still having problems with it finding libraries.

Anybody have any other suggestions?

Is there a Python cross-compiler that might let me compile what I have working on my Ubuntu laptop, to run on the Pineapple Nano? If so, what settings would you recommend?

I'm still offering $50 to the most helpful tip in achieving this objective, and possibly more paid work on this type of project.



Link to comment
Share on other sites

This helped me getting pip to work on both of my Pineapples.
It assumes factory-settings, and that you have a working sd-card on the Pineapple.

opkg update
opkg remove python-*   (you need to run this line one more time, to completely remove everything)
opkg remove python
opkg --dest sd install python-pip
opkg remove python-pip  (The reason we install it, and then remove it is to install its dependencies)

Then clone this pip github repo. https://github.com/pypa/pip, and copy it to your sd-card. (/sd/pip/)

cd /sd/pip/
python setup.py install

This gets pip up and running on both my Pineapple.
When i install python-pip through opkg, it doesn't work. /sd/usr/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg contains only empty folders...
However, when installed manually, it works.
Just double-check that everything you install through pip gets installed to the correct place (sd-card / root), since the space on root is limited.

Regarding cross-compiling python-extensions and libraries, try to see if you can find something useful here:

Link to comment
Share on other sites

  • 1 year later...


It is indeed true that the loggings module isn't installed in the light version of python that came with the wifi-pineapple. You can easily install the full version of python though by 'opkg install python' or just the required loggings module: 'opkg install python-logging'. Then you use the get-pip.py file to install pip. This worked for me.

Hopefully this will be helpful to others. 


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...