No idea why your packets get corrupted; I have not seen that and I've received far more than 200 packets with my code. I doubt the issue is the ringbuffer: if it's full, depending on the timeout value it will either (non-zero) wait for a while for there to be space, or (zero) discard the packet alltogether. Corrupting packets is not intended behaviour
The difference between the two lines is that the 2nd one will only push 4bytes (the size of the pointer 'packet') into the buffer; methinks that's not what you'd want.
Problems with promiscuous mode (capture network traffic)
-
- Posts: 9759
- Joined: Thu Nov 26, 2015 4:08 am
-
- Posts: 20
- Joined: Sat Jul 22, 2017 11:59 am
Re: Problems with promiscuous mode (capture network traffic)
> Updated gist in startpost.
Well, it's weird. I dunno why my parsing function on the second core stops. It's like
total received packets: 1
packets after parsing: 1
total received packets: 2
packets after parsing: 2
total received packets: 2
packets after parsing: 2
-> And so on till ~50 packets received. Sometimes it goes on till ~200 packets. Not comprehensible.
total received packets: 51
total received packets: 52
total received packets: 53
total received packets: 54
....
-> No 'packets after parsing' message anymore. But my callback is still working.
I tested this with filtering the ssid and with printf statements to create a hexdump. But no matter, the issue is still the same.
I used
So it should discards all packets if it's full, then it should go on. The ringbuf receiving is as follows:
Well, it's weird. I dunno why my parsing function on the second core stops. It's like
total received packets: 1
packets after parsing: 1
total received packets: 2
packets after parsing: 2
total received packets: 2
packets after parsing: 2
-> And so on till ~50 packets received. Sometimes it goes on till ~200 packets. Not comprehensible.
total received packets: 51
total received packets: 52
total received packets: 53
total received packets: 54
....
-> No 'packets after parsing' message anymore. But my callback is still working.
I tested this with filtering the ssid and with printf statements to create a hexdump. But no matter, the issue is still the same.
I used
Code: Select all
xRingbufferSend(packetRingbuf, packet, packet->rx_ctrl.sig_len, 0);
Code: Select all
size_t len;
wifi_promiscuous_pkt_t *packet=(wifi_promiscuous_pkt_t*)xRingbufferReceive(packetRingbuf, &len, portMAX_DELAY);
if (len==1) {
vRingbufferReturnItem(packetRingbuf, packet);
vRingbufferDelete(packetRingbuf);
vTaskDelete(NULL);
}
Re: Problems with promiscuous mode (capture network traffic)
You don't call vRingbufferReturnItem after hexdump
-
- Posts: 20
- Joined: Sat Jul 22, 2017 11:59 am
Re: Problems with promiscuous mode (capture network traffic)
Oh man, that makes me feel uncomfortable. Thanks. It seems to work now, even after >5.000 packets.
Who is online
Users browsing this forum: No registered users and 119 guests