Page 2 sur 2

Re: Domoticz off line apres ajout Gpio en entree

Publié : 27 nov. 2020, 09:33
par manuticz
Nouveaux essais : j'ai edité le domoticz.txt (log) avec les entrées configurées dans le domoticz.sh ...

dans ce cas domoticz ne démarre pas ...

Code : Tout sélectionner

2020-11-27 09:13:21.622  Status: Domoticz V2020.2 (c)2012-2020 GizMoCuz
2020-11-27 09:13:21.622  Status: Build Hash: b63341bc0, Date: 2020-04-26 13:47:55
2020-11-27 09:13:21.623  Status: Startup Path: /home/pi/domoticz/
2020-11-27 09:13:21.897  Sunrise: 08:19:00 SunSet: 17:14:00
2020-11-27 09:13:21.897  Day length: 08:55:00 Sun at south: 12:46:00
2020-11-27 09:13:21.897  Civil twilight start: 07:45:00 Civil twilight end: 17:48:00
2020-11-27 09:13:21.897  Nautical twilight start: 07:07:00 Nautical twilight end: 18:26:00
2020-11-27 09:13:21.897  Astronomical twilight start: 06:30:00 Astronomical twilight end: 19:02:00
2020-11-27 09:13:23.077  Status: PluginSystem: Started, Python version '3.7.3'.
2020-11-27 09:13:23.099  Active notification Subsystems: email (1/13)
2020-11-27 09:13:23.135  Status: WebServer(HTTP) started on address: :: with port 8080
2020-11-27 09:13:23.172  Status: WebServer(SSL) started on address: :: with port 443
2020-11-27 09:13:23.176  Status: Camera: settings (re)loaded
2020-11-27 09:13:23.222  Starting shared server on: :::6144
2020-11-27 09:13:23.223  Status: TCPServer: shared server started...
2020-11-27 09:13:23.224  Status: RxQueue: queue worker started...
2020-11-27 09:13:25.224  Status: GPIO: This hardware is deprecated. Please transfer to the new SysFS hardware type!
2020-11-27 09:13:25.232  Status: GPIO: Interrupt handler for GPIO 5 started (TID: 882)
2020-11-27 09:13:25.234  Status: GPIO: Interrupt handler for GPIO 6 started (TID: 883)
2020-11-27 09:13:25.282  Status: (Compteur general) Started.
2020-11-27 09:13:25.282  Status: Darksky: Started...
2020-11-27 09:13:25.282  Status: GPIO: This hardware is deprecated. Please transfer to the new SysFS hardware type!
2020-11-27 09:13:25.283  Error: Domoticz(pid:730, tid:761('MainWorker')) received fatal signal 6 (Aborted)
2020-11-27 09:13:25.283  Error: siginfo address=0x2da, address=0xffffffff
2020-11-27 09:13:25.290  Status: GPIO: Interrupt handler for GPIO 5 started (TID: 889)
2020-11-27 09:13:31.036  Error: Thread 12 (Thread 0x6ffff220 (LWP 761)):
2020-11-27 09:13:31.036  Error: #0  __waitpid (options=0, stat_loc=0x6fffddc0, pid=890) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2020-11-27 09:13:31.036  Error: #1  __waitpid (pid=890, stat_loc=0x6fffddc0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
2020-11-27 09:13:31.036  Error: #2  0x002db8ec in dumpstack_gdb(bool) ()
2020-11-27 09:13:31.036  Error: #3  0x002dbeb8 in signal_handler(int, siginfo_t*, void*) ()
2020-11-27 09:13:31.036  Error: #4  <signal handler called>
2020-11-27 09:13:31.036  Error: #5  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
2020-11-27 09:13:31.036  Error: #6  0x769ad230 in __GI_abort () at abort.c:79
2020-11-27 09:13:31.036  Error: #7  0x0096d02c in __gnu_cxx::__verbose_terminate_handler() ()
2020-11-27 09:13:31.037  Error: #8  0x008d04cc in __cxxabiv1::__terminate(void (*)()) ()
2020-11-27 09:13:31.037  Error: #9  0x008d0540 in std::terminate() ()
2020-11-27 09:13:31.037  Error: #10 0x00263fbc in std::_Sp_counted_ptr_inplace<std::thread, std::allocator<std::thread>, (__gnu_cxx::_Lock_policy)1>::_M_dispose() $
ensuite, j'ai commenté les entrées et j'ai redémarré ...

pas d'erreur dans le log et domoticz est bien démarré ...

Re: Domoticz off line apres ajout Gpio en entree

Publié : 13 juil. 2021, 15:22
par manuticz
Salut, malgré les mises à jour, et la vérification du câblage, je pense que je suis bel et bien face à un Bug ....

Mes GPIO 5 et 6 sont configurés en Input, avec des contact normalement fermés qui basculent à la masse...
sur ces 2 GPIO j'ai mis des résistances de pullup au +3.3V.

Mon "gpio readall", me renvoit bien les infos (1 ou 0) lorsque les contacts s'ouvrent ...

Si je place la déclaration des GPIO en input à la fin du fichier domoticz.sh (après le "esac"), domoticz démarre correctement après reboot, je peux déclarer mes entrées dans domoticz en tant que nouveau matériel, et du coup créer des contacts qui vont bien...... mais l'état de ces entrées ne change jamais ... je regarde dans les logs, et fat bagotter l'entrée...

Si je place la déclaration des GPIO en input au début du fichier, domoticz ne démarre plus ...

Voici ce que j'ai inséré dans le fichier :

Code : Tout sélectionner

#gpio pinout et input
/usr/local/bin/gpio export 5 in
/usr/local/bin/gpio edge 5 both
/usr/local/bin/gpio export 6 in
/usr/local/bin/gpio edge 6 both
@+ :(

Re: Domoticz off line apres ajout Gpio en entree

Publié : 13 juil. 2021, 21:35
par adv
Bonsoir, tu as tenté l'option qui est mainetant recommandé (voir ton log c'est cette ligne qui m'a mis lapuce à l'oreille: 2020-11-27 09:13:25.224 Status: GPIO: This hardware is deprecated. Please transfer to the new SysFS hardware type!):

Le wiki Domoticz dit:
https://www.domoticz.com/wiki/GPIO

Option 1 - SYSFS

SysFS exposes the pins as if they were files on your harddrive. by writing to these files you can send signals. By reading the files you can listen to signals.

You don't have to install any additional software for SYSFS to work. But you will have to setup the pins for your use.

Using to GPIO map here RPI GPIO Maps choose the desired I/O

Example :

Find which GPIO pin you want to use. Figure out the GPIO number of the physical pin by looking at the maps here : RPI GPIO Maps
Export the GPIO pin (number 4 in this example) by calling this command:
echo 4 > /sys/class/gpio/export
Decide if the pin should be input or output:
echo out > /sys/class/gpio/gpio4/direction
You can manually set the output pins on or off using this command. One is on, zero is off.
echo 1 > /sys/class/gpio/gpio4/value echo 0 > /sys/class/gpio/gpio4/value

TIP: You have to give these commands every time you start linux, so it's smart to add these commands to a file like /etc/rc.local which gets called when the Pi boots. ("sudo nano /etc/rc.local"), or to the domoticz.sh file which gets called every time Domoticz starts.

set the interrupt if needed choice : rising / falling / both / none
echo none > /sys/class/gpio/gpio4/edge
Now, go to Domoticz' hardware page and install the Generic SYSFS GPIO hardware.

select auto configure device, the exported GPIO will appread in the device section ;-)

first way : Go to the "switches page" and add a new manual switch.

Select SYSFS as the option in the type dropdown.
You can set a unique number for the pin inside domoticz using the many dropdowns here. You can try just keeping them all at 0 for your first ever pin.
The SYSFS dropdown should show the pin you exported earlier. Select it.

second way : Go to "Device"

all exported GPIO are listed here

Enjoy ;-)