larsjuhljensen / phatsniffer

Raspberry Pi + ESP8266 pHAT WiFi sniffer
MIT License
64 stars 15 forks source link

Documentation / Howto #1

Closed hugokoopmans closed 6 years ago

hugokoopmans commented 6 years ago

hi Lars,

Great project! I am trying to build one of these! Would you mind putting some short How To bulletpoints to the readme?

What OS did you put on the Pi Zero Rasbian? What steps did you take to build the hardware, any issues? What steps did you take to deploy the code on the Pi Zero How did you test the connection from the pi to the ESP etc etc

Really appreciate your project!

Hugo

larsjuhljensen commented 6 years ago

Don't have time to write documentation right now but:

1) I developed it on a Raspbian Jessie Lite installation. I have since upgraded it to Stretch. One small detail is that if you use a Pi 3 or Zero W, you need to swap the serial ports on which the built-in bluetooth adapter runs (see http://forums.pimoroni.com/t/wifi-sniffing-with-pi-zero-w-and-esp8266-phat/4476). You may need to install the Pimoroni software for the pHAT too; I've never tried without (https://learn.pimoroni.com/tutorial/hal13/getting-started-with-iot-phat).

2) No issue with respect to hardware. I simply installed an IoT pHAT on a Zero W with Pimoroni hammer headers.

3) To deploy the code to the pi you simply git clone the repository. To install the custom firmware on the ESP8266, you simply run the install.sh in the esp8266 directory.

4) The easiest way to test the connection is probably to execute phatsniffer.py; if it returns JSON data, everything should be working.

5) If you want to use the web interface, use apt-get to install flask and run server.py; the web interface should then be available on port 5000.

hugokoopmans commented 6 years ago

Hi Lars,

Great stuff thx Documentation is minimal but it works! 1) The new pimori pHAT installs and it fixes the bluetooth serial stuff so no need to manually adjust the boot/config.txt 2) flask is already installed it seems 3) install.sh worked OOTB i tested with some minicom commands 4) phatsniffer.py works 5) I do have a small issue with the server.py

pi@raspberrypi:~/phatsniffer $ ./server.py 
 * Running on http://0.0.0.0:5000/
192.168.178.20 - - [29/Aug/2017 15:49:38] "GET / HTTP/1.1" 500 -
192.168.178.20 - - [29/Aug/2017 15:49:38] "GET /favicon.ico HTTP/1.1" 404 -

closing this issue

saket424 commented 5 years ago

Here are the settings in boot/config.txt for a pi zero w that worked for me so that bluetooth and the esphat could work simultaneously. i.e., no need to disable bluetooth to use esphat. Hope it helps someone. Just add this to these 4 lines to the end of /boot/config.txt

enable_uart=1 dtoverlay=pi3-miniuart-bt core_freq=250

dtoverlay=pi3-disable-bt

refer to this blog post for more context https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/

https://www.raspberrypi.org/forums/viewtopic.php?t=211158

pi@pi0-hat1:~ $ ls -l /dev/serial* lrwxrwxrwx 1 root root 7 Sep 15 00:19 /dev/serial0 -> ttyAMA0 lrwxrwxrwx 1 root root 5 Sep 15 00:19 /dev/serial1 -> ttyS0 pi@pi0-hat1:~ $

With the above changes bluetooth uses serial1 and gpio pins14&15 uses serial0