[chirp_devel] Linux USB sniffing
I really like Chirp and I thought I might try to help out with adding a new old radio. I recently bought a used Icom IC-V8 and I have a programming cable. Programming software runs fine under Wine. I followed the directions on the Linux USB sniffing page. I can capture fine and I end up with a cap.pcap file that is about 1 MB in size. I can then run the first 2 commands in the clean script and end up with the capdev and capdev.tsv files. But when I try to run the tsv file through tidy, I get a segmentation fault but it does create an empty radiotrace. Any ideas? Thanks, Rich Gordon k0eb
Hi Rich,
I've added some thoughts in line.
Tony
On Tue, 2020-03-03 at 17:25 -0700, Richard Gordon via chirp_devel wrote:
I really like Chirp and I thought I might try to help out with adding a new old radio. I recently bought a used Icom IC-V8 and I have a programming cable. Programming software runs fine under Wine. I followed the directions on the Linux USB sniffing page. I can capture fine and I end up with a cap.pcap file that is about 1 MB in size.
Did you have to update the start_trace.sh script and remove the space between the dash and the i? start_trace.sh didnt work for me until I did that tshark - i usbmon$bus -w cap.pcap vs tshark -i usbmon$bus -w cap.pcap
I can then run the first 2 commands in the clean script and end up with the capdev and capdev.tsv files. But when I try to run the tsv file through tidy, I get a segmentation fault but it does create an empty radiotrace.
Just ensuring that you are compiling tidy.c using the info at the wiki: https://chirp.danplanet.com/projects/chirp/wiki/DevelopersUSB_Sniffing_in_Li...
Any ideas?
This doesn't help but I can reliably crash tidy with the non-tsv file so, maybe open up the TSV file in a text editor and ensure it "looks good"?
The c file is written with a pretty high expectation that the TSV file is perfect so I suspect the TSV file formatting.
What version of tshark are you using (tshark --version from a command line should be sufficient)
Thanks, Rich Gordon k0eb
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
Thanks for the reply Tony. TShark version is 2.6.8. Yes, I have to remove the space between the dash and the i in the start_trace command. I also have to 'sudo modprobe usbmon' and 'touch cap.pcap' before starting. (time goes by) I was trying to capture a read from the radio. If I run tidy on this data to stdout I can see where the fault takes place in the tsv but I don't know why. I had success sniffing a write to the radio and I now have a nice radiotrace file. What is the next step? I will make some subtle changes and figure out how the memories are laid out. Rich
On Tue, Mar 3, 2020 at 7:49 PM goldstar611@hotmail.com wrote:
Hi Rich,
I've added some thoughts in line.
Tony
On Tue, 2020-03-03 at 17:25 -0700, Richard Gordon via chirp_devel wrote:
I really like Chirp and I thought I might try to help out with adding a
new old radio.
I recently bought a used Icom IC-V8 and I have a programming cable. Programming software runs fine under Wine. I followed the directions on the Linux USB sniffing page. I can capture fine and I end up with a cap.pcap file that is about 1 MB
in size. Did you have to update the start_trace.sh script and remove the space between the dash and the i? start_trace.sh didnt work for me until I did that tshark - i usbmon$bus -w cap.pcap vs tshark -i usbmon$bus -w cap.pcap
I can then run the first 2 commands in the clean script and end up with
the capdev and capdev.tsv files.
But when I try to run the tsv file through tidy, I get a segmentation
fault but it does create an empty radiotrace. Just ensuring that you are compiling tidy.c using the info at the wiki: https://chirp.danplanet.com/projects/chirp/wiki/DevelopersUSB_Sniffing_in_Li...
Any ideas?
This doesn't help but I can reliably crash tidy with the non-tsv file so, maybe open up the TSV file in a text editor and ensure it "looks good"?
The c file is written with a pretty high expectation that the TSV file is perfect so I suspect the TSV file formatting.
What version of tshark are you using (tshark --version from a command line should be sufficient)
Thanks, Rich Gordon k0eb
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs:
Hi Rich, I'm on mobile so no inline reply this time.
If you can copy/paste the TSV file to pastebin.com or similar place I can inspect the file and see what tidy is choking on.
As far as next steps go, it seems you are on the right track. Make a small change, get another radiotrace file and do a difference/comparison.
I have a regular expression I use (on my computer) that adds spaces in between the hex characters so graphical diff programs like Meld work better when they perform highlighting. I can pull that up if you (or anyone in chirp-devel) is interested.
Tony ________________________________ From: Richard Gordon rich@lowswr.com Sent: Wednesday, March 4, 2020 7:01:45 PM To: goldstar611@hotmail.com goldstar611@hotmail.com Cc: chirp_devel@intrepid.danplanet.com chirp_devel@intrepid.danplanet.com Subject: Re: [chirp_devel] Linux USB sniffing
Thanks for the reply Tony. TShark version is 2.6.8. Yes, I have to remove the space between the dash and the i in the start_trace command. I also have to 'sudo modprobe usbmon' and 'touch cap.pcap' before starting. (time goes by) I was trying to capture a read from the radio. If I run tidy on this data to stdout I can see where the fault takes place in the tsv but I don't know why. I had success sniffing a write to the radio and I now have a nice radiotrace file. What is the next step? I will make some subtle changes and figure out how the memories are laid out. Rich
On Tue, Mar 3, 2020 at 7:49 PM <goldstar611@hotmail.commailto:goldstar611@hotmail.com> wrote: Hi Rich,
I've added some thoughts in line.
Tony
On Tue, 2020-03-03 at 17:25 -0700, Richard Gordon via chirp_devel wrote:
I really like Chirp and I thought I might try to help out with adding a new old radio. I recently bought a used Icom IC-V8 and I have a programming cable. Programming software runs fine under Wine. I followed the directions on the Linux USB sniffing page. I can capture fine and I end up with a cap.pcap file that is about 1 MB in size.
Did you have to update the start_trace.sh script and remove the space between the dash and the i? start_trace.sh didnt work for me until I did that tshark - i usbmon$bus -w cap.pcap vs tshark -i usbmon$bus -w cap.pcap
I can then run the first 2 commands in the clean script and end up with the capdev and capdev.tsv files. But when I try to run the tsv file through tidy, I get a segmentation fault but it does create an empty radiotrace.
Just ensuring that you are compiling tidy.c using the info at the wiki: https://chirp.danplanet.com/projects/chirp/wiki/DevelopersUSB_Sniffing_in_Li...
Any ideas?
This doesn't help but I can reliably crash tidy with the non-tsv file so, maybe open up the TSV file in a text editor and ensure it "looks good"?
The c file is written with a pretty high expectation that the TSV file is perfect so I suspect the TSV file formatting.
What version of tshark are you using (tshark --version from a command line should be sufficient)
Thanks, Rich Gordon k0eb
chirp_devel mailing list chirp_devel@intrepid.danplanet.commailto:chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
I installed Meld and I am interested in your regular expression that will add spaces in between the hex. I uploaded my files to filebin. https://filebin.net/dkzqg3zucekus62u The file that gave me trouble is read1_capdev2.tsv https://filebin.net/dkzqg3zucekus62u/read1_capdev2.tsv?t=30ba37mj They will be up there until March 12, 2020. Thanks for your help. Rich Gordon k0eb
On Wed, Mar 4, 2020 at 8:40 PM Ryan Fuller goldstar611@hotmail.com wrote:
Hi Rich, I'm on mobile so no inline reply this time.
If you can copy/paste the TSV file to pastebin.com or similar place I can inspect the file and see what tidy is choking on.
As far as next steps go, it seems you are on the right track. Make a small change, get another radiotrace file and do a difference/comparison.
I have a regular expression I use (on my computer) that adds spaces in between the hex characters so graphical diff programs like Meld work better when they perform highlighting. I can pull that up if you (or anyone in chirp-devel) is interested.
Tony
*From:* Richard Gordon rich@lowswr.com *Sent:* Wednesday, March 4, 2020 7:01:45 PM *To:* goldstar611@hotmail.com goldstar611@hotmail.com *Cc:* chirp_devel@intrepid.danplanet.com < chirp_devel@intrepid.danplanet.com> *Subject:* Re: [chirp_devel] Linux USB sniffing
Thanks for the reply Tony. TShark version is 2.6.8. Yes, I have to remove the space between the dash and the i in the start_trace command. I also have to 'sudo modprobe usbmon' and 'touch cap.pcap' before starting. (time goes by) I was trying to capture a read from the radio. If I run tidy on this data to stdout I can see where the fault takes place in the tsv but I don't know why. I had success sniffing a write to the radio and I now have a nice radiotrace file. What is the next step? I will make some subtle changes and figure out how the memories are laid out. Rich
On Tue, Mar 3, 2020 at 7:49 PM goldstar611@hotmail.com wrote:
Hi Rich,
I've added some thoughts in line.
Tony
On Tue, 2020-03-03 at 17:25 -0700, Richard Gordon via chirp_devel wrote:
I really like Chirp and I thought I might try to help out with adding a
new old radio.
I recently bought a used Icom IC-V8 and I have a programming cable. Programming software runs fine under Wine. I followed the directions on the Linux USB sniffing page. I can capture fine and I end up with a cap.pcap file that is about 1 MB
in size. Did you have to update the start_trace.sh script and remove the space between the dash and the i? start_trace.sh didnt work for me until I did that tshark - i usbmon$bus -w cap.pcap vs tshark -i usbmon$bus -w cap.pcap
I can then run the first 2 commands in the clean script and end up with
the capdev and capdev.tsv files.
But when I try to run the tsv file through tidy, I get a segmentation
fault but it does create an empty radiotrace. Just ensuring that you are compiling tidy.c using the info at the wiki: https://chirp.danplanet.com/projects/chirp/wiki/DevelopersUSB_Sniffing_in_Li...
Any ideas?
This doesn't help but I can reliably crash tidy with the non-tsv file so, maybe open up the TSV file in a text editor and ensure it "looks good"?
The c file is written with a pretty high expectation that the TSV file is perfect so I suspect the TSV file formatting.
What version of tshark are you using (tshark --version from a command line should be sufficient)
Thanks, Rich Gordon k0eb
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs:
I found the issue using your TSV file; you'll need to re-compile tidy.
In tidy.c find char buff[1000]; and change to char buff[100000]; then find char outbuff[1000]; and change to char outbuff[100000];
One buffer isn't large enough for your trace file and the stack is getting over written which causes a segfault, unless the file is written in such a way that it starts executing code, but I digress. I didn't drill down into which one is the real problem or verify that all of the data is there, so take it with a grain of salt :) But it doesn't crash anymore!
I'm going to enclose the regular expressions in quotes -- don't copy/use those, it's just to show you there's a trailing space in the replace string. Depending on your editor you may need to change \1 to $1
Search: "([0-9a-f]{2})" Replace with: "\1 "
Tony
On Thu, 2020-03-05 at 03:40 +0000, Ryan Fuller wrote:
Hi Rich, I'm on mobile so no inline reply this time.
If you can copy/paste the TSV file to pastebin.com or similar place I can inspect the file and see what tidy is choking on.
As far as next steps go, it seems you are on the right track. Make a small change, get another radiotrace file and do a difference/comparison.
I have a regular expression I use (on my computer) that adds spaces in between the hex characters so graphical diff programs like Meld work better when they perform highlighting. I can pull that up if you (or anyone in chirp-devel) is interested.
Tony
From: Richard Gordon rich@lowswr.com
Sent: Wednesday, March 4, 2020 7:01:45 PM
To: goldstar611@hotmail.com goldstar611@hotmail.com
Cc: chirp_devel@intrepid.danplanet.com chirp_devel@intrepid.danplanet.com
Subject: Re: [chirp_devel] Linux USB sniffing
Thanks for the reply Tony. TShark version is 2.6.8. Yes, I have to remove the space between the dash and the i in the start_trace command. I also have to 'sudo modprobe usbmon' and 'touch cap.pcap' before starting. (time goes by) I was trying to capture a read from the radio. If I run tidy on this data to stdout I can see where the fault takes place in the tsv but I don't know why. I had success sniffing a write to the radio and I now have a nice radiotrace file. What is the next step? I will make some subtle changes and figure out how the memories are laid out.
Rich
On Tue, Mar 3, 2020 at 7:49 PM goldstar611@hotmail.com wrote:
Hi Rich,
I've added some thoughts in line.
Tony
On Tue, 2020-03-03 at 17:25 -0700, Richard Gordon via chirp_devel wrote:
I really like Chirp and I thought I might try to help out with adding a new old radio.
I recently bought a used Icom IC-V8 and I have a programming cable.
Programming software runs fine under Wine.
I followed the directions on the Linux USB sniffing page.
I can capture fine and I end up with a cap.pcap file that is about 1 MB in size.
Did you have to update the start_trace.sh script and remove the space between the dash and the i? start_trace.sh didnt work for me until I did that
tshark - i usbmon$bus -w cap.pcap
vs
tshark -i usbmon$bus -w cap.pcap
I can then run the first 2 commands in the clean script and end up with the capdev and capdev.tsv files.
But when I try to run the tsv file through tidy, I get a segmentation fault but it does create an empty radiotrace.
Just ensuring that you are compiling tidy.c using the info at the wiki: https://chirp.danplanet.com/projects/chirp/wiki/DevelopersUSB_Sniffing_in_Li...
Any ideas?
This doesn't help but I can reliably crash tidy with the non-tsv file so, maybe open up the TSV file in a text editor and ensure it "looks good"?
The c file is written with a pretty high expectation that the TSV file is perfect so I suspect the TSV file formatting.
What version of tshark are you using (tshark --version from a command line should be sufficient)
Thanks,
Rich Gordon k0eb
chirp_devel mailing list
chirp_devel@intrepid.danplanet.com
http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
Developer docs:
participants (3)
-
goldstar611@hotmail.com
-
Richard Gordon
-
Ryan Fuller