wally333
Posts: 28
Joined: Mon Jun 06, 2016 7:09 pm

pip install pybluez[ble] wedges system when building gattlib

Sat Sep 09, 2017 3:16 am

PiZero-W running Raspbian Stretch 2017-08-16 with all current updates installed.

pip install pybluez appears to have completed OK.

Here is what is in the terminal when the system wedges:

pi@pizeroNoir:~ $ pip install pybluez[ble]
Collecting pybluez[ble]
Collecting gattlib==0.20150805; extra == "ble" (from pybluez[ble])
Downloading gattlib-0.20150805.tar.gz (1.7MB)
100% |████████████████████████████████| 1.7MB 40kB/s
Building wheels for collected packages: gattlib
Running setup.py bdist_wheel for gattlib ... |

I came up with an ugly hack using a shell script, and node-red to ultimately send MQTT messages for presence detection of some Radius Dot Beacons and it seems to work well enough that my $15 PiZero-W + case (I used an old cell phone charger for the power supply) has been quietly doing the job for about three days now without issue. So my need for pybluez ble extensions has faded.

But I'm pretty sure its considered a "problem" if a pip install wedges the system!

DirkS
Posts: 7409
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: pip install pybluez[ble] wedges system when building gattlib

Sat Sep 09, 2017 7:46 am

wally333 wrote:
Sat Sep 09, 2017 3:16 am
But I'm pretty sure its considered a "problem" if a pip install wedges the system!
I've been working with computers for almost 40 years, but I have no idea what 'wedging the system' means...

wally333
Posts: 28
Joined: Mon Jun 06, 2016 7:09 pm

Re: pip install pybluez[ble] wedges system when building gattlib

Sat Sep 09, 2017 2:37 pm

It just stops working. The gui still is displayed, and some limited jerky mouse movement happens. Eventually the ssh connection dies with a timeout:
packet_write_wait: Connection to 192.168.2.181 port 22: Broken pipe

Only way to recover is a power off on cycle (or perhaps a reset button if the PiZero-W had one).

In some ways its worse than a crash or BSOD as these attempt to dump some last minute information to perhaps leave a clue.

wally333
Posts: 28
Joined: Mon Jun 06, 2016 7:09 pm

Re: pip install pybluez[ble] wedges system when building, gattlib: Follow-up

Sun Sep 10, 2017 2:04 am

Tried it again on a Rpi3 with Raspbian-stretch 2017-09-07 and pip install of pybluez[ble] appears to have completed OK.

So either the issue is specific to the PiZero-W or its something in 2017-08-16 that is not fixed with apt-get update ; apt-get upgrade or apt-get dist-upgrade.

tvoverbeek
Posts: 89
Joined: Mon Feb 04, 2013 9:50 am
Location: Fieberbrunn, Austria

Re: pip install pybluez[ble] wedges system when building gattlib

Tue Sep 12, 2017 6:47 am

Running out of memory??? Pi-Zero-W has 512 MB, RPI3 1 GB

wally333
Posts: 28
Joined: Mon Jun 06, 2016 7:09 pm

Re: pip install pybluez[ble] wedges system when building gattlib

Wed Sep 13, 2017 7:42 pm

tvoverbeek wrote:
Tue Sep 12, 2017 6:47 am
Running out of memory??? Pi-Zero-W has 512 MB, RPI3 1 GB
That is certainly a possibility. As asked in another Raspbian thread, I moved my PiZero-W card to my Pi2 with WiPi adapter and the pip install of bluez[ble] appeared to build correctly.

I moved the card back to my PiZero-W but the effort was moot, as none of the BLE python examples seemed to work, no errors, but the scans didn't find my Radius Dot beacons.

So I've moved on, and use a node-red flow to exec a shell script that uses sudo hcitool and hcidump -- raw to dump a lescan into a csv format text file which is then read into the flow, interpreted with a node-red function node and updates the presence/absent status via MQTT. Auto repeating the flow every 10 seconds works great for my needs. Its a kludge, but it seems reliable enough so far, been running for almost a week now.

Using the microwave oven seems to kill the wifi connection between the PiZero-W and the MQTT broker, but it seems to recover and the microwave will not be running when the presence detection becomes important :)

I'm quite impressed with the PiZero-W so much so I've bought another to play with along with a V2 NoIR camera module. If you've another P2 with wifi dongle or better yet a Pi3 set up your SD card on it and move it to the PiZero-W when finished as all the installs and building of stuff goes a lot faster and if using the GUI its way more pleasant interaction.

Edit: figuring it might be a memory issue initially, I changed the config to boot to a console without auto login and attempted the whole thing over ssh with the same system wedge (or lock-up) result, I didn't mention this initially to keep it brief and to the point.

Return to “Python”

Who is online

Users browsing this forum: No registered users and 20 guests