Music On Console is a lightweight music player which consists of 2 parts, a server (Moc) and a player/interface (Mocp). PHP example file <?php $ret = exec(“sudo mocp -S”, $out, $err); print_r($ret); print_r($out); print_r($err); $ret = exec(“amixer -q sset Master 70%”, $out, $err); $ret = exec(“sudo mocp -l /music/sounds/01.mp3”, $out, $err); sleep(10); $ret = exec(“sudo mocp . . .
Category: PHP Examples
PHP temperature monitoring KMtronic Temperature Monitor

PHP File: <?php // Loading the XML file $xml = simplexml_load_file(“http://88.87.29.196:8002/status.xml”); foreach($xml->children() as $sensor) { echo $sensor->name.” “; echo ” temperature is “.$sensor->temp.”\r\n”; } ?> Output: 2874EDD0040000F3 temperature is 25.62 284108D104000072 temperature is 24.50 28C9A0B804000037 temperature is 26.06 28F3FDB80400006C temperature is 29.93 . . .
Test display temperature from KMtronic Temperature Monitor on LG TV with Raspberry PI

KMtronic LAN DS18B20 WEB Temperature Monitor DS18B20 Features: • Fully assembled and tested. • Measures Temperatures from -55°C to +125°C (-67°F to +257°F) • Support up to 4 temperature sensors Complete including: – 1 x LAN 1-Wire Adapter – 4 x DS18B20 Temperature Sensors 1 meter cable Default: IP address: 192.168.1.199 Subnet Mask: . . .
Ping and Reset your server automatically using KMtronic LAN relay board

What to do when your server crashes (1) Using this information install and try manual resetting How to reset your server remotely using KMtronic LAN relay board (4) PHP file . . .
PHP code for Read STATUS KMtronic WEB Relay board using status.xml

KMtronic WEB Relay board status XML status Result PHP File <?php echo “<br><h1>”; $xml = simplexml_load_file(“http://192.168.1.199/status.xml”); echo “<br />————“; echo “<br />Relay1 is “; echo $xml->children()->relay1; echo “<br />Relay2 is “; echo $xml->children()->relay2; echo “<br />Relay3 is “; echo $xml->children()->relay3; echo “<br />Relay4 is “; echo $xml->children()->relay4; echo . . .