Go Down

Topic: getting connection refused error while trying to get key from bridgeclient (Read 297 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy