Arduino Forum

Products => Arduino Yún => Yún Shield => Topic started by: seaurchin on Mar 05, 2017, 06:08 pm

Title: getting connection refused error while trying to get key from bridgeclient
Post by: seaurchin on Mar 05, 2017, 06:08 pm
I am using the below code:

Code: [Select]

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()

def status():
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='', port=8080, debug=True)

if __name__ == '__main__':

and when I open in the browser the following path 
Code: [Select]
 I am seeing [/color]
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