Giter Club home page Giter Club logo

Comments (4)

mjmccans avatar mjmccans commented on September 24, 2024

I am by no means an expert in pip, but it looks like your python interpreter is not seeing the installed paho package. One simple test would be to run "python3" at the command line and then try "import paho" at the ">>>" prompt. If there is no error then the module imported correctly.

Another thought is that it looks like the paho package was installed in the "pi" user's home directory (i.e., using the --user option when installed) so it will only be available to the pi user. Are you running the script as the pi user?

Hopefully we can figure out what the issue is and get you up and running.

from airthings-mqtt-ha.

FSund avatar FSund commented on September 24, 2024

If I remember correctly the bluetooth stuff needs sudo to run, so you will need to install paho without the --user option.

from airthings-mqtt-ha.

mjmccans avatar mjmccans commented on September 24, 2024

You can definitely install the modules globally, but you do not need to run as root provided you have run setcap on the bluepy-helper binary as follows:

sudo setcap 'cap_net_raw,cap_net_admin+eip' `find ~/.local/lib/ | grep bluepy-helper | grep -v bluepy-helper.c`

It has been a while, but my recollection is that root access is only needed for bluetooth scanning and not where you know the device's mac address, so you could also just run the script as root for scanning purposes and then revert to a non-privileged user.

from airthings-mqtt-ha.

dwlyles avatar dwlyles commented on September 24, 2024

If I remember correctly the bluetooth stuff needs sudo to run, so you will need to install paho without the --user option.

I ultimately decided last night to go back to raspbian instead of ubuntu, but i started to have the same issue.
So i it looks like since i cant run the /airthings-mqtt-ha.py --generate_config without root. installing the pip3 packages as root and it worked, but somewhere in there not running root works too so im not sure what happened.

I did run the sudo setcap 'cap_net_raw,cap_net_admin+eip' find ~/.local/lib/ | grep bluepy-helper | grep -v bluepy-helper.c`` again with verbose to make sure it was "OK"

Everything works now as planned.
Thanks for your imput, i appreciate it!

from airthings-mqtt-ha.

Related Issues (8)

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.