Howdy guys I have a bit of an issue. I am able to query the Fusion/Reactor Board for the Minutes and Seconds of all 16 timers. However, the data is not returned in any given order that I can make sense of. It doesn’t match the order that base station receives it is nor documentation. Maybe I am doing something wrong? Any suggestion would be awesome!
import socket
import re
TCP_IP = '192.168.1.101'
TCP_PORT = 2101
BUFFER_SIZE = 40
MESSAGE = 'aa03e96a03'
print MESSAGE
# Setup for checksum calc
dataOutPairs = re.findall('..?', MESSAGE)
dataOutPair = 0
# Add together
for dop in dataOutPairs:
dataOutPair = dataOutPair + int(dop, 16)
# Get Checksum
checksum = dataOutPair & 255
# Convert to 2 char hex still ascii
checksum = '{:02X}'.format(checksum)
# create payload
payload = MESSAGE.decode('hex') + checksum.decode('hex')
s = socket.socket()
s.connect((TCP_IP, TCP_PORT))
s.send(payload)
data = s.recv(BUFFER_SIZE)
data = data.encode('hex')
pairs = re.findall('..?', data)
print pairs
for pair in pairs:
print int(pair, 16)
print "---------------------------------------"
s.close()
Using Wireshark and Base Station:
aa03e96a0303 aa200006001100050012001b000a001e00071e000019002d00000000000100000000a7
Return from above Script
aa03e96a03 ['aa', '20', '00', '00', '00', '11', '00', '05', '00', '12', '00', '1b', '00', '0a', '00', '1e', '00', '07', '1e', '00', '00', '19', '00', '2d', '00', '00', '00', '00', '00', '01', '00', '00 ', '00', '00', 'a1']