Nerves_rpi4_webkiosk_playground

I am going to use a white room ubuntu container to repeat the steps I used to successfully build a firmware using @elcritch kiosk playground. So far after following a lot of dead ends I have a firmware that runs and displays an empty webkiosk page. The first step was to fork @elcritch 's repo on github. I forked it to my rogerjames99 account on github. The work will being going on in the roger branch. I will get round to make that the default branch soon.

3 Likes

Great that you made it!

unless you are displaying

<body style="background-color: white">

:wink:

New version of build document on github.
Just got to sort out the white screen. This is what @elcritch said

Your logs look alright as well (I never figured out how to set the background color on the new QML setup).

The white screen means it’s actually starting QT web engine, but it’s not loading a website. You’d need to add networking to your Nerves image and then call the “goto url” function in web_kiosk.

There is already some content set up in the priv directory. I should just be able to access that locally.
My elixir language knowledge is zero. Any hints on what to change?

try to set homepage to something else here: nerves_rpi4_webkiosk_playground/application.ex at e3f92a1cf5f14f995b3a03f469a0fc4d8f109427 · rogerjames99/nerves_rpi4_webkiosk_playground · GitHub

Or remove this line nerves_rpi4_webkiosk_playground/application.ex at e3f92a1cf5f14f995b3a03f469a0fc4d8f109427 · rogerjames99/nerves_rpi4_webkiosk_playground · GitHub and then:

iex> {:ok, kiosk} = WebengineKiosk.start_link(fullscreen: false)
iex> WebengineKiosk.go_to_url(kiosk, "https://elixir-lang.org/")

Finally got some content showing. But there must be an easier way to build the required homepage url with elixir.

  @kiosk_options [
      fullscreen: true,
      virtualkeyboard: true,
      context_menu: false,
      sounds: false,

      data_dir: "/root/browser/",
      homepage: "file:///srv/erlang/lib/webengine_kiosk-0.4.0/priv/www/index.html",

      run_as_root: true,
      platform_udev: true,
      platform_shared_memory: true,
      platform_cache_dir: true,
    ]

Any ideas?
New build is up on github.

so you can display a webpage now?

Not sure what you want to do.
homepage is just a link to the page you want to show.
How do you want that to be simpler than just setting it?
You could set it in config.exs …?

I wanted to point it at the default content provided in assets/www in the webengine_kiosk dependency. It took me ages to find out where it was being put! I was just wondering if it was possible for elixir to generate the some or all of the path to the index.html file dynamically.

Mouse is OK.
Cannot get response to keyboard. Although console does show the usb keyboard being plugged and unplugged.

maybe keyboard is disabled on purpose…?

I do not really understand what you want. Need to look into it. Maybe I find some time tomorrow.

Thanks Sebb,

The hardcoded absolute path works. But it is not be resilient to changes in the webengine_kiosk dependency. I was looking at making this fork an off the shelf example as far as possible.

I have only tried the key combinations suggested in the index.html. So it might well be that they just don’t work anyway as you suggested.