Sending Data To The Pipsta Printer With PHP

I’ve been messing with the Pipsta mini-printer that connects to the Raspberry Pi. I wasn’t sure exactly what I wanted to do with it so I decided to learn how to send messages to it via the web. To do this you need to use the example software that comes with the printer and runs on the Raspberry Pi, a third-party MySQL server, and a little PHP.

To start, you have to set up your Pi to ping an addressable database. You can learn how to do that here. You can then then set up the server to receive jobs from the database and test it by sending a few jobs via the command line.

Now that you have it running you can play around with the printer from almost any server. For example, I wrote the following script that connects to the db and injects a hex-converted bit of text from the web. It’s obviously wildly unsafe and features no error checking but it works. You can try it out here.

Why would you want to do this? I don’t know. I’m thinking of creating a to-do list that automatically prints every day as well as a notification system that will get my attention via physical means. It’s a fun little toy and I’m really impressed by how easy it is to program.

<body> <h1>Hi. You can send me a printed note. Go ahead.</h1>

";
}

echo '
<form action="index.php" method="post"> Name: <input type="text" name="name"><br> Message: <input type="text" name="message"><br> <input type="submit"> </form> </body> </html>

';

?>

ShareShare on Facebook9Share on Google+0Tweet about this on TwitterShare on LinkedIn0Share on Reddit17Share on Tumblr0Email this to someonePrint this page

Comments are closed.