kardia-as / zigpy-zboss

GNU General Public License v3.0
36 stars 4 forks source link

PCAP packet capture dump to file for troubleshooting and Wireshark analysys (like bellows CLI tool)? #5

Closed Hedda closed 2 months ago

Hedda commented 1 year ago

Low priority request however please consider implementing PCAP packet capture dump to file from raw MAC layer for troubleshooting and Wireshark analyses (like bellows CLI tool) as then this could also make the zigpy-zboss project usable as a stand-alone command line tool as well.

https://github.com/the-tcpdump-group/tcpdump-htdocs/blob/master/linktypes/LINKTYPE_ZBOSS_NCP.html

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_sniffer_802154%2FUG%2Fsniffer_802154%2Fintro_802154.html

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/protocols/zigbee/tools.html#id8

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_sniffer_802154%2FUG%2Fsniffer_802154%2Fintro_802154.html

https://gitlab.com/wireshark/wireshark/-/merge_requests/5301

"Zigbee stack ZBOSS by DSR has a serial protocol for Network Co-Processor configuration (NCP). This is an implementation of dissector for this protocol."

bellows support dumping captured packets into a PCAP file, see bellows -d /dev/ttyUSB1 dump -c 15 -w packet-capture-file.pcap

https://github.com/zigpy/bellows/blob/dev/bellows/cli/dump.py

Note, since this feature is radio dependent it probably will not be able to be implemented into zigpy, but maybe into zigpy-cli someday(?)

https://github.com/zigpy/zigpy-cli

com.zsmartsystems.zigbee.sniffer (by cdjackson for the https://github.com/zsmartsystems project) to the zigpy project to let Wireshark Zigbee sniffer function utilize radio libraries to even sniff Zigbee network traffic in real-time?

https://github.com/zsmartsystems/com.zsmartsystems.zigbee.sniffer

The com.zsmartsystems.zigbee.sniffer project act as a stand-alone example of how to features of an Ember dongle to provide a network sniffer to route frames to Wireshark.

See https://wiki.wireshark.org/IEEE_802.15.4

"To use Wireshark, the loopback interface needs to be selected, and then a filter udp port 17754 is used to only display ZigBee packets."

https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html

https://www.cd-jackson.com/downloads/ZigBeeWiresharkSniffer.pdf

com.zsmartsystems.zigbee.sniffer as it is currently depends on the Ember (EZSP) driver from https://github.com/zsmartsystems/com.zsmartsystems.zigbee