
Running a 60fps web application using a RaspberryPi - kevinsimper
https://github.com/zehfernandes/rpi-webapplication
======
matthewmacleod
This is great advice. I have also done some work on building a good user
interface using the Pi, and was surprised by how difficult it was. There's no
good Android build available for the Pi, for example – would be ideal for many
of the kind of UIs you would want to implement.

In the end I have been using a Go web server with websockets to display a
single-page app in Firefox running under X. It's still not totally
satisfactory though – UI is slow due to the lack of HW acceleration, and there
is no nice solution for on-screen keyboards, so I'll probably have to
implement one in JS eventually. Touch screen support is sketchy at best.

Are there other similar platforms out there that might offer HW acceleration
or working Android implementations? I also had a crack at the Orange Pi which
claims to have functioning Android, but… let's say that's an overstatement.

~~~
pjc50
_lack of HW acceleration_

Genuine question: where does the obstacle lie here? The BCM2835 is a hardware
video accelerator with a small ARM on the side. GPU libraries are available.
Is it something missing from X or Firefox?

~~~
rasz_pl
Limitation is in "developers", that is WEB developers playing with embedded
systems. There is nothing stopping you from deploying dedicated OpenGL
application on RPi, but this is not the 2.0 way. Bros want nodejs and
responsive UIs in javascript .... you end up with this:
[https://youtu.be/tG70c3Zadek?t=10m49s](https://youtu.be/tG70c3Zadek?t=10m49s)

tldr: full minute to boot X and chromium just to implement simple 20 lines of
python application.

~~~
matthewmacleod
Don't be a dick about it.

Of course you can build an OpenGL ES application on the Pi – there are people
doing this. But that's a _absolute frigging world away_ from being able to
build a usable UI on it.

For example, I am building a device that interacts with a user. It basically
looks like a standard iOS or Android app, in that it has a few screens of
text, some form fields, select boxes, and other UI widgets. Building this sort
of application as a barebones OpenGL implementation would be stupid.

~~~
tjoff
Whatever floats your boat. If you can leverage existing code then this might
be an excellent option. But for the general use case building a simple and/or
decent user interface I would say that you probably would be way better of
just using QT.

------
gambiting
The problem I found with using RaspberryPi as a server for anything, is that
it kills SD cards within a few months. And I've tried with some super
expensive Ultra/Extreme cards as well, they all die in 3-4 months of running a
web server off it.

~~~
fookyong
as someone who might be using the Pi in a somewhat high-availability
environment pretty soon, this frightens me!

What do you think is the main variable here - SD card quality? amount of I/O?
or is it simply that the Pi is not meant for high availability?

If the answer leans to the latter, what other choices are there? My goals is
to find a small computer (very small) that has reliable uptime and can do
1080p video.

~~~
gambiting
Actual SSDs have multiple memory chips in them, and not only they spread
writes between them, they do actual wear leveling, so once certain cells
become unwritable they are marked as such and the controller starts using
cells from the reserved area(which can be few or even several gigabytes on
larger drives). SD cards on the other hand have only one chip, and although
they have a controller that monitors the wear level, they have an extremely
limited number of spare cells, so it's very easy to kill an SD card by
repeatedly writing to the same address.

As others have mentioned - you could solve this by serving the content from a
USB drive, but because Ethernet and USB share a bus, you will essentially
halve the speed of each, which is not ideal. If you have the money to spend, I
would recommend a different board, but with a dedicated SATA port, so you can
use an actual SSD or a regular hard drive for serving content. So....TK1?
[https://developer.nvidia.com/jetson-tk1](https://developer.nvidia.com/jetson-
tk1)

------
mnutt
This is great. I'm using Pi's for a similar purpose, a bunch of monitoring
dashboards all over our office that pull from webpages. I'm using a
combination of a central server to configure which web pages are shown, and a
chrome extension on each Pi to periodically ping the server.

It's really hard to find a decently new version of chrome for Arm. Raspbian
stable is on an ancient Chrome 22.0 and even testing is only up to 38.0. So
I'm excited to try out this method with Qt.

