Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetching data ? #1

Open
Vebryn opened this issue May 25, 2018 · 2 comments
Open

fetching data ? #1

Vebryn opened this issue May 25, 2018 · 2 comments

Comments

@Vebryn
Copy link

Vebryn commented May 25, 2018

Hello,

Great Python code! I would like to use it on my RPi3 to fetch my daily activity.

Do you think it's possible to get steps and other data from MiBand ?

Best regards

@sampoder
Copy link

sampoder commented Jun 1, 2018

Hey on the RPI3 how did you get bluepy, I want to use this for a project but can't figure out how to get bluepy. Did you use a different command?

Thanks Sam

Here is the error

pip install bluepy --user
Collecting bluepy
Using cached https://files.pythonhosted.org/packages/85/06/0729bd5860a6658d3ddd38061caaa14914c0843cfb1305703724bd807005/bluepy-1.1.4.tar.gz
Building wheels for collected packages: bluepy
Running setup.py bdist_wheel for bluepy ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-Fzc3db/bluepy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpzbAIwzpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
Working dir is /tmp/pip-build-Fzc3db/bluepy
execute make -C ./bluepy clean
execute make -C bluepy -j1
Failed to compile bluepy-helper. Exiting install.
Command was 'make -C bluepy -j1' in /tmp/pip-build-Fzc3db/bluepy
Return code was 2
Output was:
make: Entering directory '/tmp/pip-build-Fzc3db/bluepy/bluepy'
tar xzf bluez-src.tgz
touch ./bluez-5.29/lib/bluetooth.c ./bluez-5.29/lib/hci.c ./bluez-5.29/lib/sdp.c ./bluez-5.29/lib/uuid.c ./bluez-5.29/attrib/att.c ./bluez-5.29/attrib/gatt.c ./bluez-5.29/attrib/gattrib.c ./bluez-5.29/attrib/utils.c ./bluez-5.29/btio/btio.c ./bluez-5.29/src/log.c ./bluez-5.29/src/shared/mgmt.c ./bluez-5.29/src/shared/crypto.c ./bluez-5.29/src/shared/att.c ./bluez-5.29/src/shared/queue.c ./bluez-5.29/src/shared/util.c ./bluez-5.29/src/shared/io-glib.c ./bluez-5.29/src/shared/timeout-glib.c
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing glib-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'glib-2.0' found Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
gcc -L. -Os -g -Wall -DHAVE_CONFIG_H -I./bluez-5.29/attrib -I./bluez-5.29 -I./bluez-5.29/lib -I./bluez-5.29/src -I./bluez-5.29/gdbus -I./bluez-5.29/btio -o bluepy-helper bluepy-helper.c ./bluez-5.29/lib/bluetooth.c ./bluez-5.29/lib/hci.c ./bluez-5.29/lib/sdp.c ./bluez-5.29/lib/uuid.c ./bluez-5.29/attrib/att.c ./bluez-5.29/attrib/gatt.c ./bluez-5.29/attrib/gattrib.c ./bluez-5.29/attrib/utils.c ./bluez-5.29/btio/btio.c ./bluez-5.29/src/log.c ./bluez-5.29/src/shared/mgmt.c ./bluez-5.29/src/shared/crypto.c ./bluez-5.29/src/shared/att.c ./bluez-5.29/src/shared/queue.c ./bluez-5.29/src/shared/util.c ./bluez-5.29/src/shared/io-glib.c ./bluez-5.29/src/shared/timeout-glib.c
bluepy-helper.c:33:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/attrib/att.c:33:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/attrib/gatt.c:32:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/attrib/gattrib.c:34:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/attrib/utils.c:30:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/btio/btio.c:37:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/src/log.c:32:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/src/shared/io-glib.c:30:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/src/shared/timeout-glib.c:22:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
Makefile:28: recipe for target 'bluepy-helper' failed
make: *** [bluepy-helper] Error 1
make: Leaving directory '/tmp/pip-build-Fzc3db/bluepy/bluepy'


Failed building wheel for bluepy
Running setup.py clean for bluepy
Failed to build bluepy
Installing collected packages: bluepy
Running setup.py install for bluepy ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-Fzc3db/bluepy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-mFwzkb-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_py
Working dir is /tmp/pip-build-Fzc3db/bluepy
execute make -C ./bluepy clean
execute make -C bluepy -j1
Failed to compile bluepy-helper. Exiting install.
Command was 'make -C bluepy -j1' in /tmp/pip-build-Fzc3db/bluepy
Return code was 2
Output was:
make: Entering directory '/tmp/pip-build-Fzc3db/bluepy/bluepy'
tar xzf bluez-src.tgz
touch ./bluez-5.29/lib/bluetooth.c ./bluez-5.29/lib/hci.c ./bluez-5.29/lib/sdp.c ./bluez-5.29/lib/uuid.c ./bluez-5.29/attrib/att.c ./bluez-5.29/attrib/gatt.c ./bluez-5.29/attrib/gattrib.c ./bluez-5.29/attrib/utils.c ./bluez-5.29/btio/btio.c ./bluez-5.29/src/log.c ./bluez-5.29/src/shared/mgmt.c ./bluez-5.29/src/shared/crypto.c ./bluez-5.29/src/shared/att.c ./bluez-5.29/src/shared/queue.c ./bluez-5.29/src/shared/util.c ./bluez-5.29/src/shared/io-glib.c ./bluez-5.29/src/shared/timeout-glib.c
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing glib-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'glib-2.0' found Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
gcc -L. -Os -g -Wall -DHAVE_CONFIG_H -I./bluez-5.29/attrib -I./bluez-5.29 -I./bluez-5.29/lib -I./bluez-5.29/src -I./bluez-5.29/gdbus -I./bluez-5.29/btio -o bluepy-helper bluepy-helper.c ./bluez-5.29/lib/bluetooth.c ./bluez-5.29/lib/hci.c ./bluez-5.29/lib/sdp.c ./bluez-5.29/lib/uuid.c ./bluez-5.29/attrib/att.c ./bluez-5.29/attrib/gatt.c ./bluez-5.29/attrib/gattrib.c ./bluez-5.29/attrib/utils.c ./bluez-5.29/btio/btio.c ./bluez-5.29/src/log.c ./bluez-5.29/src/shared/mgmt.c ./bluez-5.29/src/shared/crypto.c ./bluez-5.29/src/shared/att.c ./bluez-5.29/src/shared/queue.c ./bluez-5.29/src/shared/util.c ./bluez-5.29/src/shared/io-glib.c ./bluez-5.29/src/shared/timeout-glib.c
bluepy-helper.c:33:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/attrib/att.c:33:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/attrib/gatt.c:32:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/attrib/gattrib.c:34:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/attrib/utils.c:30:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/btio/btio.c:37:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/src/log.c:32:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/src/shared/io-glib.c:30:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
./bluez-5.29/src/shared/timeout-glib.c:22:18: fatal error: glib.h: No such file or directory
#include <glib.h>
^
compilation terminated.
Makefile:28: recipe for target 'bluepy-helper' failed
make: *** [bluepy-helper] Error 1
make: Leaving directory '/tmp/pip-build-Fzc3db/bluepy/bluepy'

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-Fzc3db/bluepy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-mFwzkb-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-Fzc3db/bluepy/

@Jhilam2014
Copy link

Hi.. I used bulepy in RPi3 and it is working. But it is not able to fetch the data for Accelerometer.
it is returning False for
char_sensor.supportsRead()

also when I am trying to read the data from char_sensor
char_sensor.read()
raise BTLEGattError("Bluetooth command failed", resp)
BTLEGattError: Bluetooth command failed (code: 2, error: Attribute can't be read)

But when I am using MiBandMaster app it is able to capture G sensor data (x,y,z). So there must be a way to get that info in RPi3 as well!!
Any solution???

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

No branches or pull requests

3 participants