先向您推荐一个MV “星星点灯” (个人爱好,请不要介意!)
使用IRremoteESP8266库整的
难度不大,关键是IR指令,所以我pdd买了一个现成的音响干扰器,收集数据
代码如下,工具是vscode+platformio(windows下挂好梯子很好安装)
当然,你也可以使用Arduino IDE
为什么用esp8266呢?便宜啊!4块钱就可以买到一个esp01s模块(烧录器7块钱),两节七号电池理论上可以用10个小时,电池,esp01s模块,红外线二极管用杜邦线连起来,用塑料袋一包非常隐蔽,很难被大妈发现。
真是刺激 (为了达到虾仁猪心的目的,除了这段代码之外,最下面还有一段代码,可以给大家参考一下,基于edittabarra/ESP8266-ABS,我小小的改动了一下)
vscode+platformio+esp8266 基本教程如下 https://zhuanlan.zhihu.com/p/380054960
esp01s 烧录教程可以向卖你烧录器的商家索要! 使用前请搞清楚相关引脚的含义
注意:使用前请注意当地法律法规,我不对代码造成的任何后果负责!您要是觉得此篇博文不合适,请先找 这群人 https://github.com/chaitin/xray
热心提示:华为 – 终端定位简介 终端定位原理
更多操作 https://www.bilibili.com/video/BV1VW411y7L4
#include <Arduino.h> #include <IRremoteESP8266.h> #include <IRsend.h> const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2). IRsend irsend(kIrLed); // Set the GPIO to be used to sending the message. void setup() { irsend.begin(); #if ESP8266 Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY); #else // ESP8266 Serial.begin(115200, SERIAL_8N1); #endif // ESP8266 } void loop() { //Serial.println("NEC"); irsend.sendNEC(0x807FD22D); delay(30); irsend.sendNEC(0x807F926D); delay(30); irsend.sendNEC(0x807FBA45); delay(30); irsend.sendNEC(0x807F32CD); delay(30); irsend.sendNEC(0x807F52AD); delay(30); irsend.sendNEC(0x807F6897); delay(30); irsend.sendNEC(0x807F9867); delay(30); irsend.sendNEC(0x807F4AB5); delay(30); irsend.sendNEC(0x807F48B7); delay(30); irsend.sendNEC(0x807F38C7); delay(30); irsend.sendNEC(0x807F7887); delay(30); irsend.sendNEC(0x807FC03F); delay(30); irsend.sendNEC(0x807F807F); delay(30); irsend.sendNEC(0x807F20DF); delay(30); irsend.sendNEC(0x807FAA55); delay(30); irsend.sendNEC(0x807F40BF); delay(30); irsend.sendNEC(0x807FC837); delay(30); irsend.sendNEC(0x807F609F); delay(30); irsend.sendNEC(0x807FB847); delay(30); irsend.sendNEC(0x807F18E7); delay(30); irsend.sendNEC(0xFF629D); delay(30); irsend.sendNEC(0x1FE58A7); delay(30); irsend.sendNEC(0x8945F00F); delay(30); irsend.sendNEC(0xFF22DD); delay(30); irsend.sendNEC(0x40BF58A7); delay(30); irsend.sendNEC(0x1FE30CF); delay(30); irsend.sendNEC(0x807F7A85); delay(30); irsend.sendNEC(0xFF30CF); delay(30); irsend.sendNEC(0xFFB04F); delay(30); irsend.sendNEC(0xFFE01F); delay(30); irsend.sendNEC(0x1FE7887); delay(30); irsend.sendNEC(0x1FE807F); delay(30); irsend.sendNEC(0xFFE21D); delay(30); irsend.sendNEC(0x80FFE21D); delay(30); irsend.sendNEC(0xFF40BF); delay(30); irsend.sendNEC(0xFFA25D); delay(30); irsend.sendNEC(0xFF48B7); delay(30); irsend.sendNEC(0x1FEA857); delay(30); //irsend.sendNEC(0x80FF48B7); delay(30); irsend.sendNEC(0x807FA25D); delay(30); irsend.sendNEC(0xFF00FF); delay(30); irsend.sendNEC(0xFFC23D); delay(30); irsend.sendNEC(0x1FEC03F); delay(30); irsend.sendNEC(0xF02FD); delay(30); irsend.sendNEC(0xFFA857); delay(30); irsend.sendNEC(0x807F906F); delay(30); irsend.sendNEC(0xFF906F); delay(30); irsend.sendNEC(0xFF8877); delay(30); irsend.sendNEC(0x807FE21D); delay(30); irsend.sendNEC(0x1FED827); delay(30); irsend.sendNEC(0x807FA857); delay(30); irsend.sendNEC(0xFFF00F); delay(30); irsend.sendNEC(0x1FE906F); delay(30); irsend.sendNEC(0xFF28D7); delay(30); irsend.sendNEC(0x1FEA857); delay(30); irsend.sendNEC(0x80FF48B7); delay(30); irsend.sendNEC(0x807FA25D); delay(30); irsend.sendNEC(0x1FE906F); delay(30); irsend.sendNEC(0xFF28D7); delay(30); irsend.sendNEC(0x1FE609F); delay(30); irsend.sendNEC(0xFF708F); delay(30); irsend.sendNEC(0x1FEA05F); delay(30); irsend.sendNEC(0xFF6897); delay(30); irsend.sendNEC(0xFF9867); delay(30); irsend.sendNEC(0x807FFA05); delay(30); irsend.sendNEC(0x807F12ED); delay(30); irsend.sendNEC(0x1FE48B7); }
虾仁猪心代码如下
#include <Arduino.h> #include <ESP8266WiFi.h> extern "C" { #include "user_interface.h" } String apNames[] = { "大妈您真是逊呢", "接着奏乐接着舞", "祝您长命百岁身体健康", "大妈喇叭怎么不想了" }; /* c++编程 参考 https://www.runoob.com/cplusplus/cpp-arrays.html https://www.runoob.com/cplusplus/cpp-strings.html */ const int apCount = sizeof(apNames)/sizeof(String); byte apMACs[apCount][6]; int currentAP = 0; int bPointer = 51; //char prefix = '#'; //Beacon Packet buffer byte packet[128] = { /* IEEE 802.11 Beacon Frame */ /*0*/ 0x80, 0x00, 0x00, 0x00, //type/subtype = beacon /*4*/ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, //dst addr = broadcast /*10*/ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, //src addr = random MAC /*16*/ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, //bss id = src addr /*22*/ 0x90, 0x53, //seq number 1337 + frag number 0 /*24*/ 0xDE, 0xAD, 0x00, 0xBE, 0xEF, 0x00, 0xF0, 0x0D, //timestamp /*32*/ 0x64, 0x00, //beacon interval (~100ms) /*34*/ 0x01, 0x04, //capabilities info /* IEEE 802.11 wireless LAN managment frame */ /*36*/ 0x01, 0x08, //tag = Supported Rates, size 0x82, 0x84, 0x8b, 0x96, 0x24, 0x30, 0x48, 0x6c, /*46*/ 0x03, 0x01, 0xFF, //tag = Channel, size, random channel /*49*/ 0x00, 0xFF, 0x23 //tag = SSID, size, prefix char }; void fillMACs() { for (int j = 0; j < apCount; j++) { apMACs[j][0] = random(256); apMACs[j][1] = random(256); apMACs[j][2] = random(256); apMACs[j][3] = random(256); apMACs[j][4] = random(256); apMACs[j][5] = random(256); } } void setup() { delay(100); wifi_set_opmode(STATION_MODE); wifi_promiscuous_enable(1); WiFi.setOutputPower(20.5); //packet[51] = prefix; fillMACs(); } void loop() { //Set random channel (pinning this variable wasn't giving me good results) byte channel = random(1, 11); wifi_set_channel(channel); packet[48] = channel; //Copying src addr and bssid to packet buffer packet[10] = packet[16] = random(256); packet[11] = packet[17] = random(256); packet[12] = packet[18] = random(256); packet[13] = packet[19] = random(256); packet[14] = packet[20] = random(256); packet[15] = packet[21] = random(256); //Copying SSID to packet buffer byte currLenght = apNames[currentAP].length(); packet[50] = currLenght; for (int i = bPointer; i < bPointer+currLenght; i++) { packet[i] = apNames[currentAP][i-bPointer]; } //Sending beacon. wifi_send_pkt_freedom(packet, bPointer+currLenght, 0); wifi_send_pkt_freedom(packet, bPointer+currLenght, 0); wifi_send_pkt_freedom(packet, bPointer+currLenght, 0); wifi_send_pkt_freedom(packet, bPointer+currLenght, 0); wifi_send_pkt_freedom(packet, bPointer+currLenght, 0); delay(1); currentAP++; if (currentAP == apCount) { currentAP = 0; delay(1); } }