Comments (9)
I fixed it adding encoding='utf8' to setup.py:
def readme():
with open('README.md', encoding='utf8') as readme_file:
return readme_file.read()
But now I have a problem executing read.py:
~/xiaomi-flower-care-api/example $ sudo python3 read.py
Getting data from device..
Traceback (most recent call last):
File "read.py", line 15, in <module>
print('Name: {}'.format(sensor.name))
File "../flowercare/reader.py", line 39, in name
response = self._read_handle(_HANDLE_DEVICE_NAME)
File "../flowercare/reader.py", line 127, in _read_handle
with Peripheral(self._mac, iface=self._interface) as connection:
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 391, in __init__
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 434, in _connect
rsp = self._getResp('stat')
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 339, in _waitResp
raise BTLEInternalError("Helper exited")
bluepy.btle.BTLEInternalError: Helper exited
Exception ignored in: <bound method Peripheral.__del__ of <bluepy.btle.Peripheral object at 0xb6aa5870>>
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 630, in __del__
self.disconnect()
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 453, in disconnect
self._writeCmd("disc\n")
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 305, in _writeCmd
self._helper.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe
from xiaomi-flower-care-api.
I have also encountered the same error with Python 3.5.3 @vrachieru Could you please write which Python version did you use?
from xiaomi-flower-care-api.
I get the exact same error.
from xiaomi-flower-care-api.
same error here.
python3 --version: Python 3.7.3
from xiaomi-flower-care-api.
Me too, Python 3.7.3
from xiaomi-flower-care-api.
i get an error
Successfully built flowercare
Failed to build bluepy
Installing collected packages: bluepy, flowercare
Running setup.py install for bluepy ... error
ERROR: Complete output from command /usr/local/opt/python/bin/python3.7 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/ym/k81rfk4n4914jsk7yzvqbn2jtk9071/T/pip-install-pz7e0fzf/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 /private/var/folders/ym/k81rfk4n4914jsk7yzvqbn2jtk9071/T/pip-record-i654mvci/install-record.txt --single-version-externally-managed --compile:
from xiaomi-flower-care-api.
This is not a python issue but a shell issue.
If it happens when using SSH, this is a fault on the SSH client, not the RPi. For example using an Ubuntu machine as the SSH client will cause this problem.
To fix this SSH problem, edit the file /etc/ssh/ssh_config on the SSH client (not the RPi) and remove the line
SendEnv LANG LC_*
I had this issue when accessing my raspberry through ssh, removing the SendEnv line solved the issue and I could install xiaomi-flower-care-api properly
from xiaomi-flower-care-api.
I fixed it adding encoding='utf8' to setup.py:
def readme(): with open('README.md', encoding='utf8') as readme_file: return readme_file.read()But now I have a problem executing read.py:
~/xiaomi-flower-care-api/example $ sudo python3 read.py Getting data from device.. Traceback (most recent call last): File "read.py", line 15, in <module> print('Name: {}'.format(sensor.name)) File "../flowercare/reader.py", line 39, in name response = self._read_handle(_HANDLE_DEVICE_NAME) File "../flowercare/reader.py", line 127, in _read_handle with Peripheral(self._mac, iface=self._interface) as connection: File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 391, in __init__ self._connect(deviceAddr, addrType, iface) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 434, in _connect rsp = self._getResp('stat') File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 407, in _getResp resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 339, in _waitResp raise BTLEInternalError("Helper exited") bluepy.btle.BTLEInternalError: Helper exited Exception ignored in: <bound method Peripheral.__del__ of <bluepy.btle.Peripheral object at 0xb6aa5870>> Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 630, in __del__ self.disconnect() File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 453, in disconnect self._writeCmd("disc\n") File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 305, in _writeCmd self._helper.stdin.flush() BrokenPipeError: [Errno 32] Broken pipe
did you ever resolved this ?
from xiaomi-flower-care-api.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xiaomi-flower-care-api.