Page 1 of 1

Negative Unit values are displayed when generic sysfs GPIO generates the confugered hardware

Posted: Saturday 17 August 2024 18:36
by Molenman
Hello all,

My configuration :
Version: 2024.7
Platform: Ubuntu 20.04
Plugin/Hardware: GPIO pins/Odroid C2

When generating the GPIO hardware that was first configured with a bash job i get negative Unit values for the detected hardware when using Generic sysfs GPIO . When trying to toggle a GPIO pin trough Domoticz I get an error "sending switch command".

Bash commands work fine and change the GPIO pin correctly, also without a sudo command.

After an update and upgrade the error stays

This problem occurred recently, the configuration worked fine before.
Screenshot of generated hardware
Screenshot of generated hardware
Screenshot from 2024-08-17 17-52-47.png (91.7 KiB) Viewed 743 times
I seems that the value equals the GPIO pin assignment in linux minus 256
Linux GPIO reference
Linux GPIO reference
Screenshot from 2024-08-17 20-24-17.png (22.8 KiB) Viewed 736 times
When making a dummy switch and assigning a script that turns on and off the GPIO output all works fine.
With script
With script
Screenshot from 2024-08-18 08-33-09.png (35.72 KiB) Viewed 727 times
Anyone that can explain why I get negative Unit values when using the Generic sysfs GPIO Hardware option of Domoticz?

When trying to add a switch manually, Domoticz shows the correct pin assignments in the selection list but I have no idea what to enter as ID, 3 0E 0E 04 as ID values gives the same error message.




Greetings,

Luc De Smedt

Re: Negative Unit values are displayed when generic sysfs GPIO generates the confugered hardware

Posted: Monday 19 August 2024 8:09
by gizmocuz
There have been some recent changes to the sysfs/GPIO hardware.
It seems this negative unit is assigned in the sysFS/GPIO hardware class, as I just changed manually a device unit to 249 here in the database, and it displays correctly in the devices overview.

Just had a look at the hardware class, it seems 'int8_t' was used instead if 'uint8_t', and this is causing the negative number

Could you try beta 16179 to see if this solves the issue?

Re: Negative Unit values are displayed when generic sysfs GPIO generates the confugered hardware

Posted: Monday 19 August 2024 12:00
by Molenman
gizmocuz wrote: Monday 19 August 2024 8:09 There have been some recent changes to the sysfs/GPIO hardware.
It seems this negative unit is assigned in the sysFS/GPIO hardware class, as I just changed manually a device unit to 249 here in the database, and it displays correctly in the devices overview.

Just had a look at the hardware class, it seems 'int8_t' was used instead if 'uint8_t', and this is causing the negative number

Could you try beta 16179 to see if this solves the issue?
I'll give it a try this evening. Thanks for the information.

I installed beta 16182 and all works fine now. One more man feels happy. How do I close this issue ?

Re: Negative Unit values are displayed when generic sysfs GPIO generates the confugered hardware

Posted: Monday 19 August 2024 17:15
by gizmocuz
Great it's working!
Consider it closed ;)