03-13-2023, 03:49 AM
03-13-2023, 04:35 AM
see this guide about PHP tcp socket connection code:
https://www.php.net/manual/en/function.s...onnect.php
https://www.php.net/manual/en/function.s...onnect.php
03-13-2023, 04:52 AM
(03-13-2023, 04:35 AM)admin Wrote: [ -> ]see this guide about PHP tcp socket connection code:
https://www.php.net/manual/en/function.s...onnect.php
So it is just a string to send to the server/device?
Sample:
PHP Code:
$message = 'RELAY-SET-255,1,0';
socket_write($socket, $message, strlen($message));
03-13-2023, 06:19 AM
yes, very easy.
$message = 'RELAY-SET-255,1,1'; //turn on relay1
$message = 'RELAY-SET-255,1,0'; //turn off relay1
$message = 'RELAY-SET-255,1,1'; //turn on relay1
$message = 'RELAY-SET-255,1,0'; //turn off relay1
03-13-2023, 10:51 AM
(03-13-2023, 06:19 AM)admin Wrote: [ -> ]yes, very easy.
$message = 'RELAY-SET-255,1,1'; //turn on relay1
$message = 'RELAY-SET-255,1,0'; //turn off relay1
Awesome, Thank you.
I have a Smart City and BMS project this year. I will use this product from one of my integration.
03-13-2023, 11:01 AM
ok, thanks, test with first controller. good luck.