I am trying to send a message from a PHP site via TCP / IP to an Arduino.
With the following code, I can send a message from the php website
<?php
$errno = NULL;
$error = NULL;
if (!$handle = @fsockopen("192.168.188.24", "49419", $errno, $error, 10))
{
die("Fehler (".$errno."): ".$error);
}
fwrite($handle, "ON\r\n");
fclose($handle);
?>
The problem is that when you call the website for the first time, the message is not delivered immediately. After some website updates, a message arrives, but logically, as many times as the number of websites is updated.
Already tried to limit the message length to 2 bytes, but without any success.
source
share