Hi guys,
I need our help. In my python script I receive udp broadcasts. I get an error unexpected indent. What is my mistake ? On top of the script the value.put works fine.
import select, socket, sys
sys.path.insert(0, '/usr/lib/python2.7/bridge/')
from bridgeclient import BridgeClient as bridgeclient
value = bridgeclient()
port = 65000 # where do you expect to get a msg?
bufferSize = 1024 # whatever you need
#url = "arduino/d"
#value.put('d',url)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('<broadcast>', port))
s.setblocking(0)
var = 10
while var >0:
result = select.select([s],[],[])
msg = result[0][0].recv(bufferSize)
print msg
if msg.find('d') != -1:
list = msg.split(';',1)
url = list[0] + "/arduino/d"
value.put('d',url)
print url
var = var - 1
root@Arduino:~# python udp_receiver_copy.py
File "udp_receiver_copy.py", line 24
value.put('d',url)
^
IndentationError: unexpected indent
Thanks
Andreas