-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add zmq server and json support #102
base: master
Are you sure you want to change the base?
Conversation
I think there are some inconsistencies in this PR:
Furthermore, the PR adds Wouldn't it make sense to split this PR into separate PRs for the introduction of the Hope this helps to improve or assess the PR(s). |
python_cli/advertiser.py
Outdated
args = aparse.parse_args() | ||
|
||
global hw | ||
hw = SniffleHW(args.serport) | ||
hw = SniffleHW(args.serport,baudrate=args.baudrate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a space after the comma, after: ...(args.serport,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved.
python_cli/scanner.py
Outdated
@@ -60,7 +61,7 @@ def main(): | |||
args = aparse.parse_args() | |||
|
|||
global hw | |||
hw = make_sniffle_hw(args.serport) | |||
hw = make_sniffle_hw(serport=args.serport,baudrate=args.baudrate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a space after the comma, after: ...(args.serport,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved.
Next to the above highlighted whitespace issues in the code, the changes proposed to |
python_cli/sniffle/resampler.py. Both numpy and scipy were already required. |
In fact, the README already states that the firmware differs in its baudrate depending which firmware was flashed:
|
README.md
Outdated
@@ -244,6 +245,8 @@ options: | |||
-d, --decode Decode advertising data | |||
-o OUTPUT, --output OUTPUT | |||
PCAP output file name | |||
-z, --zmq Enable ZMQ server | |||
--zmqsetting Set ZMQ server ip and port (default:127.0.0.1:4222) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a space after default:
should make this more readable (and as it would be rendered in fact?): ... and port (default: 127.0.0.1:4222)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed that accordingly.
As I'm not using/needing this, I might not have been aware of this and may never have needed it. I will leave it to you and others to decide if it is clear (from the other documentation) what value should be used by someone that does need it and in which situation(s). Could Sniffle figure it out from the device using some FW version details? Hmm, perhaps it cannot reliably if there is a mismatch from the start and the communication doesn't work. Oh well, outside my level of use/understanding. |
This appears to have been addressed as well, as I didn't spot whitespace issues in |
Note that I just looked at the PR and reported my observations, I didn't try to run it at all... so it is just an eyeball review. I still wonder about the mixing of different topics into one PR, but will leave that to @sultanqasim to decide. |
baud = 921600 | ||
elif is_cp2102(serport): | ||
baud = 921600 | ||
if baudrate is None: | ||
baud = 921600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be removed as part of a reversion to 2Mbaud everywhere as requested in #101 , and then just letting people use the new baudrate option this introduces if they want 921600.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without that, it isn't working with the current code, as other hw doesn't support 2Mbaud.
Thanks for your contributions. Sorry for my delayed response, as I just had my first kid born and she has been keeping me busy :) I'll probably split these changes into a few commits for the different things in here (baud rate selection, mark and flush timeout, the ZeroMQ server, and cosmetic changes). I may skip the cosmetic changes and implement the mark and flush timeout a bit differently. |
Numpy and Scipy are not listed as dependencies in the README because they are only used for the experimental SDR-based sniffing functionality that I haven't yet documented and is very much an incomplete work-in-progress. You don't need Numpy or Scipy for the TI CC13xx/CC26xx based sniffer. |
This adds a zmq server, baudrate config and json output support, enabling external decoders