Show web page on Inky impression 7.3

Hi! I have huge problems using the Inky examples on my Raspberry PI Zero W because the Firefox-esr refuses to start (‘Illegal instruction’ ). This led me to try maybe 5 different solutions, none of which works. Often the problem is that the Zero:s armv6 architecture is not supported.
I have tried:
Chromium-browser (‘Failed to launch the browser process!’) with puppeteer in Node.js
wkhtmltoimage (doesn’t support armv6
Firefox-esr, Selenium and Geckodriver (not working on armv6)
Has anyone succeeded in solving this lately?
Please advice

The inky impression is not a system display, i.e. the usual programs cannot use it. There is a dedicated driver library, which mainly does the following: it creates a “canvas” image and then paints/writes on it and finally displays the result. This is totally different from a normal system display (framebuffer or X-based).

Also, these large inkys shouldn’t be updated often (every 15 minutes is often in this respect!).

This does not mean that you cannot display a (static) web-page. But you have to somehow fetch the content as an image and then display this image on the page.

1 Like

This was not helpful, I know all of this. The browser is going to be used in headless mode to capture a website (in this case a dashboard). That was why I was trying wkhtmltoimage.

Again, even if you know it already: browsers, like any GUI program, need a system display, even in headless mode. So you have to install a full X-environment with a suitable X-server. If you don’t have a physical display, you could try to use install and configure a virtual X-server. This will supply a server where the browser can talk to with its graphical commands. But you probably have all this covered already and know your browsers fail only because of the architecture incompatibility (but it would be interesting how you managed to install these incompatible versions, because Debian normally will prevent this anyhow).

So if it is really the architecture: you could try a legacy version of Raspbian. There were times where armv6 was supported after all.

A very quick look at wkhtmltoimage suggests that you could try building it from source; again, reading their own documentation it mentions how to configure to build for ARM, so that seems like the most likely-to-succeed approach.

I’m very surprised that firefox-esr is exploding with an illegal instruction if you just installed it through the standard repos; have you tried with a clean install, it has me wondering if something is off with your Raspbian install?

Actually, I half-take that back (although I remain very surprised!) - from this thread on the official forum it sounds like firefox-esr doesn’t play nicely with Zeros (or at least, didn’t 2 years ago).

As with others on that thread, I’d consider that a bug in Raspbian package management, but I guess they don’t. Building wkhtmltoimage from source is probably the lowest friction solution.

Thanks for replying! I am using Raspberry-Pi OS, is that not ideal? Should I try Raspbian instead?
wkhtmltoimage works somewhat but doesn’t work when the wepage contain chart.js code (probably something with the ES version supported)

Thanks for this, I did not know you need X11 for Firefox-esr to work. I just find it really strange that Pimoroni sells this Inky hardware and states that it works on all Pi:s, and supply examples that doesn’t really work with arm6.

Yes, they should be more specific. The inky-impressions do work well with the pi-zeros, but the html-example with firefox certainly not (even on a zero2 you won’t be happy with that since the memory is still on the low-side).

One thing you might want to explore: most modern web-pages invest a lot of resources because of layout and interaction. For the inky, this does not play a role. So the question is, if you can somehow download the real content (e.g. using wget or curl) and do the rendering for the inky yourself. This of course does not show the web-page as is (and is additional work), but it could be a solution to what you want to achieve.

Yes,Im building a dashboard with the help of chart.js and graphql, Alhtough my ambition is to not having to include another server, i’m looking into rendering the JS server side and simply serving an image instead. Then I could just curl it and load the image into the Inky. But not sure if running a node.js server would choke the pie completely.

To be honest, the simpler approach would be to provide your dashboard data though an API, and let the Pi read that data and build an appropriate representation of that data straight to the Inky.

Allows you to tailor your display to the Inky, and saves the enormous effort of building a web page, then rendering it down to an image on a limited platform.

(apologies for the Raspbian / Raspberry Pi OS confusion; the latest stuff is, of course, called Raspberry Pi OS, but my aged brain hasn’t caught up yet!)

How does one do that? What tools can I use to build a dashboard without using html/css? I’m all open to that.

From a quick look at the instructions, it looks like the Inky leans in PIL for it’s drawing; you’d have to construct your page from primitives rather than letting html do all the heavy lifting.

Whether you find that easier or harder depends on how much you enjoy html ;-)

Yep, I think this is the way. I think I would expect headless Firefox to work on a full-size Pi, but I’d be less certain on a Pi Zero - 512Kb of memory probably isn’t enough for this to work, even with optimisations. Drawing lines, blocks, and rendering font elements is much more within the device’s capabilities.

The alternative is that the Zero is just a receiver for an image from a more capable machine - the image is generated using wkhtmltoimage on a PC, and then pushed via curl to a web server on the Zero. The Inky can draw an image from a raw image stream, though graphics primitives are probably going to be faster.

I haven’t really thought about anything else than html since I worked as a developer for 15 years :-). Using something like chart.js to print a line chart saves a lot of work compared to drawing it on your own using 2d primitives, but if there’s some kind of library that could do that for me…🤔

Sound like the easiest way would be to buy a better but clunkier PI.

Clearly you haven’t tried to source a Pi lately ;)

I’ve not tried the service myself, but on the face of it, something like might fit the bill, although somewhat dependent on how frequently you’re looking to refresh.

If you need some sample code: GitHub - bablokb/pi-e-ink-daily: Display Daily Agenda on an E-Ink Display

Now of course, that is not chart-data but shows how you can call an api from the pi and then do the layout with PIL. The project has two types of content-providers, one for a calendar, one for a weather-api. So you could actually implement a plugin (charts-content-provider) and keep the frame.

There are some chart libraries for python around, the “big one” is mathplotlib and it is happy to create images of your charts. It should also run on a zero. There are so many examples around so it should be easy to get started.

I am running both solutions with a pi-zero without problems. One is based on a 4" wHat, one is based on a 5.7" Inky-Impression. So you would also have to tweak some ui-constants, but it is meant to be portable and easy to adapt.

As I side note: the pi-zero is in fact oversized for my applications and I am currently porting these to the pico.

1 Like