Comments (8)
@elysio2 Can you give more details in how you got that error? Was that on install? Was it when you tried to take a temp reading? Any details you can give help in debugging the issue. Thanks.
from pi-sht1x.
@drohm Simply running the sensor.py file after a pip3 install makes this error. examples.py still works, as well as any custom code.
File "sensor.py", line 46, in main
logger=logger) as sensor:
from pi-sht1x.
Thanks @elysio2. Can you give details on how you're invoking sensor.py versus the examples.py?
from pi-sht1x.
@drohm
sensor.py : sudo python3 sensor.py 18 23
examples.py : sudo python3 temp2.py
(temp2.py is a copy/paste of examples.py)
from pi-sht1x.
The sensor.py isn't meant to be invoked that way. If you browse through the README, you'll see you can make calls like this:
from pi_sht1x import SHT1x
with SHT1x(18, 23, gpio_mode=GPIO.BCM) as sensor:
temp = sensor.read_temperature()
humidity = sensor.read_humidity(temp)
sensor.calculate_dew_point(temp, humidity)
print(sensor)
Give that a try and let me know.
from pi-sht1x.
That works , but FYI the readme clearly states
sensor.py
This script is callable from the terminal and the sensor parameters are passed into the script.
sudo python3 sensor.py 18 23 -g 'BCM'
This executes the sensor script using data_pin=18, sck_pin=23, and gpio_mode=GPIO.BCM. The script will then create an instance of the SHT1x class and read in the temperature, humidity, and calculate the dew point five times, sleeping 2 seconds in between each measurement.
I was only using this for testing purposes when I forgot the 10k pull-up resistor, just thought you should know.
from pi-sht1x.
@elysio2 Ahh, okay. I'll dig into this later today and update the README accordingly. Thanks for bringing this up.
from pi-sht1x.
@elysio2 What version of the pi-sht1x library is installed? If you could look at the SHT1x class, could you confirm that the version installed on your system has the logger
parameter defined in the __init__()
method?
from pi-sht1x.
Related Issues (14)
- failure to setup HOT 11
- default logging HOT 4
- SHT11 Sensor values exceeds 100% max limit HOT 1
- SHT1x failed to properly receive command HOT 7
- Is it working for Raspberry Pi 3? HOT 9
- Using pi-sht1x library simultaneously with another snesor which uses serial protocol
- Import problem HOT 1
- SHT1X failed to properly receive command [['WriteStatusRegister'] - 00000110] HOT 3
- Investigate SHT7x Support HOT 3
- Wrong formula used to calculate dew point HOT 3
- SHT1x failed to properly receive command HOT 13
- Stopping re-setting of GPIO's HOT 2
- install Error HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi-sht1x.