larsjuhljensen / phatsniffer

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

Deploy ESP code on a laptop connected WEMOS D1 R2 #3

Open hugokoopmans opened 6 years ago

hugokoopmans commented 6 years ago

Hi ,

I have a wemos D1 R2 laying around here, I was wondering if i could use that to deploy the ESP code on it and thinker with it...

The ESP chip is exactly the same it seems after visual inspection.

With Arduino IDE 1.6.12 I cannot upload the jsonsniffer.ino sketch to the wemos board.... Do i need Arduino 1.8+ to use this sketch? or does this sketch use pimori pHat specific stuff?

Would be nice to run the code also on my laptop directly, did you manage to do that?

hugo

larsjuhljensen commented 6 years ago

There is nothing Pimoroni-specific about the code. I compiled it in Arduino 1.8.2 as "Generic ESP8266" code. Are you able to deploy other sketches to your Wemos?

The Python code would require changes to make it run directly on your computer. Firstly phatsniffer.py uses the RPi.GPIO module to communicate with the pHAT. This is, however, only used for being able to reset the ESP8266 from Python. If you remove the reset functionality, the dependency on RPi.GPIO could be removed. You would still need to make some changes to make it contact the ESP8266 over USB instead of the Pi serial port.