Giter Site home page Giter Site logo

Can't install about xiaomi-flower-care-api HOT 9 OPEN

vrachieru avatar vrachieru commented on May 27, 2024
Can't install

from xiaomi-flower-care-api.

Comments (9)

sanguino avatar sanguino commented on May 27, 2024 3

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.

 avatar commented on May 27, 2024 1

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.

kobush avatar kobush commented on May 27, 2024

I get the exact same error.

from xiaomi-flower-care-api.

frankfnord avatar frankfnord commented on May 27, 2024

same error here.
python3 --version: Python 3.7.3

from xiaomi-flower-care-api.

sanguino avatar sanguino commented on May 27, 2024

Me too, Python 3.7.3

from xiaomi-flower-care-api.

johnsonflowers avatar johnsonflowers commented on May 27, 2024

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.

XReyRobert avatar XReyRobert commented on May 27, 2024

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.

XReyRobert avatar XReyRobert commented on May 27, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.