How to check presence of Beacon ?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

Re: How to check presence of Beacon ?

Post by jmleglise »

This beacon works fine too.

http://www.aliexpress.com/item/New-Nut- ... 79557.html

It was 5€ when I have ordered it 2 weeks ago.
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
jnoel68
Posts: 12
Joined: Tuesday 14 June 2016 15:44
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by jnoel68 »

Hi jmleglise, any idea ?
Thx
jnoel68 wrote:Hi,

Does anybody have an idea how to setup the same on Synology ?
I've bought a Bluetooth adapter, which is perfectly recognized by the Synology.
I've bought Chipolo beacons.
How can I setup bluez on my Synology to automatically update my beacons status in domoticz ?

Thx in advance,
Jerome
jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

Re: How to check presence of Beacon ?

Post by jmleglise »

Sorry, I don't use synology. There is a lot of information on google to install bluez on synology.

If you succeed, you could report here and complete the wiki ?
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
jnoel68
Posts: 12
Joined: Tuesday 14 June 2016 15:44
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by jnoel68 »

jmleglise wrote:Sorry, I don't use synology. There is a lot of information on google to install bluez on synology.

If you succeed, you could report here and complete the wiki ?
Unfortunately, still unable to install bluez on my synology
in fact, there is a package available for optware/entware (which are tools to allow install standard linux package) but the bluez version is 3.36, and the team don't want to upgrade to bluez 5 for compatibilty reason with other packages ...
Still trying to install it :oops:
User avatar
jumbotroll
Posts: 793
Joined: Tuesday 13 January 2015 14:36
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Oslo,Norway
Contact:

Re: How to check presence of Beacon ?

Post by jumbotroll »

jnoel68 wrote:
jmleglise wrote:Sorry, I don't use synology. There is a lot of information on google to install bluez on synology.

If you succeed, you could report here and complete the wiki ?
Unfortunately, still unable to install bluez on my synology
in fact, there is a package available for optware/entware (which are tools to allow install standard linux package) but the bluez version is 3.36, and the team don't want to upgrade to bluez 5 for compatibilty reason with other packages ...
Still trying to install it :oops:
I have compiled spk package Bluez version 5.41 for DS1511+ arch-x86 for DSM 6.0 for you to test . Binary files are located in /usr/local/bluez .
I have not tested this package even when I do not use bluetooth.
http://www.jadahl.com/synology6/?arch=x86
If you like the work I do for synology and domoticz, I appreciate a donation.
https://paypal.me/Jumbotroll
Regards
Jumbotroll
http://www.jadahl.com
jnoel68
Posts: 12
Joined: Tuesday 14 June 2016 15:44
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by jnoel68 »

jumbotroll wrote:
jnoel68 wrote:
jmleglise wrote:Sorry, I don't use synology. There is a lot of information on google to install bluez on synology.

If you succeed, you could report here and complete the wiki ?
Unfortunately, still unable to install bluez on my synology
in fact, there is a package available for optware/entware (which are tools to allow install standard linux package) but the bluez version is 3.36, and the team don't want to upgrade to bluez 5 for compatibilty reason with other packages ...
Still trying to install it :oops:
I have compiled spk package Bluez version 5.41 for DS1511+ arch-x86 for DSM 6.0 for you to test . Binary files are located in /usr/local/bluez .
I have not tested this package even when I do not use bluetooth.
http://www.jadahl.com/synology6/?arch=x86
Thanks Jumbotroll, installation went fine -> Bluez is well installed in folder /usr/local/bluez
But still unable to import "bluetooth" or "bluez" in the python script provided by jmleglise, always the same issue :
No module named bluetooth._bluetooth
I'm not fine with python, so I'm not sure that the import can look in /usr/local/bluez, so I've tried to copy this folder in one of the PYTHONPATH, but still not working ... si maybe the bluez module should be compiled for python before ...
@jmleglise, if you have any idea, thanks to help
chrispazz
Posts: 81
Joined: Friday 08 July 2016 10:38
Target OS: -
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by chrispazz »

Hi,
On my Raspberry PI 3 I tried in every way but I never are able to run the script.
I always get the same error of previous user: No module named bluetooth._bluetooth

Gatttool is working ok so I am looking to a different method to test presence of my NUT 2 beacon.

Any alternative idea?

Thank you
jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

Re: How to check presence of Beacon ?

Post by jmleglise »

Hi chrispass,

At what line/test of the wiki did you failed ?
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

Re: How to check presence of Beacon ?

Post by jmleglise »

And I had this error (No module named bluetooth._bluetooth) when python don't find the bluez library. (problem of path.)

- is it your first python script ?
- respect all path of the wiki.
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
evertzwevert

Re: How to check presence of Beacon ?

Post by evertzwevert »

Hi!

First of all: thanks JMLEGLISE for all your pioneering work on the BTLE beacons. I really enjoyed implementing it.

I used this script successfully on my raspberry pi in combination with 2 NUTS. however now i'm going nuts trying to get it working on the synology ds126+II being stuck on the "No module named bluetooth._bluetooth" python error.

* i installed the bluez package from jumbotroll (BlueZ v5.41-1) since I was not able to compile Bluez succesfully myself, and gave up on it.
* According to the wiki i should
sudo apt-get install python-bluez python-requests -> i cannot install python bluez or -requests from optware
sudo cp attrib/gatttool /usr/local/bin/ ->i cannot find the gattool anywhere

Did anyone get past the python error and got this working on Synology ?
Can some point me in the direction of a solution ?

thanks!
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: How to check presence of Beacon ?

Post by woody4165 »

Hi

I come back in this 3d after a lot of time since I'm having problem with a kind of beacon.
I got a Nut 3 mini and it's working.
Now I've got a Nut 2, but it cannot be found.
The strange thing is that if I run a BLE scanner app on Android I cannot find it either.
While if I run the Nut App I can find it. If I click on the Nut the phone ring and if I click on the phone (Nut app) on this device it ring also.

Strange think is that the Ble Scanner, and also the check_beacon_presence script of course, don't find it.
The battery is ok, I changed with a new one.

Any suggestion?

Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

Re: How to check presence of Beacon ?

Post by jmleglise »

Hi,

I have the nut 2 and it's working without problem, (from this seller : http://www.banggood.com/Mini-Smart-Patc ... 88462.html )

If you don't see your beacon with this command, I'am afraid that you will not be able to use it :

Code: Select all

sudo hcitool lescan
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
nillix
Posts: 6
Joined: Tuesday 29 December 2015 10:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by nillix »

Hi there,

I ordered two of these NUT beacons + BLE USB Stick. They are working fine with the app on Iphone etc. But there is one thing I miss in the wiki article (https://www.domoticz.com/wiki/Presence_ ... gy_Beacon)) and the discussion here. As far as I know, you have to have a permanent connection to these beacons in order to correctly detect them, am I right? I mean, the script is working well and the beacons are detected when I make them visible (long press on the button of the beacon) But I don´t want to push the button everytime I´m coming home etc. I think this is not in your mind as well. So I already tried to connect them with raspberry and it worked with bluetoothctl. But when I leave the cli of bluetoothctl, the connection is lost. So how this should be managed?

I really hope that somebody can help me a little bit, because this is really a great thing when its working correctly! :)

Thanks Nils
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: How to check presence of Beacon ?

Post by woody4165 »

@jmleglise all works fine now.

Don't know what happened, but after a reboot, removing and putting back the BT stick, now all is working. Strange that the Nut3 mini where working and the others didn't.

Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
sbisbilo
Posts: 11
Joined: Monday 07 March 2016 17:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by sbisbilo »

Hi,

I successfully installed the script on my domoticz system but my beacons are not awake, I have to push a long time the button on the top of it and there are staying awake for like 10 seconds.
I bought those ones : https://www.amazon.fr/NUT-Bluetooth-Int ... ndroid+IOS
There are Nut 2 apparently. Is there somthing to do to force them being awake all the time ?

Thanks for your answer.
Sylvain
nillix
Posts: 6
Joined: Tuesday 29 December 2015 10:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by nillix »

I will try this later at home (already tried parts of it, but not did the trusting at the end):

Code: Select all

Start the bluetoothctl interactive command. Enter "help" to get a list of available commands.

Turn the power to the controller on by entering "power on". It is off by default.
Enter "devices" to get the MAC Address of the device with which to pair.
Enter device discovery mode with "scan on" command if device is not yet on the list.
Turn the agent on with "agent on".
Enter "pair MAC Address" to do the pairing (tab completion works).
If using a device without a PIN, one may need to manually trust the device before it can reconnect successfully. Enter "trust MAC Address" to do so.
Finally, use "connect MAC address" to establish a connection.
Maybe it works for you as well...
sbisbilo
Posts: 11
Joined: Monday 07 March 2016 17:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by sbisbilo »

So finally, I bought some Nut 3 mini and it's working :) There staying all the time awake ! But I have one more question : I'd like to write in a log file when the status of a Beacon is changing (away/home). How can I do that in LUA ?
Thanks
nillix
Posts: 6
Joined: Tuesday 29 December 2015 10:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by nillix »

Hi sbisbilo,

that sounds good. Unfortunately my tries to have a stable connection with the NUT2 went all wrong... :(
I will give the NUT 3 a try!
Could you explain what you did? Which were the steps you took to get it working.

Thanks!
Nils
sbisbilo
Posts: 11
Joined: Monday 07 March 2016 17:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by sbisbilo »

Hi nillix,

Yeah the nut 2 is not the good beacon for this purpose.
I just follow the wiki:

https://www.domoticz.com/wiki/Presence_ ... gy_Beacon)

and It worked like a charm ! I'm using a raspberry pi 3 with the embedded Bluetooth device.
Last edited by gizmocuz on Thursday 20 October 2016 15:20, edited 1 time in total.
Reason: Please put URL's in a URL tag or they might not work (like this one)
sbisbilo
Posts: 11
Joined: Monday 07 March 2016 17:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to check presence of Beacon ?

Post by sbisbilo »

Hi everyone,

Do you know if is it possible to use about 20 beacons in the same time with a bluetooth dongle ?

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests