I am using the below code:
#!/usr/bin/python
import sys
sys.path.insert(0, '/usr/lib/python2.7/bridge/')
from bridgeclient import BridgeClient as bridgeclient
from bottle import run, route, get, post, request
bc = bridgeclient()
@route('/status')
def status():
try:
hum = bc.get("HUMkey")
temp = bc.get("TEMPkey")
print "Humidity: %s " % hum
print "Temperature: %s " % temp
return "Humidity= "+hum+"
Temperature="+temp
except Exception as err:
return "Something is wrong...
%s" % str(err)
def main():
run(host='192.168.1.9', port=8080, debug=True)
if __name__ == '__main__':
main()
and when I open in the browser the following path
http://192.168.1.9:8080/status
I am seeing
Something is wrong... [Errno 146] Connection refused
so what might be refusing the connection ? I am running the above code in arduin Yun shield terminal with root privileges.
attached sketch of dht sensor that reads temperature and humidity
DHT_sensor.ino (1.94 KB)