I think I understand what went wrong here. As we received [1, 0, 4, 0, 16, 0, 64, 0 ] where the sum is 85 I realize that I instead of evaluting the relay status request command response, I have used the message response (85). That's why things goes wrong
But interesting to know is if the relay 1 still operated correctly or not? I mean if the message sent was correctly formatted?
I need to have more information about what is actually returned from the boards on the relay status
request command and to find away to discard the 85 response (problem here is that 85 is also a valid response to the relay status request so selecting 85, 86, 87 etc as a generic message response as they did was a bad choice when they designed the protocol)
Please run this python script and paste the result in your response. The script will just ask for relay status request 10 times with a 1 second delay and print the response
# coding: utf-8
import sys
import os
import socket
import time
TCP_PORT = 2101
BUFFER_SIZE = 1024
IP = '192.168.12.194'
cmds = {
"R_TEST" : bytes ((170,5,188,50,1,65,1,224))
}
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
p = s.connect_ex((IP, TCP_PORT))
for i in range(0,10):
res = s.send((cmds['R_TEST']))
print(res)
print(len(res))
res = s.recv((1024))
print(res)
print(len(res))
time.sleep(1)
s.close()
del(s)