Skip to content

Compiling with Arduino

Sam Denty edited this page Jul 16, 2017 · 2 revisions
  1. Download the source code of this project.

  2. Open up the drivers folder and install the appropriate driver for your board (Install both if you are unsure).

  3. Install Arduino and open it.

  4. Go to File > Preferences

  5. Add http://arduino.esp8266.com/stable/package_esp8266com_index.json to the Additional Boards Manager URLs. (refer to https://github.com/esp8266/Arduino)

  6. Go to Tools > Board > Boards Manager

  7. Type in esp8266 and select version 2.0.0, then click on Install (must be version 2.0.0!)

    screenshot of arduino, selecting the right version

  8. Open C:\Users\%username%\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\tools\sdk\include\user_interface.h in your preferred text editor.

  9. Just before the last line #endif, add the following:

typedef void (*freedom_outside_cb_t)(uint8 status);
int wifi_register_send_pkt_freedom_cb(freedom_outside_cb_t cb);  
void wifi_unregister_send_pkt_freedom_cb(void);
int wifi_send_pkt_freedom(uint8 *buf, int len, bool sys_seq);  

screenshot of notepad, copy paste the right code

  1. Navigate to the arduino/SDK_fix folder of this project

  2. Copy ESP8266Wi-Fi.cpp and ESP8266Wi-Fi.h to C:\Users\%username%\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WiFi\src replacing the originals

  3. Open arduino/Wi-PWN/Wi-PWN.ino in Arduino

  4. Go to Tools > Board and select the appropriate board for your ESP8266 module, along with the correct port in Tools > Port.

  5. Depending on your board you may have to adjust the Tools > Board > Flash Frequency and the Tools > Board > Flash Size. Select 80MHz 4M (1M SPIFFS) as these are the most common

  6. Upload the sketch! CTRL-U

Note: If you use a 512kb version of the ESP8266, you need to comment out a part of the mac vendor list in data.h