Go Down

Topic: getting connection refused error while trying to get key from bridgeclient (Read 768 times) previous topic - next topic

seaurchin

I am using the below code:

Code: [Select]
#!/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+"<br>Temperature="+temp
except Exception as err:

return "Something is wrong...<br> %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 
Code: [Select]
http://192.168.1.9:8080/status
[color]
 I am seeing [/color]
Quote
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 

Go Up