# Enviro + air screen not displaying data

**URL:** https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025
**Category:** Support
**Created:** [September 29, 2020, 5:01pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025 "2020-09-29T17:01:01Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![wazscience](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@wazscience](https://forums.pimoroni.com/u/wazscience)
#### Post date: [September 29, 2020, 5:01pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/1 "2020-09-29T17:01:01Z")

</div>

after installing the single line installer ,and using the **all-in-one-enviro-mini.py** as my code. when i run it in the IDE, I get the sensor data, but no data is showing on the screen. the only thing i see is the screen slightly lighting up. Im using rasbian with desktop, and fully upgraded the os a few days ago. I also installed new fonts. Im not sure what is going on, or how to fix it. Im afraid the screen might not be functional.

---

<div class="post-metadata">

### Author: ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)
#### Post date: [September 29, 2020, 5:16pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/2 "2020-09-29T17:16:03Z")

</div>

Why did you start a second duplicate thread on this?

> [@Enviro + air not working after installing code](https://forums.pimoroni.com/t/enviro-air-not-working-after-installing-code/15010):
>
> I recently got the enviro + air quality, and Im having trouble getting it started. when i first installed the one line code, it aborted itself, so i updated rasbian. after, I installed the sensor board on the pi, the screen flashed and turned off, and I re ran the one line code. It installed, but the screen on the board is not showing any data or turning on. Even after restarting and re plugging in the board, i still see nothing. Im not sure what Im doing.

---

<div class="post-metadata">

### Author: ![wazscience](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@wazscience](https://forums.pimoroni.com/u/wazscience)
#### Post date: [September 29, 2020, 5:19pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/3 "2020-09-29T17:19:35Z")

</div>

I thought I would have to start another post for a separate problem. the first post was about getting the board to register, but when the screen didnt work with the code, i thought that it was a new issue.

---

<div class="post-metadata">

### Author: ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)
#### Post date: [September 29, 2020, 6:57pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/4 "2020-09-29T18:57:17Z")

</div>

Ok, explained that way fair enough. My bad.

---

<div class="post-metadata">

### Author: ![wazscience](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@wazscience](https://forums.pimoroni.com/u/wazscience)
#### Post date: [September 29, 2020, 7:42pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/5 "2020-09-29T19:42:20Z")

</div>

you have any ideas why the screen isnt showing anything? i literally copy pasted the file in to the ide. I looked through the code, with my limited python knowledge, and i cant seem to find the problem.

---

<div class="post-metadata">

### Author: ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)
#### Post date: [September 29, 2020, 8:16pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/6 "2020-09-29T20:16:08Z")

</div>

Try this bit of code. According to the Enviro+ pinout the display uses SPI0, CE1, and GPIO 12 for the backlight. I modified the breakout garden scrolling text example for that screen accordingly.

```auto
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import time

import ST7735

MESSAGE = "Hello World! How are you today?"

# Create ST7735 LCD display class.
disp = ST7735.ST7735(
    port=0,
    cs=1,
    dc=9,
    backlight=12,        
    rotation=270,
    spi_speed_hz=10000000
)

# Initialize display.
disp.begin()

WIDTH = disp.width
HEIGHT = disp.height

img = Image.new('RGB', (WIDTH, HEIGHT), color=(0, 0, 0))

draw = ImageDraw.Draw(img)

font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 30)

size_x, size_y = draw.textsize(MESSAGE, font)

text_x = 160
text_y = (80 - size_y) // 2

t_start = time.time()

while True:
    x = (time.time() - t_start) * 100
    x %= (size_x + 160)
    draw.rectangle((0, 0, 160, 80), (0, 0, 0))
    draw.text((int(text_x - x), text_y), MESSAGE, font=font, fill=(255, 255, 255))
    disp.display(img)

```

---

<div class="post-metadata">

### Author: ![wazscience](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@wazscience](https://forums.pimoroni.com/u/wazscience)
#### Post date: [September 29, 2020, 8:27pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/7 "2020-09-29T20:27:26Z")

</div>

just tried the code, and i see no text. this is what it what i see in command prompt  
/tmp/geany\_run\_script\_K895R0.sh: 7: /tmp/geany\_run\_script\_K895R0.sh: ./test: not found

* * *

(program exited with code: 127)  
Press return to continue

---

<div class="post-metadata">

### Author: ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)
#### Post date: [September 29, 2020, 9:22pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/8 "2020-09-29T21:22:28Z")

</div>

Saved it as a python file first? LCD.py for example. Then ran it from the IDE?

---

<div class="post-metadata">

### Author: ![wazscience](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@wazscience](https://forums.pimoroni.com/u/wazscience)
#### Post date: [September 29, 2020, 10:09pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/9 "2020-09-29T22:09:48Z")

</div>

i put it in the ide, saved it as a file, then executed it. first i did it in geany, then i did it in thonny. when i do it in thonny i get this message

%Run ‘screen test.py’  
Traceback (most recent call last):  
File “/home/pi/screen test.py”, line 18, in   
spi\_speed\_hz=10000000  
File “/usr/local/lib/python3.7/dist-packages/ST7735-0.0.4-py3.7.egg/ST7735/ **init**.py”, line 186, in **init**  
GPIO.setup(backlight, GPIO.OUT)  
ValueError: The channel sent is invalid on a Raspberry Pi

---

<div class="post-metadata">

### Author: ![wazscience](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@wazscience](https://forums.pimoroni.com/u/wazscience)
#### Post date: [September 29, 2020, 10:15pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/10 "2020-09-29T22:15:30Z")

</div>

do you think i should do a fresh install of the software for the board? how would i do that, if i should?

---

<div class="post-metadata">

### Author: ![wazscience](https://avatars.discourse-cdn.com/v4/letter/w/d9b06d/32.png) [@wazscience](https://forums.pimoroni.com/u/wazscience)
#### Post date: [September 29, 2020, 10:52pm UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/11 "2020-09-29T22:52:39Z")

</div>

i changed the spi\_speed\_hz to 10,and i get the same message

Traceback (most recent call last):  
File “/home/pi/test me.py”, line 18, in   
spi\_speed\_hz=10  
File “/usr/local/lib/python3.7/dist-packages/ST7735-0.0.4-py3.7.egg/ST7735/ **init**.py”, line 186, in **init**  
GPIO.setup(backlight, GPIO.OUT)  
ValueError: The channel sent is invalid on a Raspberry Pi

---

<div class="post-metadata">

### Author: ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)
#### Post date: [September 30, 2020, 9:36am UTC](https://forums.pimoroni.com/t/enviro-air-screen-not-displaying-data/15025/12 "2020-09-30T09:36:18Z")

</div>

The error is actually happening in ST7735/init.py  
The display is failing to initialize? I don’t know why though?  
Lately I have been using thonny.  
I have three of those displays hooked up to SPI1 and running simultaneously.

If you want to start over fresh. Reimage your SD card with the latest Pi OS. Don’t use NOOBS, go with just straight PiOS. Do the update upgrade.  
Leave the Envidro+ connected.  
Then run the `curl -sSL https://get.pimoroni.com/enviroplus | bash`  
Reboot and try an example, there should be an LCD.py file in the example folder that does the same thing as the one I posted above. Scrolls hello World,.
