Commit f77e6035 authored by Peter-Bernd Otte's avatar Peter-Bernd Otte
Browse files

Changed HTTP Headers and more MQTT debug msgs

parent 12b66cb3
......@@ -57,8 +57,8 @@ client= paho.Client(args.mqtt_client_name)
client.on_connect = on_connect
client.on_disconnect = on_disconnect
logger.debug("connecting to broker "+args.mqtt_broker_host)
client.enable_logger(logger)"connecting to broker "+args.mqtt_broker_host)
client.loop_start() #start loop to process received messages in separate thread ("MQTT Loop started.")
......@@ -68,7 +68,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_header("Content-type", "text/json;charset=UTF-8")
self.send_header("Access-Control-Allow-Origin", "<origin> | *")
self.send_header("Access-Control-Allow-Origin", "*")
# self.path equals GET Parameter: "/foo/bar/".
erg = parse.parse("/{topic}/set?{value:d}", self.path)
......@@ -76,7 +76,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
topic = unquote(erg['topic']) if erg else None
if erg and topic in mlast:
if 'value' in erg:"publish: "+str(topic)+" value: "+str(erg['value']) )
client.publish(topic+"/set", erg['value'], qos=1, retain=False) # send command to Relais
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment