Raspberry Pi Compute Module

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

Post Reply
Harty123
Posts: 5
Joined: Monday 22 February 2016 9:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Raspberry Pi Compute Module

Post 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
paulvha
Posts: 40
Joined: Friday 29 January 2016 16:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Raspberry Pi Compute Module

Post by paulvha »

does not seem to be able to find the pins.

Any log messages e.g. around not exported pins ?
Harty123
Posts: 5
Joined: Monday 22 February 2016 9:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi Compute Module

Post by Harty123 »

thx for the ultra fast reply ;-)

"gpio exports" command works fine:
Screen_putty.png
Screen_putty.png (49.63 KiB) Viewed 1561 times
paulvha
Posts: 40
Joined: Friday 29 January 2016 16:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Raspberry Pi Compute Module

Post 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
Harty123
Posts: 5
Joined: Monday 22 February 2016 9:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi Compute Module

Post 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
paulvha
Posts: 40
Joined: Friday 29 January 2016 16:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Raspberry Pi Compute Module

Post 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.
paulvha
Posts: 40
Joined: Friday 29 January 2016 16:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Raspberry Pi Compute Module

Post 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)
Attachments
Gpio.cpp
updated Gpio.cpp
(24 KiB) Downloaded 62 times
Harty123
Posts: 5
Joined: Monday 22 February 2016 9:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi Compute Module

Post 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
paulvha
Posts: 40
Joined: Friday 29 January 2016 16:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Raspberry Pi Compute Module

Post by paulvha »

you need the source code to build Domoticz from the start to include this file : https://github.com/domoticz/domoticz.

Paul
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest