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

capture and decode raw-data #7

Closed
avaldebe opened this issue Apr 14, 2020 · 0 comments
Closed

capture and decode raw-data #7

avaldebe opened this issue Apr 14, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@avaldebe
Copy link
Owner

raw sample data

The setup to capture raw data needed for #2 is a bit too involved for casual users.
For example, to capture SPS30 messages (47 bytes long) from /dev/ttyUSB0 one needs to

stty -F /dev/ttyUSB0 min 0 -icanon
tail -f /dev/ttyUSB0 | xxd -g1 -c47

The obscurity of the commands involved is not going to help gaining contributions for #2.
Besides the commands are slightly different for different sensors.

With the introduction of -n N, --samples N on #4, one can further extend the application to provide the raw data on the right format. The following would capture 10 messages, with a frequency of 15 seconds:

pms -s /dev/ttyUSB0 -m SPS30 -n 10 -i 15 raw

capture

Saving raw data to a file could be a good way to create sample data for testing.
This would provide a path to test the command line interface without real hardware attached.

pms -s /dev/ttyUSB0 -m SPS30 -n 10 -i 15 raw --capture

would write the raw data into a file with a well defined name pattern, e.g. start-time.pms. In the previous example, the file name would be something line 2020-01-01_15:22:23.pms

decode

Once we can capture raw data, caould decode it as

pms -s 2020-01-01_15:22:23.pms -m SPS30 -n 10 -i 15 raw --decode

The extension .pms would indicate that we are not reading from a serial port.
The start time is retrieved from the filename. The complete file would be decode if number of samples (-n) is not specified.

combining sub-commands

pms serial and pms csv have some overlap with pms raw-data. Maybe this 3 sub-commands can be rolled into one.
In addition to reducing the number of options, combining this sub-commands would help with the coverage on travis builds.

@avaldebe avaldebe added the enhancement New feature or request label Apr 14, 2020
avaldebe added a commit that referenced this issue Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant