CC1101: "no physical device found"

Hier nun der Versuch mit einem anderen Modul:




mit dieser Config:

ergibt mir folgende Fehlermeldung:

Wo kann hier der Fehler liegen? Ich habe es mit 2 dieser Module versucht.

Hi,

mach bitte mal ein Log vom Start von homegear mit debug-level 5.

Füg dann das Log als Text in einen Code-Block vom Forum ein.
Falls du mit Putty auf deinem Pi bist: Wenn man im Putty-Fenster den Text mit der Maus markiert, ist er in der Zwischenablage.

Die Ausgabe von ls -la /dev/spi* wäre auch noch interessant.

Setzt du das homegear raspbian-Image ein oder hast du homegear selbst installiert?

Ich hatte mir einem sehr ähnliches Modul leider keinen Erfolg: CC1101 über SPI: Error function std::vector<unsigned char>
Allerdings hatte ich auch andere Fehlermeldungen als du. Aktuell sieht es danach aus, als ob du überhaupt keine Verbindung zum CC1100 hast.

Vom Anschluss her sieht es richtig aus:

so long,
p

Moin,

Das Modul sieht gut aus, allerdings ist es aus meiner Sichtweise falsch angeschlossen. Wenn wir das letzte Bild von pmayer als Referenz nehmen, meine ich erkennen zu können, daß die SPI Pins falsch angeschlossen sind.

Referenz Bild (topdown): 3,3v - GND - MOSI - MISO - SCLK - GPIO25 - SPIO CS0 Dein Anschluss (von rechts nach links): 3,3v - GND - MOSI - SLCK - MISO - GPIO25 - SPIO CS0

Für mich sieht es so aus, als ob Du SLCK und MISO vertauscht hast.

Oder irre ich mich?

Gruß,
shizzleslick

@shizzleslick ich glaub die verkabelung müsste stimmen, ist verwirrend weil die farb reihenfolge anders ist. (oder ich bin jetzt vollends verwirrt)

pi@ras:~ $ ls -la /dev/spi* crw-rw---- 1 homegear homegear 153, 0 Nov 16 09:17 /dev/spidev0.0 crw------- 1 root root 153, 1 Nov 16 09:17 /dev/spidev0.1

dl 5 Debug level set to 5. pi@ras:~ $ sudo service homegear restart pi@ras:~ $ sudo tail -n 1000 -f /var/log/homegear/homegear.log 11/16/16 14:38:29.248 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:38:30.248 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:38:30.248 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:38:31.249 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:38:31.249 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:38:32.250 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:38:32.250 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:38:33.250 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:38:33.251 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files ... 11/16/16 14:44:16.538 Info: CLI connection accepted. Client number: 18020 11/16/16 14:44:17.535 Error in file Systems/IPhysicalInterface.cpp line 331 in function virtual void BaseLib::Systems::IPhysicalInterface::openGPIO(uint32_t, bool): Failed to open GPIO value file "/sys/class/gpio/gpio25/value": Too many open files 11/16/16 14:44:17.535 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:38.556 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:39.557 Error in file Systems/IPhysicalInterface.cpp line 331 in function virtual void BaseLib::Systems::IPhysicalInterface::openGPIO(uint32_t, bool): Failed to open GPIO value file "/sys/class/gpio/gpio25/value": Too many open files 11/16/16 14:44:39.557 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:39.557 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:40.558 Error in file Systems/IPhysicalInterface.cpp line 331 in function virtual void BaseLib::Systems::IPhysicalInterface::openGPIO(uint32_t, bool): Failed to open GPIO value file "/sys/class/gpio/gpio25/value": Too many open files 11/16/16 14:44:40.558 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:40.558 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:41.559 Error in file Systems/IPhysicalInterface.cpp line 331 in function virtual void BaseLib::Systems::IPhysicalInterface::openGPIO(uint32_t, bool): Failed to open GPIO value file "/sys/class/gpio/gpio25/value": Too many open files 11/16/16 14:44:41.559 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:41.559 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:42.356 Connection to client number 18020 closed. 11/16/16 14:44:42.560 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:42.560 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:43.561 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:43.561 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:44.561 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:44.562 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:45.562 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:45.563 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:46.563 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:46.563 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:47.564 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:47.564 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:48.565 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:48.565 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:49.565 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:49.566 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:49.653 (Shutdown) => Stopping Homegear (Signal: 15) 11/16/16 14:44:49.653 (Shutdown) => Stopping CLI server 11/16/16 14:44:50.566 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:50.567 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files 11/16/16 14:44:50.574 Debug: Waiting for CLI client threads to finish. 11/16/16 14:44:50.574 Debug: Joining read thread of CLI client 0 11/16/16 14:44:50.574 Debug: CLI client 0 removed. 11/16/16 14:44:50.574 Stopping UPnP server... 11/16/16 14:44:51.339 (Shutdown) => Stopping RPC servers 11/16/16 14:44:51.567 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:51.571 Module MAX: TI CC110X "My-MAX-CC1101": Error (check) writing to register 62. 11/16/16 14:44:51.571 Module MAX: TI CC110X "My-MAX-CC1101": Debug: CC1100: Setting GPIO direction 11/16/16 14:44:51.571 Module MAX: TI CC110X "My-MAX-CC1101": Debug: CC1100: Setting GPIO edge 11/16/16 14:44:51.657 MQTT Client: Debug: Packet received: D000 11/16/16 14:44:51.657 MQTT Client: Debug: Received ping response. 11/16/16 14:44:52.092 RPC Server (Port 2001): Info: Waiting for threads to finish. 11/16/16 14:44:52.216 RPC Server (Port 2002): Info: Waiting for threads to finish. 11/16/16 14:44:52.572 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:52.575 Module MAX: TI CC110X "My-MAX-CC1101": Error (check) writing to register 62. 11/16/16 14:44:52.576 Module MAX: TI CC110X "My-MAX-CC1101": Debug: CC1100: Setting GPIO direction 11/16/16 14:44:52.576 Module MAX: TI CC110X "My-MAX-CC1101": Debug: CC1100: Setting GPIO edge 11/16/16 14:44:53.073 RPC Server (Port 2003): Info: Waiting for threads to finish. 11/16/16 14:44:53.077 (Shutdown) => Stopping Event handler 11/16/16 14:44:53.078 (Shutdown) => Stopping MQTT client 11/16/16 14:44:53.576 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect... 11/16/16 14:44:53.580 Module MAX: TI CC110X "My-MAX-CC1101": Error (check) writing to register 62.

11/16/16 14:38:29.248 Module MAX: TI CC110X "My-MAX-CC1101": Couldn't create lockfile /var/run/homegear/LCK..spidev0.0: Too many open files
11/16/16 14:38:30.248 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect...
[...]
Failed to open GPIO value file "/sys/class/gpio/gpio25/value": Too many open files

Sieht ja zumindest schon mal nach einem Fehler aus. Das wäre denke zu erst zu lösen… und ich glaube @shizzleslick hat recht, was den Anschluss angeht.
Soweit kommst du allerdings gerade noch nicht…

Selbst installiert oder homegear image?

Selbst installiert. Was bedeutet es das da 2 spidev da sind? ist das nur wegen den 2 usern root/homegear. Oder hat der da weil ich 2 module probiert hab (bzw 3 mit dem 433 mhz davor) irgendwie 2 angelegt und kommt deshalb nicht klar?
Wie kann ich die wieder löschen und von vorne starten?

Devices kannst du nicht einfach so löschen. Das ist schon ok so, mir ging es nur um die Berechtigung und die scheint zu stimmen.

Dein (erstes) Problem befindet sich im Logausschnitt den ich gepostet habe.

Hast du alle Schritte aus der Dokumentation befolgt? https://doc.homegear.eu/data/homegear-homematicbidcos/configuration.html#texas-instruments-cc1101
Speziell die udev-Rule?

Was läuft noch auf dem Pi? Und poste bitte mal den Inhalt von /etc/security/limits.conf.

@sathya, hast du da vielleicht noch ne Idee?

Moin,

Der RPi3 hat zwei SPI Schnittstellen (devices) SPI0 und SPI1(wie Du auch auf dem Pinout sehen kannst; in violett)

Ist also vollkommen richtig so. Die kannst Du nicht löschen, brauchst Du auch gar nicht.

Gruß,
shizzleslick

1 Like

Hier die Limits.conf

# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#        - NOTE: group and wildcard limits are not applied to root.
#          To apply a limit to the root user, <domain> must be
#          the literal username root.
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open files
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#        - chroot - change root to directory (Debian-specific)
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#root            hard    core            100000
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#ftp             -       chroot          /ftp
#@student        -       maxlogins       4

# End of file

sudo rm /etc/udev/rules.d/99-com.rules
rm: das Entfernen von „/etc/udev/rules.d/99-com.rules“ ist nicht möglich: Datei oder Verzeichnis nicht gefunden

Kann man sich den SPI vom Raspberry durch falsch anschließen des Moduls zerschießen?

Hmm… nicht,dass ich wüsste. @shizzleslick, hast du noch ne Idee?

Ich versteh nicht, warum du too many open files hast? Eventuell kannst du das ulimit mal erhöhen: http://serverfault.com/questions/20387/debian-too-many-open-files

Ansonsten installier doch erst mal das homegear-Raspbian Image auf ner zweiten SD-Karte um zu checken ob deine Hardware in Ordnung ist.
Momentan hast du als aller erstes ein Problem mit deiner Installation…

Huh … das ist ein bißchen “Kaffeesatz lesen” :slight_smile:
Was bei “too many open files” helfen würde, ist der output von “ulimit -a” und zwar mit dem User, der auch das SPI anspricht. Bei einer normalen Raspian Installation müsste unter “open files” 65536 stehen (bei mir als user root und user pi), was absolut ausreichend ist.

Was ich an Deiner Stelle machen würde, ist Dir folgendes kleines Programm runterladen


Das kompilierst Du auf Deinem Pi und rufst es mit:
./spidev_test -D /dev/spidev0.0
auf.

Auf meinem RPi3 sieht das zum Beispiel so aus:

root@slickscentral:~# ./spidev_test -D /dev/spidev0.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

10 87 D5 35 61 10
B0 BE 9A 76 52 2E
C7 B4 DE 87 86 8B
8D 12 A9 2C 27 01
0B 2E 4F E0 8B B5
56 CB 5A 00 71 D3
DF 42

So schließt Du erstmal die meisten “Komponenten” aus und sprichst direkt mit dem SPI.

Gruß,
shizzleslick

1 Like

ulimit a gibt mit auch open files 65536 aus.

spidev_test:
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
RX | FC 0C 1C 7F 01 FF 86 6F 10 AF E5 68 BC 79 F4 1A 7E 56 00 5F 80 BD 51 BD 54 95 99 46 EC 80 65 12 | ▒…▒o.▒▒h▒y▒.~V._▒▒Q▒T▒▒F▒e.

Ich versuch es ansonsten sobald ich eine hab mit einer frischen Installation auf einer neuen SD Karte nochmal…

1 Like