I am trying to use the wifi_send_pkt_freedom system to send user-generated 802.11 packets, but am unable to successfully send a packet. The callback is registered successfully with wifi_register_send_pkt_freedom_cb, but wifi_send_pkt_freedom returns -1 and the freedom_outside_cb_t function is never called. No packets are seen when monitoring the channels using wireshark and a dedicated wifi adapter. An example beacon packet includes:
Code: Select all
/* Frame (255 bytes) */
uint8_t beacon[255] = {
0x00, 0x00, 0x1a, 0x00, 0x2f, 0x48, 0x00, 0x00, /* ..../H.. */
0xd7, 0xf2, 0xa9, 0x91, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x10, 0x02, 0x6c, 0x09, 0xc0, 0x00, 0xc8, 0x00, /* ..l..... */
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */
0xff, 0xff, 0xff, 0xff, 0x02, 0x03, 0x04, 0x05, /* ........ */
0x06, 0x07, 0x02, 0x1a, 0x11, 0xfa, 0x05, 0x6d, /* .m.....m */
0xa0, 0xfe, 0x87, 0xd1, 0xcd, 0x3d, 0x01, 0x00, /* .....=.. */
0x00, 0x00, 0x64, 0x00, 0x11, 0x05, 0x00, 0x14, /* ..d..... */
0x48, 0x45, 0x4C, 0x4C, 0x4F, 0x5F, 0x57, 0x4F, /* HELLO_WO */
0x52, 0x4C, 0x44, 0x5F, 0x54, 0x45, 0x53, 0x54, /* RLD_TEST */
0x5F, 0x4E, 0x55, 0x4D, 0x01, 0x08, 0x82, 0x84, /* _NUM.... */
0x8b, 0x96, 0x24, 0x30, 0x48, 0x6c, 0x03, 0x01, /* ..$0Hl.. */
0x01, 0x05, 0x04, 0x01, 0x02, 0x00, 0x00, 0x07, /* ........ */
0x06, 0x51, 0x32, 0x20, 0x01, 0x0b, 0x1e, 0x20, /* .Q2 ... */
0x01, 0x00, 0x23, 0x02, 0x12, 0x00, 0x2a, 0x01, /* ..#...*. */
0x00, 0x2f, 0x01, 0x00, 0x30, 0x14, 0x01, 0x00, /* ./..0... */
0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, /* ........ */
0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x02, /* ........ */
0x0c, 0x00, 0x32, 0x04, 0x0c, 0x12, 0x18, 0x60, /* ..2....` */
0x2d, 0x1a, 0x2d, 0x11, 0x17, 0xff, 0x00, 0x00, /* -.-..... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x3d, 0x16, 0x01, 0x08, /* ....=... */
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x7f, 0x08, 0x04, 0x00, /* ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xdd, 0x09, /* .....@.. */
0x00, 0x10, 0x18, 0x02, 0x01, 0x00, 0x1c, 0x00, /* ........ */
0x00, 0xdd, 0x18, 0x00, 0x50, 0xf2, 0x02, 0x01, /* ....P... */
0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, /* .......' */
0xa4, 0x00, 0x00, 0x42, 0x43, 0x5e, 0x00, 0x62, /* ...BC^.b */
0x32, 0x2f, 0x00, 0xa1, 0xaa, 0x93, 0xa7 /* 2/..... */
};
and is set using
Code: Select all
int result = wifi_send_pkt_freedom(beacon, 255, true);
os_printf("\tResult => %d ...\n", result);
Others seem to be having the same problem here:
https://github.com/pulkin/esp8266-injec ... e/issues/1
I have tested this with esp_iot_sdk_v1.4.1_pre5 and esp_iot_sdk_v1.4.0 with no luck.
Can you please provide an example code for using the wifi_send_pkt_freedom functions?
Thank you,
Christopher