RPi Bluetooth

From Datateknik
Revision as of 07:47, 14 May 2018 by Imra (Talk | contribs)

Jump to: navigation, search

hello

Contents

Bluetooth

device testing

  1. Check what devices you've got
    lsusb
  2. Basic installation checks: The Pi 3's built-in Bluetooth adapter is called hci0. You can check it is operating correctly with the command:
    hciconfig
  3. If you are on a laptop two(2) hci devices will show up, the first one is buggy
    hciconfig hci0 down
  4. Now you can try scanning for BLE devices
    hcitool lescan

Python programs

  1. do stuff
    sudo apt-get install python-pip
    sudo apt-get install libglib2.0-dev
    sudo pip install bluepy
    blescan

Setting an IPv6 address

Programming in python

från tysk sida

https://forum.fhem.de/index.php?topic=68019.15


Hi und danke erstmal,

bin jetzt soweit mit fast allen befehlen durch 

Code: [Auswählen]
pi@raspberrypi:~ $ ls -l /dev/ser*
lrwxrwxrwx 1 root root 7 Feb 28 23:59 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Feb 28 23:59 /dev/serial1 -> ttyS0

das sieht schon mal gut aus, lt. deinem Howto
allerdings bekomme ich dennoch kein Device : 

Code: [Auswählen]
pi@raspberrypi:~ $ hcitool dev
Devices:
pi@raspberrypi:~ $ hcitool scan
Device is not available: No such device
pi@raspberrypi:~ $ 

glaub bin zu müde oder zu blind.
habt Ihr eine Idee ??

danke


pi@raspberrypi:~ $  systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Do 2017-03-09 22:05:23 CET; 22s ago
     Docs: man:bluetoothd(8)
 Main PID: 794 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─794 /usr/lib/bluetooth/bluetoothd
pi@raspberrypi:~ $ sudo service bluetooth status
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Do 2017-03-09 22:05:23 CET; 27s ago
     Docs: man:bluetoothd(8)
 Main PID: 794 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─794 /usr/lib/bluetooth/bluetoothd

pi@raspberrypi:~ $ sudo hciconfig dev
Can't get device info: No such device

pi@raspberrypi:~ $ sudo bluetoothctl
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# scan on
No default controller available
[bluetooth]# exit
Agent unregistered


pi@raspberrypi:~ $ dmesg | grep Blue
[   22.873317] Bluetooth: Core ver 2.22
[   22.873369] Bluetooth: HCI device and connection manager initialized
[   22.873381] Bluetooth: HCI socket layer initialized
[   22.873389] Bluetooth: L2CAP socket layer initialized
[   22.873408] Bluetooth: SCO socket layer initialized
[  103.040851] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[  103.040860] Bluetooth: BNEP filters: protocol multicast
[  103.040871] Bluetooth: BNEP socket layer initialized






so alles was mit Bluetooth zu tun hat gelöscht und folgendes getan

Code: [Auswählen]
sudo apt-get install raspberrypi-sys-mods

sudo apt-get --reinstall install pi-bluetooth

sudo shutdown -r now


dann 

Code: [Auswählen]
sudo systemctl start hciuart.service
pi@raspberrypi:~ $ systemctl status hciuart.service
● hciuart.service - Configure Bluetooth Modems connected by UART
   Loaded: loaded (/lib/systemd/system/hciuart.service; disabled)
   Active: active (running) since Fr 2017-03-10 00:17:11 CET; 5s ago
  Process: 951 ExecStart=/usr/bin/btuart (code=exited, status=0/SUCCESS)
 Main PID: 962 (hciattach)
   CGroup: /system.slice/hciuart.service
           └─962 /usr/bin/hciattach /dev/serial1 bcm43xx 460800 noflow -



und siehe da!!!

Code: [Auswählen]
pi@raspberrypi:~ $ hcitool dev
Devices:
	hci0	B8:27:EB:90:BC:6D

es geht!!

danke an alle!
Personal tools
Namespaces

Variants
Actions
Navigation
Tools