Difficulty Level

No Linux or Raspberry Pi knowledge is required

Time to Complete

This tutorial is limited to demonstrating the app, rather than explaining how it works

Who Should Read This Document

This tutorial is suitable for anyone wishing to demonstrate printing over the web as a basis for Internet of Things and/or Internet of People applications. This document also provides a good grounding for subsequent web printing tutorials.

Warning

Although this is a primitive implementation, it is quick, simple to understand and portable between web hosting companies. This is not necessarily the most robust nor secure implementation, so please be aware of these limitations and DO NOT use this as the basis for anything other than a demonstration system!

Pre-Requisites

It is expected that you have a fully-working, web-connected Raspberry Pi and Pipsta

5) Use nano again to create a file called data.txt, in the same folder, with the contents:

Hello from Pipsta over the Web!

with a trailing carriage return.

6) Look on the rear of your printer to determine its serial number. It should start with a G, followed by several digits

7) In LXTerminal, enter:

python WebSend.py “<your serial number>” “data.txt”

8) If all is well, you should see the message “Print job created!” appear on the next line in
LXTerminal

9) If all is not well, first check ALL of the details: user, password, host, db and port. Then check your internet connection is okay.

10) Once you have found the success message, go to FreeHostia, log-in, and in phpMyAdmin look at the printdata table by clicking on the printdata hyperlink:

11) Within the table, you should now see a single line, as follows:

12) You should recognise your printer serial number under the printer_id field, however the
print_data differs in appearance to the message you entered in data.txt. This is actually
ASCII encoded hex, where pairs of characters represent individual characters. To confirm this for yourself:

Click ‘+Options’ above the record

Select ‘Full texts’ and click the ‘Go’ button:

You should now see a full line of ASCII encoded hex under print_data:

Now, move the mouse pointer to the start of the data under print_data and click and drag the cursor over the full length of the data (from the first ‘4’ to the last ‘a’). Now copy this by pressing [CTRL][C].

Next Steps

Shutting Pipsta Down Safely

Whilst the printer is resilient when it comes to powering down, the Raspberry Pi must undergo a strict shutdown process to avoid corrupting the Micro SD card. The most straightforward method of doing this is to double-click the ‘Shutdown’ icon on the desktop.

TIP:
If you are already in LXTerminal, type sudo shutdown –h now
to shut-down the Raspberry Pi immediately.

.

TIP:
Always make sure ALL activity on the Raspberry Pi’s green LED
(the LED on the right) has stopped before removing the power!