PSP Ahoy
We create a micro web server on an Arduino and a Raspberry Pi, and then use a PSP web browser to control an airboat.
Maxim Popov, 123RF
We create a micro web server on an Arduino and a Raspberry Pi, and then use a PSP web browser to control an airboat.
We thought it would be fun to try and use an old PlayStation Portable (PSP) [1] on some Arduino and Pi Projects. We like using PSP's because they have a very long standby time (weeks), and if you drop a PSP it isn't as heart breaking as dropping your new smart phone. If you don't have a PSP you can usually find a used one for a reasonable price on eBay.
Some smart people were able to modify or "mod" the PSP firmware so that it is possible to run open source applications. We tried using Python, Lua, sdlBasic, and SSH on the PSP to talk to our Pi, but unfortunately none of these methods were 100% straightforward or reliable. In the end we found that using the built-in PSP Web browser worked best and didn't require a 'modding' or any special programming.
We were using an older PSP-1000 model so if you have a newer PSP Go or a PSP Vita you may not experience the same limitations we did. However, we think if you stick to our 'worst case' setup you should be safe.
From our testing we would recommend:
For the PSP-1000 the web pages had to be very simple, no CSS (Cascading Style Sheets) and no advanced HTML tagging. We had hoped to show Pi Node-RED web pages on the PSP but this was not possible.
We also found that it was important to turn off the PSP browser cache, otherwise a command would only work once. To do this, go into the PSP browser and select Tools, then Settings, (Figure 1) and in the Settings menu select Cache Settings.
Our older PSP-1000 had some problems with the newer WPA2 wireless encryption, so to simplify things we created a small standalone open network. For Arduino projects this isn't an issue because the Arduino can be made into a standalone open Access Point. However on Pi projects where you are using an existing wireless network you might need to do some tweaking to add a limited access guest account.
To add a new connection on the PSP go the Network Settings and select Infrastructure Mode. Next select New Connection and Scan. The scan will only show networks that the PSP is able to connect to. WPA2 networks with AES encryption will appear in blurry text (Figure 2).
As the PSP doesn't have a keyboard or touch screen, entering a web address can be quite time consuming. Bookmarks can be used to save your Arduino and Pi web addresses (Figure 3).
We created a custom HTML page with buttons to perform different actions. We used the HTML <form>
tag to pass parameters between a web client and a web server. As part of the <form>
tag an action and a method is also defined. For projects where you are driving vehicles for instance, actions could be: GO, STOP, LEFT, and RIGHT, for example. There are two types of methods, GET and POST. The POST method is more secure but we would recommend the GET method because it is simpler to implement on both the Arduino and Pi web Servers.
Listing 1 and Figure 4 show a simple GET form that could be used on both the Arduino and Pi projects.
Listing 1
simpleget.htm
§§nonumber 01 <html> 02 <body> 03 <h1>Click a button to control the car</h1> 04 05 <form action='GO' method='GET' > 06 <INPUT TYPE='submit' VALUE="GO" > 07 </form> 08 09 <form action='STOP' method='GET' > 10 <INPUT TYPE="submit" VALUE="STOP" > 11 </form> 12 13 <form action='LEFT' method='GET' > 14 <INPUT TYPE='submit' VALUE="LEFT" > 15 </form> 16 17 <form action='RIGHT' method='GET' > 18 <INPUT TYPE="submit" VALUE="RIGHT" > 19 </form> 20 </body> 21 </html>
Pages: 6
Price $15.99
(incl. VAT)