Problem with RPi Nano

Post Reply
mackowiakp
Posts: 7
Joined: Friday 21 July 2017 19:26
Target OS: Linux
Domoticz version:
Contact:

Problem with RPi Nano

Post by mackowiakp » Monday 26 February 2018 18:04

I installed Domoticz on RPi Nano and it works good. But I have problem with cooperation Domoticz and GPIO. GPIO is set to sysfs GPIO, and it automatically recognised exported pins. But if I use particular pin as output port, it is possible to set/rest it using gpio command but it is not possible from Domoticz defined On/Off switch. No errors in logs.

Below outputs fron console:

Code: Select all

root@NanoPi-NEO:~# gpio readall
 +-----+-----+----------+------+---+-NanoPi-NEO--+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     3.3V |      |   |  1 || 2  |   |      | 5V       |     |     |
 |  12 |   8 |  GPIOA12 | ALT5 | 0 |  3 || 4  |   |      | 5V       |     |     |
 |  11 |   9 |  GPIOA11 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
 | 203 |   7 |  GPIOG11 |  OUT | 0 |  7 || 8  | 0 | OUT  | GPIOG6   | 15  | 198 |
 |     |     |       0v |      |   |  9 || 10 | 0 | ALT5 | GPIOG7   | 16  | 199 |
 |   0 |   0 |   GPIOA0 | ALT5 | 0 | 11 || 12 | 0 | OUT  | GPIOA6   | 1   | 6   |
 |   2 |   2 |   GPIOA2 |  OFF | 0 | 13 || 14 |   |      | 0v       |     |     |
 |   3 |   3 |   GPIOA3 |  OFF | 0 | 15 || 16 | 0 | OFF  | GPIOG8   | 4   | 200 |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | OFF  | GPIOG9   | 5   | 201 |
 |  64 |  12 |   GPIOC0 | ALT4 | 0 | 19 || 20 |   |      | 0v       |     |     |
 |  65 |  13 |   GPIOC1 | ALT4 | 0 | 21 || 22 | 0 | ALT5 | GPIOA1   | 6   | 1   |
 |  66 |  14 |   GPIOC2 | ALT4 | 0 | 23 || 24 | 1 | OUT  | GPIOC3   | 10  | 67  |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+-NanoPi-NEO--+------+----------+-----+-----+

 +-----+----NanoPi-NEO Debug UART-+----+
 | BCM | wPi |   Name   | Mode | V | Ph |
 +-----+-----+----------+------+---+----+
 |   4 |  17 |   GPIOA4 | ALT5 | 0 | 37 |
 |   5 |  18 |   GPIOA5 | ALT5 | 0 | 38 |
 +-----+-----+----------+------+---+----+
 
 root@NanoPi-NEO:~# gpio exports
GPIO Pins exported:
   7: out  1  none    
  15: out  0  none
So I exported pin according to WiringPi numbering. So what I am doing wrong?

blauwebuis
Posts: 310
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Re: Problem with RPi Nano

Post by blauwebuis » Tuesday 27 February 2018 0:54

Have you tried the sysfs switches plugin?

https://github.com/flatsiedatsie/GPIO-SYSFS-Switches

mackowiakp
Posts: 7
Joined: Friday 21 July 2017 19:26
Target OS: Linux
Domoticz version:
Contact:

Re: Problem with RPi Nano

Post by mackowiakp » Tuesday 27 February 2018 7:24

OK. I downloaded and installed plugin.py according to https://www.domoticz.com/wiki/Plugins/G ... S-Switches

No lucky so far. Plugin running by itself shows such error:

Code: Select all

./plugin.py: line 12: syntax error near unexpected token `('
./plugin.py: line 12: `         <param field="Mode1" label="GPIO output pin numbers (comma separated)" width="100px" required="false" default=""/>'
Any idea what is wrong?

mackowiakp
Posts: 7
Joined: Friday 21 July 2017 19:26
Target OS: Linux
Domoticz version:
Contact:

Re: Problem with RPi Nano

Post by mackowiakp » Saturday 03 March 2018 7:36

OK. Finally I got it working. But, is it possible to reverse state of sysfs GPIO outputs in plugin? Of course it is necessary to use command like this:

Code: Select all

/bin/echo 1 > /sys/class/gpio/gpio#/active_low
But is it possible to change it when Domoticz plugin starts ? If so what I have to change?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests