[TUTO] Scanner Bluetooth (BLE ou non)
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Bonjour,
Le scanner fonctionne t'il avec des bracelets genre Garmin ?
J'imagine que avec le plugin BLEA cela ne fonctionnera pas une fois connecté au téléphone.
Quand est-il de la rapidité de détection ?
Merci pour le travail effectué.
Sent from my ONEPLUS A3003 using Tapatalk
Le scanner fonctionne t'il avec des bracelets genre Garmin ?
J'imagine que avec le plugin BLEA cela ne fonctionnera pas une fois connecté au téléphone.
Quand est-il de la rapidité de détection ?
Merci pour le travail effectué.
Sent from my ONEPLUS A3003 using Tapatalk
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Quand je veux essayer le scan sur mon rpi j'ai l'erreur de typr Undefinied variable x à la ligne 308
J'ai bien lancer la fichier conf avant. Une idée ?
Sent from my ONEPLUS A3003 using Tapatalk
J'ai bien lancer la fichier conf avant. Une idée ?
Sent from my ONEPLUS A3003 using Tapatalk
- Fabrice
- Modérateur
- Messages : 3424
- Inscription : 27 oct. 2016, 22:26
- Localisation : Planète terre, IDF, 93
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Bonsoir,
Pour Blea... je vous l'ai dit en privé, c'est à "tester", vous pouvez le faire maintenant votre test
Ce qui est vrais pour un NUT ne l'ai pas forcément pour un bracelet connecté.
Pour Blea... je vous l'ai dit en privé, c'est à "tester", vous pouvez le faire maintenant votre test
Ce qui est vrais pour un NUT ne l'ai pas forcément pour un bracelet connecté.
Helper Officiel Jeedom
- Jeedom : 3.3.36
- Protocole : Z-Wave / RFXcom / BLEA
- Raspberry Pi : Pi 3 B+ / Pi 3 B / Pi Zero W
- Jeedom : 3.3.36
- Protocole : Z-Wave / RFXcom / BLEA
- Raspberry Pi : Pi 3 B+ / Pi 3 B / Pi Zero W
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Oui là j'ai testé avec mon portable. J'ai renseigné la config ( j'ai mi 0 pour le hci vu que c'est rpi3, puis l'adresse mac de mon portable et de type Bt)
Sent from my ONEPLUS A3003 using Tapatalk
Sent from my ONEPLUS A3003 using Tapatalk
- Fabrice
- Modérateur
- Messages : 3424
- Inscription : 27 oct. 2016, 22:26
- Localisation : Planète terre, IDF, 93
Re: [TUTO] Scanner Bluetooth (BLE ou non)
? (je ne comprend rien à votre explication...)
Un téléphone portable n'est pas détectable par BLEA
Un téléphone portable n'est pas détectable par BLEA
Helper Officiel Jeedom
- Jeedom : 3.3.36
- Protocole : Z-Wave / RFXcom / BLEA
- Raspberry Pi : Pi 3 B+ / Pi 3 B / Pi Zero W
- Jeedom : 3.3.36
- Protocole : Z-Wave / RFXcom / BLEA
- Raspberry Pi : Pi 3 B+ / Pi 3 B / Pi Zero W
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Oui mais ce scan fait bien les équipements BT classique non ?
- diving91
- Timide
- Messages : 372
- Inscription : 08 mars 2015, 18:29
- Localisation : Essonne (91)
- Contact :
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Bonsoir,Hydro a écrit : ↑22 oct. 2017, 09:10Bonjour,
Le scanner fonctionne t'il avec des bracelets genre Garmin ?
J'imagine que avec le plugin BLEA cela ne fonctionnera pas une fois connecté au téléphone.
Quand est-il de la rapidité de détection ?
Merci pour le travail effectué.
Sent from my ONEPLUS A3003 using Tapatalk
je ne pense pas que cela fonctionne avec un Garmin (du moins ça ne fonctionne pas bien avec un fitbit Charge 2) car s'il est connecté au téléphone, il n’envoie plus de notification.
Sinon la rapidité de détection est rapide - quelques secondes avec un nut (car ils envoient des notif environ toutes les 3s)
Diving91,
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
- diving91
- Timide
- Messages : 372
- Inscription : 08 mars 2015, 18:29
- Localisation : Essonne (91)
- Contact :
Re: [TUTO] Scanner Bluetooth (BLE ou non)
avec quel device Bluetooth ?
en ligne 308, tu es dans la partie device BLE (de type nut).
lors de la config, pour les nut, il faut dire que c'est un device BLE - Pour les telephones, il faut dire que c'est un device BT
tu as quelle version de php ? (php -v en ligne de commande)
je suis en version 5.6 - pas testé en version 7
juste avant la ligne 308, essaye un var_dump($x); pour voir ce que cela donne
Diving91,
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
- diving91
- Timide
- Messages : 372
- Inscription : 08 mars 2015, 18:29
- Localisation : Essonne (91)
- Contact :
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Oui tout a fait ! (je ne comprend pas les reponses de @Fabrice non plus)
Diving91,
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Désolé c'est encore abstrait pour moi. Un équipement BT classique peut envoyer des info même connecté (comme un portable) mais pas d'autre ?
Sent from my ONEPLUS A3003 using Tapatalk
Sent from my ONEPLUS A3003 using Tapatalk
- diving91
- Timide
- Messages : 372
- Inscription : 08 mars 2015, 18:29
- Localisation : Essonne (91)
- Contact :
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Oui tout a fait.
Les nut (ou BLE) n'envoient des notifs que lorsqu'ils ne sont pas connectés.
Les téléphones (BT) sont détectables avec ce script à partir du moment ou leur Bluetooth est activé
Dans ton cas (bug ligne 308, voir mon post plus haut) ... pour débugger:
je vois 2 pistes:
- ton fichier conf incorrect ?
- version de php supérieure à la mienne ? (je suis en raspbian Jessie)
Diving91,
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Je suis en version 5.6.30 pour PHP.
Tout a l'air OK dans BT.ini
Sent from my ONEPLUS A3003 using Tapatalk
Tout a l'air OK dans BT.ini
Sent from my ONEPLUS A3003 using Tapatalk
- diving91
- Timide
- Messages : 372
- Inscription : 08 mars 2015, 18:29
- Localisation : Essonne (91)
- Contact :
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Même version que moi pour PHP - Est-ce que tu peux m'envoyer ton BT.ini en MP pour que je regarde stp. (pas avant ce we car je ne serais pas devant un PC le reste de la semaine)
Diving91,
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Bonsoir,
Je réouvre ce post car je souhaite juste détecter la présence de nos téléphones portables Samsung dans la maison pour commander une clé Danalock V3 que je viens d'arriver à intégrer à Jeedom.
D'après ce que j'ai vu Blea ne voit pas les téléphones portables et j'ai l'impression que ce script oui.
Souci, je bidouille bien avec Jeedom, Raspi3 et linux en ligne de commande ; j'ai bien vu les explications ci-dessous, mais juste je voudrais savoir où me placer dans le Raspberry Pi 3 pour installer :
Merci
Je réouvre ce post car je souhaite juste détecter la présence de nos téléphones portables Samsung dans la maison pour commander une clé Danalock V3 que je viens d'arriver à intégrer à Jeedom.
D'après ce que j'ai vu Blea ne voit pas les téléphones portables et j'ai l'impression que ce script oui.
Souci, je bidouille bien avec Jeedom, Raspi3 et linux en ligne de commande ; j'ai bien vu les explications ci-dessous, mais juste je voudrais savoir où me placer dans le Raspberry Pi 3 pour installer :
Pourriez vous quelqu'un me dire où me placer pour lancer le unzip ?diving91 a écrit : ↑30 avr. 2017, 16:58il faut faire un wget https://github.com/diving91/Bluetooth-s ... master.zip
qu'il faut ensuite unzipper (apt-get install unzip).
puis en ssh tu lances php BTdaemon.php
Merci
Sigalou
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
- Site perso dédié domotique : Sigalou-domotique
- Support : Alexa-API WatchDog
- Documentation, Changelog et Todo-List : Alexa-API WatchDog
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Edit : c'est dans : /var/www/html/plugins ??
Sigalou
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
- Site perso dédié domotique : Sigalou-domotique
- Support : Alexa-API WatchDog
- Documentation, Changelog et Todo-List : Alexa-API WatchDog
- diving91
- Timide
- Messages : 372
- Inscription : 08 mars 2015, 18:29
- Localisation : Essonne (91)
- Contact :
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Bonjour désolé de ne pas trop répondre en ce moment, je suis trop occupé.
Réponse rapide:
Ce script peut être placé n'importe où:
- pas forcement sur le même PI que Jeedom
- pas forcement dans l'arborescence jeedom /var/www/...
- pas forcement dans l'arborescence "web" car il ne tourne pas en mode web mais en ligne de commande ..; donc depuis n'importe quel folder.
Chez moi il est dans un folder "/user/moi/BTscan"
Le lien avec jeedom se fait lors de la config au travers des ID des commandes on/off (ID des virtuels dans jeedom)
diving
Diving91,
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
Re: [TUTO] Scanner Bluetooth (BLE ou non)
OK, merci à toi, j'ai mis dans plugins et ça a fonctionné mais si ça marche partout, c'est logique.
Je fais des tests, c'est pas encore stabilisé mais ça va venir. merci pour ton programme !!
Je fais des tests, c'est pas encore stabilisé mais ça va venir. merci pour ton programme !!
Sigalou
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
- Site perso dédié domotique : Sigalou-domotique
- Support : Alexa-API WatchDog
- Documentation, Changelog et Todo-List : Alexa-API WatchDog
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Je fais des essais ce we, j'ai une erreur :
root@maitre:/var/www/html/plugins/Bluetooth-scanner-master# php BTdaemon.php start
Kill Bluetooth Daemon 32223
Starting Bluetooth Daemon
PHP Notice: Undefined variable: x in /var/www/html/plugins/Bluetooth-scanner-master/BTdaemon.php on line 308
root@maitre:/var/www/html/plugins/Bluetooth-scanner-master# 2017-11-25 19:33:12,826 - ERROR - Wrong json for TAGS: null
La ligne 308 c'est :
$x = addslashes(json_encode($x));
C'est dans threadBLEScanner, mais c'est bizarre j'ai qu'un equipement en BT, rien en BLE.
Je cherche...
root@maitre:/var/www/html/plugins/Bluetooth-scanner-master# php BTdaemon.php start
Kill Bluetooth Daemon 32223
Starting Bluetooth Daemon
PHP Notice: Undefined variable: x in /var/www/html/plugins/Bluetooth-scanner-master/BTdaemon.php on line 308
root@maitre:/var/www/html/plugins/Bluetooth-scanner-master# 2017-11-25 19:33:12,826 - ERROR - Wrong json for TAGS: null
La ligne 308 c'est :
$x = addslashes(json_encode($x));
C'est dans threadBLEScanner, mais c'est bizarre j'ai qu'un equipement en BT, rien en BLE.
Je cherche...
Sigalou
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
- Site perso dédié domotique : Sigalou-domotique
- Support : Alexa-API WatchDog
- Documentation, Changelog et Todo-List : Alexa-API WatchDog
- diving91
- Timide
- Messages : 372
- Inscription : 08 mars 2015, 18:29
- Localisation : Essonne (91)
- Contact :
Re: [TUTO] Scanner Bluetooth (BLE ou non)
Je viens de regarder mon code ... j'ai un bug quand il n'y a pas de device BLE - Sorrysigalou a écrit : ↑25 nov. 2017, 20:36Je fais des essais ce we, j'ai une erreur :
root@maitre:/var/www/html/plugins/Bluetooth-scanner-master# php BTdaemon.php start
Kill Bluetooth Daemon 32223
Starting Bluetooth Daemon
PHP Notice: Undefined variable: x in /var/www/html/plugins/Bluetooth-scanner-master/BTdaemon.php on line 308
root@maitre:/var/www/html/plugins/Bluetooth-scanner-master# 2017-11-25 19:33:12,826 - ERROR - Wrong json for TAGS: null
La ligne 308 c'est :
$x = addslashes(json_encode($x));
C'est dans threadBLEScanner, mais c'est bizarre j'ai qu'un equipement en BT, rien en BLE.
Je cherche...
Essaye d'en déclarer un bidon, cela devrait régler ton problème
mais le mieux, si tu peux tester ce code stp:
Code : Tout sélectionner
// Create a thread to run the python script for BLE device scan
private function threadBLEScanner() {
$this->dbg("children python BLE scanner - ".getmypid()."\n");
$id = substr($this->_adapter, -1); // hci adapter number
$this->dbg("Start python BLE scanner\n");
foreach ($this->_tags as $key=>$device) { //extract BLE devices
if ($device['ble'] == 1) $x[] = $key;
}
if isset($x) { // case when no BLE devices are used
$x = addslashes(json_encode($x));
$processUser = posix_getpwuid(posix_geteuid())['name'];
$dbg = $this->_debug ? 1 : 0;
$this->dbg("Start as: sudo python BLE.py $id $processUser $this->_me $$dbg $x\n");
//echo "Start as: sudo python BLE.py $id $processUser $this->_me $dbg $x\n";
exec("sudo python BLE.py $id $processUser $this->_me $dbg $x"); // ble.py adapterNb processUser phpcallback debug jsonTagsBdaddr
}
}
Cela doit fonctionner
diving91
Diving91,
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
RPI2 + SSD 30MB - RfxTrx433E - Store Somfy - Led Milight - MySensors Gateway ESP8266 - Noeuds ESP Easy
Ma Station Météo sous Jeedom
Re: [TUTO] Scanner Bluetooth (BLE ou non)
J'ai testé, j'ai une nouvelle erreur :
PHP Parse error: syntax error, unexpected 'isset' (T_ISSET), expecting '(' in /var/www/html/plugins/Bluetooth-scanner-master/BTdaemon.php on line 252
J'ai remplacé if isset($x) par if (isset($x)) ça passe !!
Plus d'erreur !!! Ça doit tourner j'ai un "Starting Bluetooth Daemon" et c'est tout... trop content, merci
* J'ai regardé les logs, ça fonctionne, j'ai bien ACTIVE ou inactive.
* Nota : J'ai un décalage d'une heure mais on s'en moque
Nota, j'ai ajouté dans le code :
* Les états changent bien dans Jeedom
PHP Parse error: syntax error, unexpected 'isset' (T_ISSET), expecting '(' in /var/www/html/plugins/Bluetooth-scanner-master/BTdaemon.php on line 252
J'ai remplacé if isset($x) par if (isset($x)) ça passe !!
Plus d'erreur !!! Ça doit tourner j'ai un "Starting Bluetooth Daemon" et c'est tout... trop content, merci
* J'ai regardé les logs, ça fonctionne, j'ai bien ACTIVE ou inactive.
* Nota : J'ai un décalage d'une heure mais on s'en moque
Nota, j'ai ajouté dans le code :
Code : Tout sélectionner
date_default_timezone_set('Europe/Paris'); // pour forcer l'affichage heure française
Sigalou
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
Utilisateur/Développeur Plugin Jeedom
Créateur des plugins Alexa-API & WatchDog
- Site perso dédié domotique : Sigalou-domotique
- Support : Alexa-API WatchDog
- Documentation, Changelog et Todo-List : Alexa-API WatchDog
Qui est en ligne ?
Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 6 invités