I am getting different values when using piTest and RevPiModIO. The output of piTest is the correct one.
There has been some manipulations performed in Pictory:
2024-01-26_18-41.png (6.01 KiB) Viewed 9956 times
2024-01-26_18-12_1.png (8.69 KiB) Viewed 9956 times
I wonder if RevPiModIO is not using the correct config.rsc file. How would I correct this?
Any changes I make to the Pictory configuration e.g. Multipliers are not making any changes to piTest.
It looks like there is no symbolic link. I am using Pictory 1.4.7
Does fixing this also fix these warnings?
Warning,
/usr/lib/python3/dist-packages/revpimodio2/modio.py:426: Warning: equal device name 'RevPi AIO' in pictory configuration. you can access this devices by position number .device[30|31] only!
EDIT: I have just checked the multipliers are the same in both /etc/revpi/config.rsc and /var/www/pictory/projects/_config.rsc
/etc/revpi/config.rsc should be a symlink to /var/www/pictory/projects/_config.rsc (on Stretch) or /var/www/revpi/pictory/projects/_config.rsc (on Buster and upwards).
NOTE: Pictory version 1.4.7 is (very) outdated, thus you must be using an outdated version of the operating system. I highly suggest to install the latest version of your Image (Bullseye) as there were several fixes and software updates since then. Also the old operating system (Stretch, was superseded by Buster, was superseded by Bullseye) does not receive security updates.
I am planning to upgrade to Buster, but first I need to update the image and ensure everything works including reading IO. So this is a temporary transition period. Thank you for your continued help in getting the IOs working.
Symbolic link has been fixed with: sudo ln -s /var/www/pictory/projects/_config.rsc /etc/revpi/config.rsc
EDIT: revpimodio2-2.7.1 is the version number.
I still get a different number in python vs piTest.
Python number: -29405
piTest: 36078
I have narrowed down why there is a difference between python and piTest and I think there is a bug with the library.
The issue is when there is a multiplier of 25, Divisor: 8, Offset: -12500
piTest: 36018
python: -29518
There is no issue with multiplier of 1, Divisor: 1, Offset: -12500
piTest: 3018
python: 3029
There is no issue with multiplier of 25, Divisor: 1, Offset: -12500. It looks like there is an overload as the output is incorrect.
piTest: 21834
python: 20884
There is a big issue with multiplier of 25, Divisor: 2, Offset: -12500. It looks like there is an overload as the output is incorrect.
piTest: 65465
python: -721
There is no issue with multiplier of 1, Divisor: 1, Offset: 0
piTest: 15615
python: 15641
The ModIO Library is set to signed integers in default on an AIO Module, piTest is unsigned.
You can get the byte-Value of the IO, using RevPiModIO via .get_value() instead of .value. The Hex value should be the same with the hex value on piTest.
If you want ModIO to treat the bytes unsigned (as piTest does) you can set .signed = False in your Python program for the input, then the .value should show the same result.