I am sending a UDP-packet in double data type to a RaspberryPi via Simulink. I want to decode the UDP-packet with the following code:
import struct
import socket
sock = socket.socket(socket.AF_INET,socket.SOCK_GRAM)
sock.bind(("",5002))
data,addr= sock.recvfrom(1024)
struct.unpack('d','data')
print data
and I receive the following error:
struct.error: unpack requires a string argument of length 8
thanks in advance for any help!