ich habe auch mal wieder Zeit zum Basteln gefunden und versuche derzeit, einen CC1101 über SPI an ein Orange PI anzuschließen und mit Armbian zu betreiben. Eigentlich bin ich gefühlt kurz vor dem Ziel, aber leider werden keinerlei SPI-Pakete geloggt. Die SPI-Kommunikation klappt offenbar problemlos.
Zur Verifizierung habe ich ein 2. CC1101-Modul angeschlossen, der Effekt bleibt jedoch unverändert. Die Module sind m. E. zu 100% für 868 MHz konzipiert.
Hier mal ein Auszug aus dem Logfile:
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Sending: 3EC0
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Received: 0F0F
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Sending: BE00
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Received: 00C0
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Sending: 3A
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Received: 0F
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Sending: 3A
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Received: 0F
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Sending: 34
09/05/16 16:35:26.835 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Received: 0F
09/05/16 16:35:26.836 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: CC1100: Setting GPIO direction
09/05/16 16:35:26.836 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: CC1100: Setting GPIO edge
09/05/16 16:35:26.836 Debug: Thread priority successfully set to: 45
09/05/16 16:35:26.837 Debug: Thread priority successfully set to: 45
09/05/16 16:35:26.837 Initializing RPC client...
09/05/16 16:35:26.837 Starting XML RPC server RPCServer1 listening on 0.0.0.0:2001...
09/05/16 16:35:26.837 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Sending: F300
09/05/16 16:35:26.837 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Received: 1000
09/05/16 16:35:26.837 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: BidCoS packet received, but CRC failed.
09/05/16 16:35:26.837 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Sending: 3A
09/05/16 16:35:26.838 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Received: 1F
09/05/16 16:35:26.838 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Sending: 34
09/05/16 16:35:26.838 Module HomeMatic BidCoS: TI CC110X "CC1101": Debug: Received: 1F
Die GPIO Dokumentation ist etwas dünn. Hier das Layout: cnx-software.com/2015/09/26/ … o-support/
Interessant sind die roten Beschriftungen, dass sind die relevanten GPIOs.
PC* unterstützt jedoch bspw. kein GPIO edge, sodass ein Pin mit PA* genommen werden sollte. Ich habe es jetzt erfolgreich mit PA10 probiert.
Der numerische GPIO (für die Angabe in der Homegear-Konfiguration) erreichnet sich aus: 32 * (Position des 2. Buchstaben im Alphabet - 1) + Nummer
PA10 ist also GPIO 10, PC7 wäre beispielsweise die 71.
Leider läuft es noch nicht stabil, die Erkennung von Paketen läuft für einige Zeit sehr gut und fällt dann plötzlich aus.
Etwas Forschungsarbeit ist also noch notwendig.
Ich hab folgendes bisher probiert /etc/modules-load.d habe ich w1-sunxi / w1-gpio / w1-therm das # entfernt.
ls -al /dev/spi*
crw-rw---- 1 homegear homegear 153, 0 Jan 2 14:13 /dev/spidev0.0
sudo homegear -r
01/02/17 14:56:23.068 Could not connect to socket. Error: No such file or directory
01/02/17 14:56:23.070 Could not connect to socket. Error: No such file or directory
dmesg | grep spi
[ 0.813528] sunxi_spi_chan_cfg()1376 - [spi-0] has no spi_regulator.
[ 0.813558] sunxi_spi_chan_cfg()1376 - [spi-1] has no spi_regulator.
[ 0.814636] spi spi0: master is unqueued, this is deprecated
ich habe dieses Pinout benutzt hier kombiniert mit dem CC1101 hier
PA10 habe ich als GPIO1 = 10 gesetzt
01/03/17 10:54:44.995 Starting Homegear...
01/03/17 10:54:44.995 Homegear version 0.6.7-1545
01/03/17 10:54:44.996 Git commit SHA of libhomegear-base: -
01/03/17 10:54:44.996 Git branch of libhomegear-base: -
01/03/17 10:54:44.996 Git commit SHA of Homegear: -
01/03/17 10:54:44.996 Git branch of Homegear: -
01/03/17 10:54:44.997 Info: Setting allowed core file size to "4294967295" for user with id 0 and group with id 0.
01/03/17 10:54:44.998 Info: Core file size now is "4294967295".
01/03/17 10:54:44.998 Info: Setting maximum thread priority to "4294967295" for user with id 0 and group with id 0.
01/03/17 10:54:44.998 Info: Maximum thread priority now is "4294967295".
01/03/17 10:54:45.006 Info: Backing up database...
01/03/17 10:54:45.152 Initializing database...
01/03/17 10:54:45.158 Info: Loading family module mod_max.so
01/03/17 10:54:45.169 /etc/homegear/families/max.conf
01/03/17 10:54:45.171 Info: Loading family module mod_miscellaneous.so
01/03/17 10:54:45.175 /etc/homegear/families/miscellaneous.conf
01/03/17 10:54:45.176 Info: Setting up physical interfaces and GPIOs...
01/03/17 10:54:45.177 Error: Could not export GPIO with index 1 and number 10 for device "cc1100": Device or resource busy
01/03/17 10:54:45.178 Error in file Systems/IPhysicalInterface.cpp line 553 in function virtual void BaseLib::Systems::IPhysicalInterfac$
01/03/17 10:54:45.178 Info: Dropping privileges to user homegear (108) and group homegear (114)
01/03/17 10:54:45.179 Info: Homegear is (now) running as user with id 108 and group with id 114.
01/03/17 10:54:45.179 Starting script engine server...
01/03/17 10:54:45.229 Initializing licensing controller...
01/03/17 10:54:45.229 Loading licensing controller data...
01/03/17 10:54:45.229 Loading devices...
01/03/17 10:54:45.229 Loading XML RPC devices...
01/03/17 10:54:45.356 Loading device 2
01/03/17 10:54:45.358 Loading XML RPC devices...
01/03/17 10:54:45.361 Loading device 1
01/03/17 10:54:45.362 Start listening for packets...
01/03/17 10:54:45.364 Module MAX: TI CC110X "My-MAX-CC1101": Error (check) writing to register 0.
01/03/17 10:54:45.364 Failed to open direction file for GPIO with index 1 and device "cc1100": Unable to retrieve path.
01/03/17 10:54:45.365 Failed to open edge file for GPIO with index 1 and device "cc1100": Unable to retrieve path.
01/03/17 10:54:45.365 Error in file Systems/IPhysicalInterface.cpp line 331 in function virtual void BaseLib::Systems::IPhysicalInterfac$
01/03/17 10:54:45.365 Module MAX: TI CC110X "My-MAX-CC1101": Error in file PhysicalInterfaces/TICC1100.cpp line 813 in function void MAX$
01/03/17 10:54:45.366 Module MAX: TI CC110X "My-MAX-CC1101": Connection to TI CC1101 closed unexpectedly... Trying to reconnect...
01/03/17 10:54:45.366 Critical: At least one of the physical devices could not be opened... Exiting...
01/03/17 10:54:45.368 Module MAX: TI CC110X "My-MAX-CC1101": Error (check) writing to register 0.
01/03/17 10:54:45.368 Failed to open direction file for GPIO with index 1 and device "cc1100": Unable to retrieve path.
01/03/17 10:54:45.369 Failed to open edge file for GPIO with index 1 and device "cc1100": Unable to retrieve path.
Ich benutzte auch Armbian. Das SPI schon aktiv sein müsste hab ich auch gelesen, aber wollte das überprüfen.
PS: sieht aus als hätte ich etwas falsch angeschlossen oder?
Bei einem lsmod solltest du sehen, welche Module vom Kernel geladen wurden. Mit modprobe <modulname> kannst du Mobule zur Laufzeit in den Kernel laden.
#######################################
########## TI CC1101 Module ##########
#######################################
## The device family this interface is for
[TI CC1101 Module]
## Specify an unique id here to identify this device in Homegear
id = My-MAX-CC1101
## When default is set to "true" Homegear will assign this device
## to new peers.
default = true
## Options: cul, coc, cc1100
deviceType = cc1100
device = /dev/spidev0.0
## Default: responseDelay = 95
## Should be "40" for CUL or COC and "45" for TI CC1101.
responseDelay = 45
## The interrupt pin to use. "0" for GDO0 or "2" for GDO2.
## You only need to connect one of them. Specify the GPIO
## you connected the interrupt pin to below.
interruptPin = 2
## The GPIO GDO0 or GDO2 is connected to. Specify which GDO to use above.
gpio1 = 10
### Additional TI CC1190 Config ###
## The GPIO high gain mode of the CC1190 is connected to.
## Default: -1 (disabled)
#gpio2 = 5
## The hexadecimal value for the PATABLE of the TI CC1101.
## Default:
## - Without high gain mode: 0xC2
## - With high gain mode: 0x27 (maximum legally allowed setting)
#txPowerSetting = 0x27
ja ich glaube aber auch das das SPI Modul grade nicht das Problem ist oder.
lsmod ist nicht hilfreich, weil SPI bei Armbian direkt in den Kernel mit einkompiliert wurde und daher nicht als Modul zur Verfügung steht.
Dem Fehler nach würde ich zunächst nicht auf die Verkabelung tippen, sondern er kann schon nicht auf die GPIOs zugreifen. Fehlt eventuell der Export für den PIN?
“Failed to open direction file for GPIO”
echo “10” > /sys/class/gpio/export
ls -al /sys/class/gpio/gpio10
Die Meldung kommt für gewöhnlich, wenn der PIN schon exportiert wurde.
Was liefert der 2. Befehl ls -al …?
Ich habe keinen Zero, aber die Verkabelung und PIN-Zuordnung erscheint mir noch wirr. Sowohl das Pinout würde ich anzweifeln, aber auch die Verkabelung: Lila ist beim CC1101 auf CS und gehört damit eigentlich an SP1_CS.
wie schon weiter oben beschreiben, leider findet er garnicht erst das Verzeichnis
pi@orangepizero:~$ ls -al /sys/class/gpio/gpio10
ls: cannot access /sys/class/gpio/gpio10: No such file or directory
pi@orangepizero:~$ sudo ls -al /sys/class/gpio/gpio10
ls: cannot access /sys/class/gpio/gpio10: No such file or directory
Hab hier mal für euch einen kleinen Auszug des Ordners erstellt, vielleicht fällt euch was unstimmiges dabei auf.
Du hast aktuell das Problem, dass das “Gerät” gpio10 nicht vorhanden ist. Es kann also nichts drauf zugreifen.
Ich kenne leider Armbian nicht und wie man da GPIO-Funktionalität einschaltet.
Offiziell ist es nicht verfügbar, du musst es also via GIT auschecken - wie es geht, steht etwa mittig
Du solltest erst einmal versuchen, weitere PINs zu exportieren. Ist der Export erfolgreich, sollte der Eintrag unter “sudo ls -la /sys/class/gpio” ersichtlich werden. Das geht auch mit dem Tool. Nicht jeder PIN ist beim Orange PI geeignet, eventuell lässt sich der PIN 10 / PA10 nicht exportieren.
ich verstehe auch nicht wie er mir 40 pins anzeigen kann wenn das Board nur 26 hat. Vermutlich sind diese WiringPi/OP momentan eher unkompatibel. Armbian Diskussion dazu
Dort ist auch nochmal das Pinout beschreiben. Allerdings weiß ich nicht von welcher Richtung aus die zählen. Ich schätz mal es wird von Richtung der SD Karte aus gezählt, dann würde es mit meinem Pinout und dem auf dem Bild übereinstimmen.
pi@orangepizero:~$ gpio export 10 out
gpio: Unable to open GPIO direction interface for pin 10: No such file or directory
habe auch mal dahier probiert, da er aber glaube ich versucht ein Modul zu laden dass es unter armbian nicht gibt, schlägt es fehl?
pi@orangepizero:~$ gpio load spi
sh: 1: modprobe: not found
sh: 1: modprobe: not found
gpio: Unable to load spi-sun7i
Irgendwie fühl ich mich ziemlich in der Sackgasse. Hab ihr noch weitere Ideen, bzw hab ich etwas falsch gemacht?