# Same values every Envrio+ print out

**URL:** <https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371>\
**Category:** Support\
**Created:** [August 20, 2019, 4:25pm UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371 "2019-08-20T16:25:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Everitt](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Everitt](https://forums.pimoroni.com/u/Everitt)\
**Post date:** [August 20, 2019, 4:25pm UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371/1 "2019-08-20T16:25:30Z")

</div>

Trying to send some values from the new Enviro+ to a telegram chatbot for a home weather update on demand within a group chat.

What I have come to realise though, the bot work fine, but the outputted data is always the same.  
The current tempurature is 21.70818430223153 \*C  
The current pressure is 700.2708792437015hPa  
The Current Humidty is 84.54408663293306 %

I also realised that this is always the same in the first print from the weather.py example  
Temperature: 21.71 \*C  
Pressure: 700.27 hPa  
Relative humidity: 84.54 %

Just using basic code as a demo and still getting the same:  
#!/usr/bin/env python

from bme280 import BME280

try:  
from smbus2 import SMBus  
except ImportError:  
from smbus import SMBus

bus = SMBus(1)  
bme280 = BME280(i2c\_dev=bus)

temp = bme280.get\_temperature()  
pressure = bme280.get\_pressure()  
humidity = bme280.get\_humidity()

print(temp)  
print(pressure)  
print(humidity)

Anyone know a fix for this as I dont want it in a loop unfortunatly, just need a one time print on demand.

Thanks

E

---

<div class="post-metadata">

**Author:** ![Fieel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/fieel/32/6091_2.png) [@Fieel](https://forums.pimoroni.com/u/Fieel)\
**Post date:** [December 11, 2019, 3:50pm UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371/2 "2019-12-11T15:50:58Z")

</div>

I have the same exact problem

---

<div class="post-metadata">

**Author:** ![Everitt](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Everitt](https://forums.pimoroni.com/u/Everitt)\
**Post date:** [December 14, 2019, 9:18pm UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371/3 "2019-12-14T21:18:00Z")

</div>

I did find a work around, but I am struggling to remember which file it is, but maybe this would help?

#!/usr/bin/env python

from telegram.ext import Updater, InlineQueryHandler, CommandHandler  
import requests  
import re  
from bme280 import BME280

try:  
from smbus2 import SMBus  
except ImportError:  
from smbus import SMBus

bus = SMBus(1)  
bme280 = BME280(i2c\_dev=bus)

def weather(bot, update):  
chat\_id = update.message.chat\_id  
temperature = bme280.get\_temperature()  
pressure = bme280.get\_pressure()  
humidity = bme280.get\_humidity()  
current\_temp = "The current tempurature is " + str(temperature) + " \*C " + "\nThe current pressure is " + str(pressure) + “hPa” + “\nThe Current Humidty is " + str(humidity) + " %”  
bot.send\_message(chat\_id=chat\_id, text=current\_temp)

def main():  
updater = Updater(’\*\*\*\*\*\*\*\*\*\*\*\*\*\*’)  
dp = updater.dispatcher  
dp.add\_handler(CommandHandler(‘weather’,weather))  
updater.start\_polling()  
updater.idle()

if **name** == ‘ **main** ’:  
main()

Stared out updater being my bot key

---

<div class="post-metadata">

**Author:** ![nophead](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/nophead/32/5827_2.png) [@nophead](https://forums.pimoroni.com/u/nophead)\
**Post date:** [December 17, 2019, 8:39am UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371/4 "2019-12-17T08:39:57Z")

</div>

I found that the first set of reading are junk, so I do a dummy read at the beginning of my program and throw the results away. A pressure of 700 hPa seems wrong to me, I have never seen a real pressure that low and 85% humidity is higher than I have ever experienced in the UK.

---

<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:** [December 17, 2019, 10:09am UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371/5 "2019-12-17T10:09:10Z")

</div>

My Sense Hat will show 0 mb on first boot up and first reading. Next time around it would be fine. I added a line to my code to not display it if = 0. I don’t think I have ever seen a reading below 900 mb here in Atlantic Canada.  
My Sense Hat would also sometimes show the humidity above 100%. I added a line to cap it at 100%

Eventually I switched to a BME680 for my readings, the only thing I use on the Sense Hat now is the LED matrix to display my messages and the 5 way switch to adjust display brightness etc. It runs headless. At some point I’d like to swap out the sense hat for a Unicorn Hat. I just have go find my round 2it.  
Or buy an Enviro + and swap it all out for that.

---

<div class="post-metadata">

**Author:** ![Everitt](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Everitt](https://forums.pimoroni.com/u/Everitt)\
**Post date:** [December 17, 2019, 2:10pm UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371/6 "2019-12-17T14:10:46Z")

</div>

Yes, sorry if this wasn’t the right code for the dummy reading, but that seems like what I did the end…

I have recently formatted my PC and lost the code I used in the past unfortunately… quite annoying, Im not that hot on python and takes a while for me to do stuff, but that’s how I worked around it in the long run, I was using one of the Enviro+ boards too, they are alot better now

---

<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:** [December 17, 2019, 3:07pm UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371/7 "2019-12-17T15:07:40Z")

</div>

If that code is running on your Enviro you could get it back. Hook up a monitor and keyboard and drag and drop the py file onto a thumb drive then copy it back to your PC for backup.

---

<div class="post-metadata">

**Author:** ![Everitt](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Everitt](https://forums.pimoroni.com/u/Everitt)\
**Post date:** [December 19, 2019, 10:13am UTC](https://forums.pimoroni.com/t/same-values-every-envrio-print-out/11371/8 "2019-12-19T10:13:36Z")

</div>

Unfortunately, I wiped the pi it was running on to take the card for a pi4 build which is running on a different project now :(

Will try and have a tinker over the Christmas break
