Page 1 of 1
Raspberry Pi Compute Module
Posted: Monday 22 February 2016 11:11
by Harty123
Hi,
I want to use the Raspberry Pi Compute module with Domoticz. In generally it works, but the GPIO support failed. I've installed wiredPi wihout problems and also the editing of /etc/init.d/domoticz.sh is done. IT's not possible to adjust in the switch menu the correspnding GPIO port. I can't choose a GPIO port, because the drop down menu contains only "GPIO INIT ERROR".
Cheers
Harty
Re: Raspberry Pi Compute Module
Posted: Monday 22 February 2016 11:31
by paulvha
does not seem to be able to find the pins.
Any log messages e.g. around not exported pins ?
Re: Raspberry Pi Compute Module
Posted: Monday 22 February 2016 11:54
by Harty123
thx for the ultra fast reply
"gpio exports" command works fine:

- Screen_putty.png (49.63 KiB) Viewed 1564 times
Re: Raspberry Pi Compute Module
Posted: Monday 22 February 2016 12:30
by paulvha
I expect the problem is related to updated "gpio readall" output. That has changed according to
http://wiringpi.com/wiringpi-and-the-ra ... pute-board.
If you look in hardware/Gpio.cpp around line 395, you will see that a certain layout is expected and parsed. That is very different to what you get with then new gpio version (looking on the earlier mentioned URL)
regards,
Paul
Re: Raspberry Pi Compute Module
Posted: Monday 22 February 2016 12:38
by Harty123
many thx Paul. The file /hardware/gpio.cpp don't exist on my system. Is there any solution for Domoticz for that problem ?
Best Regards
Harty
Re: Raspberry Pi Compute Module
Posted: Monday 22 February 2016 16:03
by paulvha
This will have to be a question to the owners of Domoticz.
I expect the hardware interface will need an update. it is going to take a bit of work on the interface does not use pins or wiringPI.
FROM THE INTERFACE SOURCE: "As we cannot assume domoticz runs as root (which is bad), we won't take advantage of wiringPi's numbering. Consequently, we will always use the internal GPIO pin numbering as noted the board, including in the commands below."
The GPIO pin information is gathered with "gpio exports" but Information about the mapping between GPIO and the pin is provided in the GUI interface. The necessary information used to be provided by the "GPIO readall" output, however it now only shows the pins on the compute board IO. From the schematics I can find the mapping, which needs to be coded. I had not looked at the code of the interface before, but it seems it was written some time ago, as it is not supporting some of the GPIO that became available with the 40 pin connector ( e.g. not GPIO 5, 6, 12, 13, 16, 19, 26), although it does support upto 31 GPIO pins. It will not support all the potential 46 GPIO on compute IO either.
Re: Raspberry Pi Compute Module
Posted: Tuesday 23 February 2016 18:26
by paulvha
I gave a try to make some updates the Gpio.cpp:
it will now support all the GPIO up to 31
it SHOULD now support 45 GPIO on Compute Module. However as I don't have a Compute Module I can not test.
Maybe the owners of Domoticz want to include this in a next Beta, otherwise if you know how to compile the source, you could try it yourself.
cd hardware
cp Gpio.cpp Gpio.org
cp the attached Gpio.cpp in hardware
recompile
Make sure that WiringPi development is installed:
git clone git://git.drogon.net/wiringPi
// make the utilities
cd wiringPi
./build
// to copy the library to the right place
cd wiringPi
make static
sudo make install-static
// now make Domoticz
cd domoticz_source_directory
rm CmakeCache.txt
cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
make ( !!!!will take ~ one hour)
Re: Raspberry Pi Compute Module
Posted: Friday 26 February 2016 13:36
by Harty123
Dear Paul,
thx for this fast beedback and solution. Unfortunately I can't find a file "Gpio.cpp" or a directory "hardware/" on my system?! Do I should replace the wiringPi gpio.c file in /wiringPi/gpio with your file?
Thx and Best Regards
Hartmut
Re: Raspberry Pi Compute Module
Posted: Friday 26 February 2016 17:40
by paulvha
you need the source code to build Domoticz from the start to include this file :
https://github.com/domoticz/domoticz.
Paul