Releases: MyTooliT/ICOc
Version 2.0.0
General
- Remove support for Python 3.9
API
- Removed dependency to
pint
library. All measurement code now returns numbers instead of objects of thepint
classQuantity
again.
Measurement
- The method
convert_raw_to_g
now returns a float instead of aQuantity
.
Network
-
Removed the coroutines:
read_streaming_data_seconds
andread_streaming_data_amount
Please just use
open_data_stream
andasync for
, if you want to replace code that used these coroutines. -
Added the coroutine
shutdown
again: You can use this method, if you want to shutdown the bus manually
Storage
- The storage class now only acts as an context manager for the class that modifies the data itself (
StorageData
). You now need to provide the format of the axis data when you first open the storage class instead of later in the process, when you add data. Overall the process of storing acceleration data as HDF5 file should be simpler and less error prone due to the new design. - You can now also use the class to work with already existing HDF5 files.
Streaming
-
We changed the interface (data structure) for accessing streaming data to improve the performance when working with the high frequency data of the ICOtronic system.
-
Add the amount of lost messages to the data returned by the iterator over the streaming data
-
Raise an exception if the amount of buffered streaming messages exceeds a certain value (currently one second worth of streaming data).
Note: A large buffer indicates that the application is not able to keep up
with the current rate of retrieved messages and therefore the probability of
losing messages is quite high. -
Removed the class
TimestampedValue
Version 1.12.0
Documentation
- Add basic API documentation
Scripts
ICOc
- Handle encoding in error messages (Issue #58)
ICOn
Rename
- Handle timeouts properly (Issue #59)
Internal
Streaming
- Fix out of bound access error for “Stop Stream” messages
Version 1.11.0
Scripts
ICOc
-
Handle empty channel configuration e.g. something like
icoc -1 0 -2 0 -3 0 -n Test-STH
-
Handle empty channel configuration in UI
ICOn
-
Handle empty channel configuration e.g. something like
icon measure -1 0 -2 0 -3 0 -n Test-STH
Internal
CAN
- Add support for
python-can
version4.4
Streaming
- Ignore streaming messages without any data bytes
1.10.0
Documentation
-
Remove release notes from official (bookdown) documentation
If you are interest in the updates between releases:
- please visit the GitHub release page or
- take a look into the directory
Documentation/Releases
ICOn
Measure
- Add support for specifying the channel configuration for the measurement
Internal
Network
- The Network class now raises a
CANInitError
(a subclass ofNetworkError
), when it is unable to initialize the CAN connection instead of a more generalNetworkError
. - Make sure CAN bus is shutdown properly in error scenarios. This update should get rid of warning messages, such as “PcanBus was not properly shut down”.
Sensor Configuration
- Add check for correct init arguments
- Add method to check if sensor configuration requires hardware that supports channel configuration
STU- Test
-
The STU test now tries to fix CAN communication problems, after flashing a new firmware on the chip. This fix should get rid of the bus error that might occur otherwise:
Bus error: an error counter reached the 'heavy'/'warning' limit
and might cause problems in in other tests afterwards.
1.9.0
ICOn
- Moved code into
scripts
directory - ICOn now handles timeout problems while streaming data (#50)
Linting
- We now check the whole codebase with Pylint
Internal
Network
- The
network
class now handles timeout problems when streaming data. If no streaming data arrives for a specified amount of time, then aStreamingTimeoutError
will be raised.
Version 1.8.0
Documentation
- Added very basic example code
Docker
- Removed (references to) Docker Hub images, since nobody used them anyway
- Removed
Dockerfile
for Alpine Linux - Use virtual environment for ICOc install in
Dockerfile
for Ubuntu
ICOn
Measurement
- Add timestamp to measurement filename (Issue #48)
- Use default value for acceleration sensor range (Issue #47)
- Add options for ADC configuration values:
- prescaler,
- acquisition time,
- oversampling rate, and
- reference voltage
- Use
0
as value for infinite runtime (option-t/--time
) (Issue #49)
Linting
- We now check the codebase – currently only for errors – with Pylint
Logging
- Log files are now stored in the user log directory (of the current OS) instead of the current working directory
Internal
Package
-
Merged Python modules for sensor code
mytoolit.can.sensor
mytoolit.measurement.sensor
into
mytoolit.measurement.sensor
-
Moved
EEPROMStatus
definition frommytoolit.eeprom.eeprom_status
intomytoolit.eeprom.status
Storage
- Add method
dataloss
to determine amount of measurement data loss
Version 1.7.0
Configuration
- We added support for a user configuration file that can be used to overwrite values in the default configuration.
Package
-
Require Python
3.9
or later -
Uploaded package to PyPi, which means you can now install ICOc via:
pip install icoc
Scripts
- We removed the
clean-repo
command
Hardware Tests
- The SMH, STH and STU tests now store the PDF test report in the current working directory
ICOc
- The command now stores log files inside the current working directory
ICOn
Config
- The new subcommand
config
can be used to open the user configuration file.
Measurement
- Add the possibility to change the measurement duration (option
-t
,--time
) - Store data in HDF5 format
STU
- Add
reset
command
Style
- We now use Black instead of YAPF to format the code base, since Black:
- supports the latest Python features (e.g.
match
/case
andexcept*
) and - splits long strings (experimental feature).
- supports the latest Python features (e.g.
Tests
- We added two (very basic) Prysk tests for the command line tool
icon
Internal
ADC
-
We added methods to read the
- prescaler,
- acquisition time,
- oversampling rate and
- the sample rate
of ADC configuration objects (class
ADCConfiguration
).
Network
- Collected streaming data now also contains the message counter value
- Fixed reading data from multiple channels
Streaming Data
- We added the method
default
, which can be used to serialize data (into JSON format)
Storage
- We added the method
add_streaming_data
, which can be used to directly addStreamingData
objects to the (HDF5) storage.
Version 1.6.0
Docker
We now provide ICOc-Docker images based on
- Alpine Linux and
- Ubuntu
For more information, please take a look here.
ICOc
Internal
Measurement
- Renamed
convert_to_supply_voltage
toconvert_raw_to_supply_voltage
- The conversion function
convert_raw_to_g
now returns the data value including the unit (Quantity
) - The conversion function
convert_raw_to_supply_voltage
now returns the data value including the unit (Quantity
)
Network
-
Removed the coroutine
read_x_acceleration
(please useread_streaming_data_single
) instead -
Added the coroutines
Name Description read_streaming_data_seconds
Read streaming data for certain amount of time read_streaming_data_amount
Read certain amount of streaming values
ICOn
We now provide the command line tool icon
in addition to icoc
. This CLI tool currently only offers a very limited subset of the functionality of icoc
. However, since ICOn is based on python-can, it offers two advantages over icoc
:
- ICOn works on Linux and macOS (in addition to Windows)
- ICOn supports additional CAN adapters
Python
This version of ICOc requires Python 3.8
or later.
Setup
We modernized the setup process of the Python package and removed setup.py
in favor of pyproject.toml
.
WSL
We updated the documentation on how to use (parts of) ICOc on the latest stable version of Ubuntu (22.04) in the Windows subsystem for Linux
Version 1.5.0
ICOc
Command Line
-
You can now set/enable the measurement for channel 2 and 3 just by providing the option for the measurement channel without an argument. In this case the measurement channel will be mapped to the corresponding hardware/sensor channel, i.e.
- measurement channel 2 will use hardware channel 2 and
- measurement channel 3 will use hardware channel 3.
Example:
icoc -2
The command above will use
- hardware channel 1 for measurement channel 1 (default value),
- hardware channel 2 for measurement channel 2, and
- disable measurement channel 3.
-
ICOc can now connect to an STH, which has “no name” using the command line option
-n
(--name
):icoc -n '' # alternatively you can also just use `icoc -n`
Logging
- The log level set in the command line interface is now correctly propagated to the CAN class.
STH Tests
-
The STH test script now uses the hardware version in the configuration (
STH
→HARDWARE VERSION
) to determine the correct chip for the flash process.Hardware Version Chip 1.x.x
BGM113A256V2
2.x.x
BGM123A256V2
-
The test that executes self test now only checks that the absolute difference between the voltage
- at the the self test and
- before/after the self test
is larger than a certain value. Before we always assumed that the voltage at the test is higher than before/after. This does not seem to be the case for certain sensors like the ± 40 g sensor ADXL356.
-
The EEPROM test now also write the
- acceleration slope and
- acceleration offset
values of the y-axis and z-axis into the EEPROM
Internal
Network
-
Added the following coroutines:
Method Description write_sensor_configuration
Write measurement channel configuration read_eeprom_y_axis_acceleration_slope
Read y-axis acceleration slope write_eeprom_y_axis_acceleration_slope
Write y-axis acceleration slope read_eeprom_y_axis_acceleration_offset
Read y-axis offset slope write_eeprom_y_axis_acceleration_offset
Write y-axis offset slope read_eeprom_z_axis_acceleration_slope
Read z-axis acceleration slope write_eeprom_z_axis_acceleration_slope
Write z-axis acceleration slope read_eeprom_z_axis_acceleration_offset
Read z-axis offset slope write_eeprom_z_axis_acceleration_offset
Write z-axis offset slope -
The doctests of the Network class should now work more reliable on Linux
Version 1.4.0
ICOc
Channel Selection
- ICOc now supports more sensor channels. You can now select one of up to 255 (instead of 8) hardware channels for each of the three measurement channels.
- The CLI interface now uses three options (
-1
,-2
,-3
), instead of one option (-p
), to specify the channel number of each of the three measurement channels.
Logging
We replaced our custom logging class in the ICOc command line interface with logging code from the Python standard library. This logging code stores data in the following files:
cli.log
: Log messages of ICOcnetwork.log
: Log messages of CAN network classplotter.log
: Log messages of plotter (window process)
By default ICOc only write log messages of level ERROR
or higher into theses files. To print more detailed output you can use the option --log
to change the log level. For example, to change the log level to DEBUG
(or higher) you can use the the following command:
icoc --log debug
The other parts of the code, which use the old Network
class (e.g. the verification test) do not store the log output in files, but instead use the standard error output (stdout
). This change should hopefully improve the visibility of important log messages.
Tests
- The production tests for the hardware (STH, SMH and STU) should now also work on macOS, after you installed the PCBUSB library.
- The STH tests now use the correct ADC reference voltage for the ± 40 g acceleration sensor ADXL356.
Internal
Measurement
- Renamed the method
convert_voltage_adc_to_volts
toconvert_to_supply_voltage
- The method
convert_to_supply_voltage
now supports different reference voltages
Network
-
The methods to
- activate (
activate_acceleration_self_test
) and - deactivate (
deactivate_acceleration_self_test
)
the self test of the accelerometer now have a parameter to specify the dimension (
x
,y
orz
) for the self test. - activate (
-
The method to read the acceleration voltage (
read_acceleration_voltage
) now supports two additional parameters to- specify the dimension (
x
,y
orz
) and - the ADC reference voltage.
- specify the dimension (
-
The method to read the supply voltage (
read_supply_voltage
) now takes the current reference voltage into consideration -
The new method
read_sensor_configuration
can be used to read the current sensor configuration (i.e. the mapping from hardware/sensor channel to measurement channel).