Hi all,
I just started working with electric imp and am trying to get data (num) from my imp to a XAMPP webpage.
I followed the tutorial for HTTP Request. But instead of getting “200”, I get “405”.
My planner looks like:
My imp code is:
// Output port to send temperature readings local output = OutputPort("number");// Register with the server
imp.configure(“Logger”, , [output]);local num = 12;
output.set(num);
server.show(num);// End of code.
My php is:
<?php /* Electric Imp POST Example */if(isset($_POST[‘value’]))
{
$fd = fopen(‘impdata.txt’, ‘a’);if(flock($fd, LOCK_EX)) { fwrite($fd, $_POST['target'] . ' ' . $_POST['channel'] . ' ' . gmdate('Y-m-d H:i:s') . ' ' . number_format($_POST['value'], 2) . "C\
");
fflush($fd);
flock($fd, LOCK_UN);
}fclose($fd);
}
?>
Any help is greatly appreciated! Thanks!