no websocket ,it uses a GET request capture data is sent to the url and dumped into mysql and text file simultaneously the simple explode the text file
$file_live = file_get_contents(‘MBrealtimeupload.txt’);
$meteobridgeapi = explode(" ", $file_live);
thats it then simply assign
$temp = $meteobridgeapi[2];
$barometer = $meteobridgeapi[10];
$raintoday = $meteobridgeapi[9];
$uv = $weatherflow['uv'];
$windgust = $meteobridgeapi[6];
$windspeed = $meteobridgeapi[5];
$solar = $weatherflow['solar'];
$dewpoint = $meteobridgeapi[4];
$rainrate = $meteobridgeapi[8];
$direction =$meteobridgeapi[7];
for mysql
mysqli_query($conn,“INSERT INTO weather34station(time,outsideTemp,barometer,raintoday,UV,windgustmph,windSpeed,radiation,dewpoint,rainrate,direction,date,lightning)
VALUES(’$updated’, ‘$temp’, ‘$barometer’,’$raintoday’,’$uv’,’$windgust’,’$windspeed’,’$solar’,’$dewpoint’,’$rainrate’,’$direction’,’$date’,’$lightning’)”);}
else if (mysqli_connect_errno()) {
printf(“Connect failed: %s\n”, mysqli_connect_error());
exit();}
all this is in the same file so each time the meteobridge pings the url file all this happens every ten seconds.
for weather flow data I only insert the uv/solar into the template and mysql
$file1 = ‘…/jsondata/weatherflow.txt’;
$url = $file1;
$content = file_get_contents($url);
$json = json_decode($content, true);
foreach($json[‘obs’] as $item)
//foreach($json[‘station_units’] as $item2)
{
$weatherflow[‘solar’] = $item[‘solar_radiation’];
$weatherflow[‘uv’] = $item[‘uv’];
}
hope that helps bottom line its all automated no hands or manually doing things last reboot of meteobridge was October for a firmware upgrade and if erroneous(bad) data is received or sent the mysql ignores it with some basic php IF{} code .
Confused 