Skip to content

Dev python bluez#295

Open
gadric wants to merge 8 commits into
andrewjfreyer:masterfrom
gadric:dev-python-bluez
Open

Dev python bluez#295
gadric wants to merge 8 commits into
andrewjfreyer:masterfrom
gadric:dev-python-bluez

Conversation

@gadric

@gadric gadric commented Feb 4, 2020

Copy link
Copy Markdown

readme.MD: instructions to install bluetooth, python-bluez package and python-setuptools. clone ewenchou/bluetooth-proximity repo and install the script.

A new file rssi.py added to get rssi of mobile devices

monitor.sh script adapted to python-bluez and the rssi.py script.

@andrewjfreyer

Copy link
Copy Markdown
Owner

I'll have to think on this. I understand the purpose, obviously, but one of the major advantages of this project is its small list of dependencies and its single-language source.

@gadric

gadric commented Feb 10, 2020

Copy link
Copy Markdown
Author

I understand your hesitation and I also not 100% happy about involving another project/language.

However, as I read and referenced, hcitool is depreciated and no longer maintained. Sooner or later this tool needs to be replaced. I have thought about using bluetoothctl as another implementation. But I was never get it reliable.

Whatever you decide, I have been playing about with this python script and I found a version which is ported to python3 (Prime consideration was that python2 will be EOL this year). It works even better and I am testing this. If you decide to implement this solution let me know. I upload this new solution working with python3

@andrewjfreyer

Copy link
Copy Markdown
Owner

Thanks for the comment. I think the best solution is a complete re-write of monitor in a higher level language (or, being pedantic, an actual programming language) like python, but that's a task I'm likely unable to undertake in the near term.

@gadric

gadric commented Feb 13, 2020

Copy link
Copy Markdown
Author

One thing I can do is to write an bash script, that automates the installation of monitor and the python stuff. Maybe that is a comprise?

@isaacewing

Copy link
Copy Markdown

@gadric I’d help you do that in python, I like the direction you’re going in, maybe a fork of this repo would be a next step so @andrewjfreyer can keep this one as is and a parallel version in python to compliment his version

gadric added 4 commits March 18, 2020 18:06
Update for python 3 and updated version of rssi.py
Update for python 3 version

@gadric gadric left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the python script to version 3.

@gadric

gadric commented Mar 18, 2020

Copy link
Copy Markdown
Author

And more, the new rssi.py script does not calculate the average, but the lowest rssi value. Was more precise.

Comment thread README.md
sudo python3 setup.py install

#enter `monitor` directory
cd monitor/

@jlo88 jlo88 Apr 23, 2020

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cd monitor/
cd ../monitor/

@jlo88

jlo88 commented Apr 23, 2020

Copy link
Copy Markdown

I've installed this, yesterday I had good results with it but today I still face the same (bluetoothctl:18044): GLib-CRITICAL **: Source ID 20 was not found when attempting to remove it error.

I'd also like to contribute but don't have a whole lot of experience.

Output of sudo bash monitor.sh:

> starting monitor.sh (v. 0.2.200)...
> removing web request caches

(bluetoothctl:20798): GLib-CRITICAL **: Source ID 20 was not found when attempting to remove it
> D8:5B:2A:8B:27:44 confidence topic: monitor/diningroom/jans7 (has not previously connected to hci0)
> 08:78:08:F2:59:ED confidence topic: monitor/diningroom/mirjams7 (has not previously connected to hci0)
[+] 0.2.200 23-04-2020 09:06:49 am [CMD-INFO]   cycling bluetooth hardware on hci0. please wait a moment...
[+] 0.2.200 23-04-2020 09:07:20 am [CMD-MQTT]   monitor/diningroom/jans7 { ... confidence : 0 ... }
[+] 0.2.200 23-04-2020 09:07:20 am [CMD-NAME]   D8:5B:2A:8B:27:44 JanS7  Samsung Electronics CoLtd
[+] 0.2.200 23-04-2020 09:07:30 am [CMD-MQTT]   monitor/diningroom/mirjams7 { ... confidence : 0 ... }
[+] 0.2.200 23-04-2020 09:07:30 am [CMD-NAME]   08:78:08:F2:59:ED MirjamS7  Samsung Electronics CoLtd

@peter-dolkens

Copy link
Copy Markdown

And more, the new rssi.py script does not calculate the average, but the lowest rssi value. Was more precise.

I found that the logic in use for rssi calculation was making an assumption about 0 values, which was the primary source of inaccuracy for me.

I've actually opened #362 as a fix for that, which is a much lighter-weight change than this script - keeping an eye out for instability however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants