Page 1 of 1

PCA9685

Posted: Sunday 17 February 2019 22:37
by pascalspits
hi,
is there a way to control this module from Domoticz on a Raspi ?

https://www.adafruit.com/product/815
Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685

it's I2C so in theory it should be possible ... anyone knows how to do it ?

Re: PCA9685

Posted: Friday 22 February 2019 9:05
by pascalspits
nobody ?

or any other way to add extra PWM ports to a Raspi ?
I need 8 additional PWM outputs ...

Re: PCA9685

Posted: Saturday 21 December 2019 23:57
by pascalspits
any other way to add extra PWM ports to a Raspi ?

Re: PCA9685

Posted: Tuesday 21 April 2020 11:14
by pascalspits
I'm still waiting to expand the amount of PWM pins on my RasPi using this board ...
any way of controlling this I2C board ?
(maybe by scripting ?)

Re: PCA9685

Posted: Tuesday 21 April 2020 11:37
by elmortero
You could use the python module for that https://github.com/adafruit/Adafruit_Ci ... on_PCA9685

And then setup like this.

PCA9685 <--> python <--> domoticz

Re: PCA9685

Posted: Thursday 23 April 2020 13:53
by pascalspits
ok, I've downloaded Adafruit driver but what would these python scripts look like, I'm a complete noob in coding ...

would appreciate some help ...

elmortero wrote: Tuesday 21 April 2020 11:37 You could use the python module for that https://github.com/adafruit/Adafruit_Ci ... on_PCA9685

And then setup like this.

PCA9685 <--> python <--> domoticz

Re: PCA9685

Posted: Thursday 30 April 2020 20:17
by elmortero
Sorry, can't help you there. DOn't have the boards myself.
I had a quick look at the manual, looks like with no previous experience (and google of course) should be possible to figure it out.
Might have to spend some time on it.
Good luck

Re: PCA9685

Posted: Tuesday 24 November 2020 11:19
by pascalspits
could anybody give me a hand (or some usefull tips) on setting this up ?
I'm really a noob in coding ...

PCA9685

Posted: Tuesday 01 December 2020 17:45
by pascalspits
progress update :

I've installed the Adafruit library on my Raspi and connected the board to the I2C bus ...
... and it appears to be working !

I can control the PWM outputs with the demo-scripts that came with the library, when running these scripts directly in Raspi.
I run them by using the command : "python3 pca9685_simpletest.py"
leds go on and off on the PWM board ... all parameters are working ... seems responsive ...

The next step is connecting these python scripts to Domoticz devices, so I copied the script to /home/pi/domoticz/scripts/python/pca9685_simpletest.py so Domoticz can reach it ...
I tried in the "On action" : "script:///home/pi/domoticz/scripts/python/pca9685_simpletest.py"
it doesn't respond, and when I look in the log, I see the error :
"Error executing script command (/home/pi/domoticz/scripts/python/pca9685_simpletest.py). returned: 32256"

what am I doing wrong ?

if you are one of the many python code-wizards on this forum, could you set me on my way, I would be forever gratefull !
I'm a complete newbie/noob at coding and python, but very eager to learn ... sorry !

Thanks in advance !

Re: PCA9685

Posted: Tuesday 01 December 2020 18:26
by pascalspits
awesome, it works !!!

THANKS a million !

... learning all the time

this board has 16 PWM outputs, so I can dim 16 LED channels ...
should I now make 16 scripts (32 actually, 1 for ON and 1 for OFF) and link to them from Domoticz devices, or is there a way to controll all in 1 "central" script ?

Re: PCA9685

Posted: Tuesday 01 December 2020 19:08
by pascalspits
or can I use the dimmer function ?

I read somewhere that there are 2 kinds of scripts in Domoticz : device scripts and time scripts ... "script_device_demo.py" and "script_time_demo.py"

so should I create a python script for each device, and having it read out the dimmer value of that Domoticz device and sending this (calculated to HEX value) to the output of the appropriate PWM channel ?

in this way I could use 1 script per device and immediately use it as a dimmer, instead of just an on/off switch ... right ?

how should I script this then ?