import sys, struct
import time
from socket import *
SIZE = 1024 # packet size
hostName = gethostbyname('0.0.0.0')
mySocket = socket(AF_INET,SOCK_DGRAM)
mySocket.bind((hostName,18726))
repeat = True
while repeat:
(data,addr) = mySocket.recvfrom(SIZE)
data = struct.unpack('d',data)
print int(data[0])
Is 18726 the TCP/IP port assigned to the pi? SIZE=packet size? what if it changes dynamically? Thanks...
ReplyDeleteWorth for my valuable time, I am very much satisfied with your blog. Thanks for sharing.
ReplyDeleteData Science Courses in Bangalore
Best Data Science Courses in Bangalore
German Classes in Bangalore
devops training in bangalore
Java Training in Bangalore
digital marketing courses in bangalore
Nice blog.Keep up the work.
ReplyDeletePython training in Nagpur