StreamAcq
is a simple acquisition software in upper computer sides designed for capturing, showing, saving, and processing streaming sensor data in real-time.
Many sensors work on streaming/online data, such as temperature, humidity, gyroscope, or physiological electrical signals. In most cases, a single chip microcomputer or a slave computer is connected to these sensors and sends collected data to an upper computer (or a server) through specific communication protocols like Serial or Bluetooth. It is necessary to show these data in real-time sometimes.
StreamAcq
can provide a general and easy-to-use visualization solution for sensor data without coding.
- Extensible acquisition interface (Now only support Serial)
- Save as CSV files
- Automatically calculate sample rate
- Interact with the lower computer
- Scalable and handy user-defined real time processing (This is an advanced feature but only requiring a few coding)
Package |
|
|
|
|
|
Follow these steps to run the project on your local machine:
-
To run the project locally, first clone this repository to your local machine. For example:
git clone https://github.com/fegshen/streamAcq.git
-
After cloning the repository, enter the folder that contains the repository contents:
cd streamAcq
-
User needs to install required packages and then start the software by running
main.py
:pip install bokeh, pyserial, pyserial_asyncio, toml python main.py
-
When open the software for the first time, a configuration web page will automatically open, like this
Transport Protocol
: Now only support Serial (which is a common choice when using MCU).Ports:
The serial port used for communicating with the slave computer.Packet Header Input
: When sending multi-channel data using serial (or UART) in a MCU, the structure of data must beHeader+Ch1+Ch2+...
. I am not sure if it is a good idea without check digits but it make sense in the laboratory stage. Users should code for the MCU themselves. For example, you can take two bytes like0x01 0x02
as theHeader
, then inPacket Header Input
you should use abbreviated hexadecimal0x0102
.Enter the number of channels
: The number of the channels determine the number of rows in the table, where the content can be modified by double clicking the entry.Chname
is the name of each channel. It should be unique string for different channels, otherwise it might be interpreted as the same channel (This may be userful if you want to assign different sampling rates for different channels or send multiple data frames with one header).Dtype
is the type of the data in each channel. Although Endian can be altered for each row, it has no actual effect that only the value in the first channel is valid. You can also changeScale
andOffset
if ranges of data in different channels show significant discrepancy.Time Range in Figure (s)
is the time span of the abscissa in seconds.Save Prefix Name
andSelect Directory
determine the name and location of the saved file. Saved files will automatically be suffixed with time.
Please click
Save Config
to make the configuration valid. Actually, this action will create a file named 'config.toml' instreamAcq/utils
. if there is any bug, just remove this file and reconfigure. -
After the configuration, just refresh the browser and you can see the line chart
-
If you would like to process data in real time, please see
streamAcq/processing/userProcess.py
.