Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should support stopping and restarting live capture #1

Open
matthijskooijman opened this issue Oct 3, 2014 · 5 comments
Open

Should support stopping and restarting live capture #1

matthijskooijman opened this issue Oct 3, 2014 · 5 comments

Comments

@matthijskooijman
Copy link
Collaborator

When writing to a FIFO and the FIFO is closed at the other end (e.g., Wireshark capture stopped), the serial port should be closed and capturing should stop. Then, when the FIFO is opened again, capturing should start again.

Currently, when the FIFO is closed, this is not detected by serial-pcap until it tries to write another packet to the FIFO, then it gets SIGPIPE. To detect the closing beforehand, we probably need to select on the FIFO (and serial) fd (though I'm not entirely sure that select allows detecting a FIFO close, needs to be investigated).

This approach assumes that simply re-opening the serial port will restart the capturing hardware (as happens with a Pinoccio Scout), but that might not apply to other boards (so an option might be useful to let serial-pcap just quit instead of restarting capture).

@dspchung
Copy link

dspchung commented May 29, 2019

I've got below error while running your script

==============================
root@ubuntu:/# python serial-pcap --fifo /tmp/wireshark /dev/ttyS1
Traceback (most recent call last):
  File "serial-pcap", line 199, in <module>
    main()
  File "serial-pcap", line 132, in main
    do_sniff_once(options)
  File "serial-pcap", line 138, in do_sniff_once
    out = setup_output(options)
  File "serial-pcap", line 101, in setup_output
    return PcapFormatter(open_fifo(options, options.fifo))
  File "serial-pcap", line 89, in open_fifo
    except FileExistsError:
NameError: global name 'FileExistsError' is not defined
==============================

Do you know the reason?

@matthijskooijman
Copy link
Collaborator Author

As already mentioned by mail, the script is written for python3 (and apparently does not support python2). Will you close this issue if using python3 fixes things?

@dspchung
Copy link

Yes, it looks to be fixed.:-)
One more question, I couldn't find fifo in the wireshark.
Can you please let me know where I can find it?
I did Capture->options-> Manage Interfaces

I couldn't find it in the Local interfaces and Pipes.

@dspchung
Copy link

dspchung commented May 30, 2019 via email

@dspchung
Copy link

dspchung commented May 30, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants