Skip to content

Apparently incompatabile with Buster Lite #6

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

Closed
drkpxl opened this issue Jul 2, 2019 · 13 comments
Closed

Apparently incompatabile with Buster Lite #6

drkpxl opened this issue Jul 2, 2019 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@drkpxl
Copy link

drkpxl commented Jul 2, 2019

the setup guide is missing alot of needed installs. For example. I have had to install

  • Git
  • Python
  • sumbus2
  • numpy

Is there not a consolidated script that can install this for semi-beginners like myself.

@Gadgetoid
Copy link
Member

I'm guessing this is the Raspbian Lite flavour of Buster? Python, at least, should be installed by default but - indeed - numpy and smbus should go into the installer.

Gadgetoid added a commit that referenced this issue Jul 3, 2019
@drkpxl
Copy link
Author

drkpxl commented Jul 3, 2019

Correct. Using the lite. It wasn't specified and knowing that intent for this is in a "headless" setup I didn't think I needed the full desktop.

Another concern is when trying to install Pillow via PIP I got a out of memory error and had to build a swap in order to install. I believe Pillow comes with the desktop Buster so maybe just update documentation that the full desktop version is required?

@Gadgetoid
Copy link
Member

Yeah- it absolutely should be good to go for a headless setup, i would be silly not to.

Pillow is one of the many Python packages that's paradoxically better served by apt, basically anything with significant C bindings is an uncompromising nightmare to install via pip. While there's a project to build Raspberry Pi-compatible wheels for all Python packages - https://www.piwheels.org/ - it only serves a subset of Python versions.

Looks like I need to include python-pil and python3-pil. You can install these with sudo apt install python-pil python3-pil albeit it's probably too late now.

Thanks for being an unwitting beginner and helping bash the rough edges off this installer- it's easy to lose sight of the wood for the trees when you've done this stuff for so long!

Gadgetoid added a commit that referenced this issue Jul 3, 2019
@hotplot
Copy link
Contributor

hotplot commented Jul 6, 2019

It appears that the supplied install scripts depend on configparser and the all-in-one example depends on RPi.GPIO and spidev, none of which are installed by default on buster lite. Can they also be added as dependencies and installed automatically?

To get the examples running I had to execute the following before being able to run the examples:

  1. sudo apt install python-pip
  2. pip install configparser
  3. pip3 install RPi.GPIO
  4. pip3 install spidev

(for added confusion, configparser is required by python2 while most people will be using python3 for everything else!)

@Gadgetoid
Copy link
Member

Thank you- I'll get these added ASAP. I'm hoping to roll the same installer out across other products, so this wisdom will be shared.

I'd swear Lite has become even lighter as of late, and it's certainly not a route I'd point beginners. Raspbian Desktop can be run headless by setting console startup mode in raspi-config and skirts some of the endless rigamarole of identifying and installing dependencies.

Alas there's not much I can do about the python2/python3 duality, although I do wonder if it's time to bite the tech support bullet and start forcing users to learn python3 in lieu of python. On earlier releases it's not safe to assume that python3 is even installed, and installing an entire additional runtime always felt a bit bruteforce to me.

@Gadgetoid Gadgetoid self-assigned this Jul 6, 2019
Gadgetoid added a commit that referenced this issue Jul 6, 2019
@tomgidden
Copy link

Also, at least on Buster (Pi Zero W, brand new install of Buster Lite), make sure user is in group video to access vcgencmd, and dialout for the serial. The default pi user is, but it's not particularly straightforward for a beginner to figure out which device it needs, and the error isn't informative.

I'd suggest that the script(s) can be made to work for either Python easily, and the installer would use Python 3 if it's installed; Python 2 if not; and install and use Python 3 if neither are there. (?)

For an outside Luftdaten box, a Zero with Buster Lite on a small card and no screen is not unreasonable... full desktop Buster on a Zero is not fun, and all that activity would reduce the lifetime (well, mean-time-before-filesystem-corruption) of it.

I've rolled my own script to not run the ST7735 (pointless outside and fouls the light reading within an enclosure), reduce the CPU temperature compensation factor (I have the pHAT on a ribbon cable to get it away from the Pi), send the appropriate values to Luftdaten, and send all the values to MQTT for local logging and display.

Next I have to come up with an enclosure that'll be weatherproof and deliver Lux readings. It'd be good to include an extension ribbon cable with the Enviro+, or at least offer one as an accessory.

@cipy
Copy link
Contributor

cipy commented Aug 2, 2019

I also managed to install/use Buster Lite, with the below workaround

  $ sudo apt install python-configparser python-setuptools spi-tools python-spidev
  $ sudo apt install python3-setuptools python3-spidev  

plus a $ git pull

of the current code in the repo and a $ pip3 install RPi.GPIO

but Python3 compatibily should be investigated/confirmed, as it is not given #21

@Gadgetoid Gadgetoid added the enhancement New feature or request label Nov 5, 2019
@Gadgetoid Gadgetoid changed the title Apparently incompatabile with Buster Apparently incompatabile with Buster Lite Nov 5, 2019
@dxcSithLord
Copy link

dxcSithLord commented Nov 9, 2019

Just finished running the install and I have been through getting started with enviro plus on a pi Zero with wifi and header.
$ uname -a
Linux pi 4.19.75+ #1270 Tue Sep 24 18:38:54 BST 2019 armv6l GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

After running the install, which prompted to install the examples, which were in ~/Pimoroni/enviroplus/examples and not enviroplus-python/examles, everything ran OK, until I ran the lcd.py.
~/Pimoroni/enviroplus/examples $ python lcd.py
Traceback (most recent call last)
File "lcd.py", line 3, in <module>
import ST7735
File "/usr/local/lib/python2.7/dist-packages/ST7735-0.0.3-py2.7.egg/ST7735/__init__.py", line 25, in <module>
import spidev
ImportError: No module named spidev
~/Pimoroni/enviroplus/examples $ pip install spidev
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting spidev
Downloading https://files.pythonhosted.org/packages/fb/14/4c2e1640f0cb04862c76d9d76ed7c945b0f67876e503ac02f7f675fe86a0/spidev-3.4.tar.gz
Building wheels for collected packages: spidev
Running setup.py bdist_wheel for spidev ... done
Stored in directory: /home/pi/.cache/pip/wheels/10/d6/98/ba1f1999099e3e7adb3a0140af8c9287ff2b067ff005485674
Successfully built spidev
Installing collected packages: spidev
Successfully installed spidev-3.4
~/Pimoroni/enviroplus/examples $ python lcd.py
2019-11-09 18:11:45.914 INFO lcd.py - Hello, World! example on the 0.96" LCD.

Press Ctrl+C to exit!

I repeated this for python3:
~/Pimoroni/enviroplus/examples $ python3 lcd.py
Traceback (most recent call last):
File "lcd.py", line 3, in <module>
import ST7735
File "/usr/local/lib/python3.7/dist-packages/ST7735-0.0.3-py3.7.egg/ST7735/__init__.py", line 25, in <module>
import spidev
ModuleNotFoundError: No module named 'spidev'
~/Pimoroni/enviroplus/examples $ pip3 install sdidev
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting sdidev
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/sdidev/

Thought you should know.

@cipy
Copy link
Contributor

cipy commented Nov 10, 2019

@dxcSithLord have you tried my $ sudo steps listed just above your post here?

@dxcSithLord
Copy link

Following your suggestion, I ran
~/Pimoroni/enviroplus/examples $ sudo apt install python3-setuptools python3-spidev
If I run lcd.py after that, I get a different error:
python3 lcd.py
Traceback (most recent call last):
File "lcd.py", line 3, in <module>
import ST7735
File "/usr/local/lib/python3.7/dist-packages/ST7735-0.0.3-py3.7.egg/ST7735/__init__.py", line 26, in <module>
import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'

~/Pimoroni/enviroplus/examples $ pip3 install RPi.GPIO
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting RPi.GPIO
Downloading https://www.piwheels.org/simple/rpi-gpio/RPi.GPIO-0.7.0-cp37-cp37m-linux_armv6l.whl (69kB)
Installing collected packages: RPi.GPIO
Successfully installed RPi.GPIO-0.7.0

~/Pimoroni/enviroplus/examples $ python3 lcd.py
2019-11-10 22:10:22.021 INFO lcd.py - Hello, World! example on the 0.96" LCD.

Press Ctrl+C to exit!

So that worked.

@jozefvaclavik
Copy link

jozefvaclavik commented Feb 8, 2020

I installed this on Buster Lite versions 2019-09-26 and 2020-02-05.

I needed to install sudo apt-get install git so I can clone the repo and pip install spidev so I can run LCD examples. Everything else was installed by install script.

@Darthmonkey
Copy link

Darthmonkey commented Mar 1, 2020

I followed all the instructions including those above, lcd.py and all-in-one.py are working, but python luftdaten.py fails with:

Traceback (most recent call last):
  File "luftdaten.py", line 3, in <module>
    import requests
ImportError: No module named requests

Unless you run the following (I imagine there's a better option):
pip install requests

@rockthy
Copy link

rockthy commented Jul 11, 2020

I followed all the instructions including those above, lcd.py and all-in-one.py are working, but python luftdaten.py fails with:

Traceback (most recent call last):
  File "luftdaten.py", line 3, in <module>
    import requests
ImportError: No module named requests

Unless you run the following (I imagine there's a better option):
pip install requests

@Darthmonkey I am getting this same issue, any fix for this yet?

JWCook pushed a commit to JWCook/rpi-enviro-monitor that referenced this issue Nov 9, 2021
Initial Commit

Documentation

Fixed badge URLs

Fixes/improvements from pypa/sampleproject

Get lib name automatically for install endpoints

Fixed linting error

Script for setting up git remotes

Synced with bootstrap

Start gas and tests

Clarified pin use, fixed missing setup

Added examples

rename envirophatplus -> enviroplus

README board name change

Updated install/uninstall scripts

Adding a couple of new examples

Update gas.py

Changing references to MICS6812 to MICS6814

Adding new Luftdaten example

Enable i2c and SPI

Tweaking temp compensation value

Fix for PMS5003 ReadTimeoutError

Adding all-in-one example

Improvements to compensated temperature code

flake8 fiddling

Update README.md

Exclude fonts from DoS check

Updated README.rst

Fix in lieu of pimoroni#1

Fix PM10 label unit

Decode fix for pimoroni#3

Switch to v2 installer

Add Raspbian Lite dependencies for pimoroni#6

Update README install instructions

Add links & blurb to README

Recommend OLI install

Back up to /boot to survive OLI rm

Add PIL for pimoroni#6

adding install notes for python-pil, python-setuptools

Add setuptools minimum version trap

config.txt probably doesn't support inline comments pimoroni#9

Packaging fixes from boilerplate

Add pip for pimoroni#6, correct indendation

Bootstrap with python-configparser from apt

Install improvements

Create RESOURCES_DIR early

Ensure required dependencies are installed

Create all-in-one-no-pm.py

Example for all of the sensors built in, omitting the optional particulate matter sensor.

Add ADC channel support into gas module

Add example to demo ADC channel usage

Expand test coverage, bugfix

Adding delay to avoid rate-limiting by Luftdaten

+x

Switch temp comp method for pimoroni#28

Update all-in-one-no-pm.py

added decoding of bytestring to provide Python3 compatibility.

Update all-in-one.py

added decoding of bytestring to provide Python3 compatibility.

Update luftdaten.py

added decoding of bytestring to provide Python3 compatibility.

Merged cipy-master

Dropped obsolete .decode()

testing all examples, with corrections for Python3 support

allow temperature reads to converge a bit faster

use generic variables; handle pms5003.ReadTimeoutError

use generic variables in -no-pm code too

improved logging with timestamps (instead of print)

catching the correct ReadTimeoutError for pms5003

Replaced exception pass with log warning

Fix typo

Transitional fix for new LTR559 library

Added a new combined mode example

This is a modification of all-in-one.py. It adds another mode where all EnviroPlus and PMS5003 sensor readings are combined on one screen.

Each variable that is displayed can have custom warning limits assigned which change the color of the text according to a predefined RGB palette. It allows for a quick glance of all sensor readings at once in order to jugde if everything is OK in the air or to quickly pinpoint a sensor reading that requires attention.

In addition, the new combined mode saves each reading as soon as it is received for graphing later. As in all-in-one.py, moving your finger close to the proximity sensor switches the mode.

Fixed graphing problem for PMS5003 results

The PMS5003 library returns integers. This causes the current formula for color scaling of the graph to not work properly because of integer division instead of float division. Converting the PMS5003 results from int to float solves the problem.

Adding all in one weather and light display example

Adding Python 3 shebang

Python 3-related fixes, moving to pip fonts, fixing Astral errors.

Remove inappropriate sleep between reads

The PMS5003 seems to buffer unread samples. If you are reading at a lower rate than it takes readings, then a progressively larger delay will occur between changes in actual PM levels and indicated PM levels.

To see the issue:
1) run this example with the `time.sleep(1)` *included*
2) wait a few minutes
3) burn a piece of paper near the sensor and wait for the reported PM levels to spike

With the sleep included, there is a delay between introducing smoke and seeing reported levels rise (often a few minutes or longer). With the sleep removed you will see reported levels update almost immediately.

The correct way to use the sensor is to read as fast as the sensor allows, and not make any assumptions about what rate samples will be published at

Noise library and examples for basic FFT and frequency binning

Tidy up noise examples

Add dtoverlay for mic

Add DocStrings and linting

Fix noise-profile example

Add deps for noise measurement

Fix launch bug in all-in-one-no-pm.py

Launching all-in-one-no-pm.py results in an error due to line 57. FontSize should be replaced with the variable font_size, to run line 57 without error.

Sleep before first PMS5003 reading

Prep for v0.0.2

Update README for 0.0.2

Address Issue pimoroni#55

Fix noise_floor bug

Test tweaks and linting

I've re-written the tests to use conftest.py to set up and tear down mock modules via fixtures.

I have also linted the examples, removing redundant linebreaks, commenting out unused variables and attempting to simplify long lines.

Test noise, fix gas

Move package and requires to setup.cfg

Drop Python 2.6

Catch pimoroni#61 with tests and fix

Include python cffi in setup dependencies

Added supported board images and  example

Correcting examples

Adds mqtt example (pimoroni#68)

Adds mqtt example by @robmarkcole - see also: https://github.com/robmarkcole/rpi-enviro-mqtt

Added user projects section to README

Update mqtt-all.py

Fix combined.py indentation for Python 3.x

Experimental fix to communicate Py version reqs for pimoroni#78

Minute instead month in backup file name

Fix for the DATESTAMP variable, to show proper file name.

Added user project: enviroplus_exporter

Add GitHub actions workflow

Remove .travis.yml

Update python versions for CI (pimoroni#96)

* Drop Python 3.4 - GitHub reports it as not found, despite it being in the list it links to!?!?!?
* Fix Coveralls

Add two third party projects to the  README

adds username and password parameters to mqtt-all

adds username and password check

fix checking for username and password

Adding MQTT Username / Password & TLS Config

Signed-off-by: James Sutton <[email protected]>

Tweaking the arguments for MQTT TLS

Signed-off-by: James Sutton <[email protected]>

Adding MQTT Username / Password & TLS Config

Signed-off-by: James Sutton <[email protected]>

Add support for ADS1115

Use the auto-detect feature of the ADS1015 library to support reading the gas sensor via an ADS1115.

Add support for ADS1115

Switch README to markdown (drop dependency on pandoc)

Update luftdaten.py

Add Logging, PMS5003 Checksum exception and Luftdaten exception handling as per Issue pimoroni#81

Update luftdaten.py

Added suggested changes but removed "logging.info('Luftdaten Climate Success', values)", since I found it redundant, given the use of "logging.info("Luftdaten Response: OK")" in Line 215.

Drop Python2 support.

Linting fixes

Add available() method to gas sensor

This change catches an IOError when setting up the gas sensor and provides an `available()` method for determining if a sensor is present.

Trigger tests

Test read_all throws exception when unavailable

Fixup tests for ADC detect.

Update changelog & readme

Drop Python2 from Makefile

Correct README to python3

Direct users toward Python3, install explicitly

Add check-install.py debug script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants