Seite 1 von 1

TxT 4.0 Recherchen für Python Bluetooth support

Verfasst: 16 Mai 2024, 21:36
von rbudding
Hi
Vielleicht völlig unnötig, aber nach einigen Recherchen zu einer Bluetooth-Python-Implementierung auf dem TXT 4.0 finden Sie hier eine kleine Dokumentation zum installierten Code:

Code: Alles auswählen

ft@txt40-XKLx:/usr/lib/python3.5/site-packages/fischertechnik$ ls -lsa
total 60
4 drwxr-xr-x  13 root root 4096 Feb 23 18:14 .
8 drwxr-xr-x 160 root root 8192 Feb 23 18:14 ..
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 camera
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 control
4 drwxr-xr-x   4 root root 4096 Feb 23 18:14 controller (--> cd txt4 directory for the implementation files)
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 events
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 factories
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 http
4 -rw-r--r--   1 root root   76 Feb 23 17:39 __init__.py
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 machine_learning
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 models
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 mqtt
4 drwxr-xr-x   2 root root 4096 Feb 23 18:14 __pycache__
4 drwxr-xr-x   3 root root 4096 Feb 23 18:14 utility

Verbindung zum txt

Code: Alles auswählen

1. ssh ft@ip-Txt4.0
password fischertechnik
2a. cd / 
2b. find . -print |grep fischertechnik
3. cd /usr/lib/python3.5/site-packages/fischertechnik/controller/txt4
4. more Txt4GestureSensor.py
Eine Suche nach dem Bluetooth-Python-Modul ist erforderlich unter: #import bluetooth
(module PyBluez)

Code: Alles auswählen

1. pip3 list
2. No module pybluez installed (--> bluetooth.c and .h are missing)
3. pip3 install pybluez

In file included from bluez/btmodule.c:20:
    bluez/btmodule.h:5:10: fatal error: bluetooth/bluetooth.h: No such file or directory
     #include <bluetooth/bluetooth.h>
              ^~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'arm-ostl-linux-gnueabi-gcc' failed with exit status 1

Leider sind erneut Root-Rechte erforderlich, um den letzten Schritt richtig zu machen

Code: Alles auswählen

ft@txt40-XKLx:~$ sudo apt-get install libbluetooth-dev

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password: 
To Be Continued....

Gruss R