Forum Discussion
On 11/19/2018 at 1:04 AM, Guest Bobby said:Hi Jeff
I was wondering if you can assist me in configuring/ extending SNMPv3 on my raspberry pi to get temperature readings from a DHT22 sensor.
- I have written a python program / script that returns temperature and humidity as follows:
import sys
import Adafruit_DHT
sensor = 22
pin = 4
humidity, temprature =Adafruit_DHT.read_retry(sensor, pin)
if humidity is not None and temprature is not None:
print ('{0:0f}* {1:0.1f}%'.format(temperature, humidity ))
else
print ('Failed to get reading')
sys.exit()
- in my snmpd.conf file I have put the line below
extend-sh test1 /usr/bin/python3 /home/pi/Adafruit_Python_DHT/examples/Final_AdafruitDHT.py
I tried running snmpwalk but I don't get an OID for the temp and humidity.
Your print command has "temperature" whereas your variable is named "temprature"
Related Content
- 2 months ago
- 2 years ago
- 2 years ago
- 6 months ago