Browser in Nerves (kiosk-mode)

In reference to errno, the errno variable is set in the C library. For syscalls, the value that gets set comes from the kernel. Some C library functions set errno without calling into the kernel. For the read example, check out the read function where it makes a syscall to the kernel. The syscall_cp macro is here. The return value from the Linux kernel is put into errno via the syscall_ret function. Note that the references are to Musl C. The GNU C library is used in the kiosk system, but it should be similar and I find Musl C source code easier to read.

As for what’s really wrong with the kiosk systems, I don’t know. The ones on the nerves-web-kiosk were abandoned long ago. You’ll see commits from me when they were maintained, but I haven’t used them for years. I have been heard of people getting them working again in forks, but I’ve yet to convince some one to maintain them.

I have not used this, but I believe @elcritch has the most promising public fork. See:

Hope this helps.

2 Likes

Hi,
You are 100% correct that the version of errno that you see in a C programme is set in the C library. I was just trying to simplify it.

I was just about coming to the conclusion that these kiosk systems were dead in the water.

In your opinion is nerves viable as a basis for embedded browser based user interfaces?

I was thinking of using it for a kiosk based on the Raspberry PI 400 compute module,

I have tried the @elcritch version but hit the same problems building firmware from as I have hit with the nerves-web-kiosk ones. mix deps.get fails when using nerves-web-kiosk/kiosk_system_rpi4

I have emailed @elcritch about the problem that appears to be a missing virtualkeyboard package in target qmake build.

Roger

I’ll try to fix one of the kiosk systems but that will take some time and I’m not sure if I can do it.
Right now I’m trying to understand how nerves works under the hood and I’m writing a detailed guide along the way. Maybe you or someone else of the nerves core team can spare some time to proofread it. When I’m finished I hope I can also help people better in the forum.

I think until someone comes around and fixes it, the kiosk repos should be archived or at least a note should be added to the readme.

I went ahead and archived all of the kiosk repos. I’d certainly be thrilled to unarchive them should someone want to update and maintain them.

2 Likes

I finally got nerves_rpi4_webkiosk_playground to build and I can log into it using ssh. That’s the good news.
The less good news is that it when boots I get a white screen on the hdmi and the following on serial console.

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2021.12.10 11:54:43 =~=~=~=~=~=~=~=~=~=~=~=
[    0.250929] spi-bcm2835 fe204000.spi: could not get clk: -517
[    0.654821] F2FS-fs (mmcblk0p3): Can't find valid F2FS filesystem in 1th superblock
[    0.663121] F2FS-fs (mmcblk0p3): Can't find valid F2FS filesystem in 2th superblock
erlinit: The shell will be launched on tty 'tty1'.
erlinit: If you would like the shell to be on this tty,
erlinit: configure erlinit with '-c ttyS0'.
erlinit: The hostname is 'nerves-a53e'.
[    2.471692] F2FS-fs (mmcblk0p3): Can't find valid F2FS filesystem in 1th superblock
[    2.480049] F2FS-fs (mmcblk0p3): Can't find valid F2FS filesystem in 2th superblock

I will post a set of build instructions later. But first of all are the white screen and the error messages normal. Any ideas anyone?

1 Like

All of those messages are ok:

  • The spi-bcm2835 one occurs in other Pi 4 systems. I’ve never tracked it down, but it doesn’t seem to affect anything.
  • The F2FS warnings are from this being a first time boot off your MicroSD card. They’re a side effect of Nerves identifying that the data partition hasn’t been initialized yet and then initializing it. You shouldn’t see it on reboots or when you update over ssh. If you burn a new MicroSD card, the default is to reset the data partition and you’ll see it again. See Frequently-Asked Questions — nerves v1.7.12.
  • The erlinit warnings are due to erlinit being configured to send the console terminal to the HDMI output (tty) and you’re looking at ttyS0. You can make it go away by adding config :nerves, :erlinit, ctty: "ttyS0" to your config.exs.

Not sure on the white screen part.

1 Like

I’ve tried Kiosk once and it just worked, hard to say whats going on. If you post the build instructions I can have a look some time next week.

SPI is not needed anyway I think.

Just rebooted the system. No error messages. I can see that the webengine_kiosk process is running.

  382 root     1844m S    /srv/erlang/lib/webengine_kiosk-0.4.0/priv/kiosk --background_color black --fullscreen true --virtualkeyb

The white screen is a suspicious see a there is --background)color black parameter in the command line.

I have forked the kiosk_playground to my rogerajmes99 account on github. I will push any changes up there shortly.

The main changes are to the instructions. You need to be version 24 of elixir and erlang (the latest) and your MIX_TARGET must be set to rpi4_kiosk. The only change I make to mix.exs is to pull the webengine_kiosk from github rather than a local file. To get past the virtualkeyboard you need to have qtvirtualkeyboard-plugin install on your host system along with all the other qt5 stuff. It took me a while to work out what was going on. The firmware build is running qmake on your host system and using qmake’s own cross compilation facilties to build for the target. I suspect you can get away with just the libqt5virtualkeyboard5-dev package, as it is building arm7 binaries. Here is the change to mix.exs.

      # {:webengine_kiosk, "~> 0.4.0", path: "../webengine_kiosk", app: false},
      {:webengine_kiosk, "~> 0.4.0", github: "elcritch/webengine_kiosk"},

Roger

1 Like

I found this in RingLogger

00:00:06.464 [warn]  webengine_kiosk(stderr): SET VIEW:  QQuickWebEngineView_QML_37(0x26d5d1e0, name="web", parent=0x26d5cf50, geometry=0,0 1680x1050)  with:  QQuickWebEngineView_QML_37(0x26d5d1e0, name="web", parent=0x26d5cf50, geometry=0,0 1680x1050) 

00:00:06.465 [warn]  webengine_kiosk(stderr): 

00:00:06.465 [warn]  webengine_kiosk(stderr): QMetaObject::invokeMethod: No such method QQuickWebEngineView_QML_37::backgroundColor(QColor)

00:00:06.465 [warn]  webengine_kiosk(stderr): QObject::connect: Parentheses expected, signal QQuickWebEngineView_QML_37::loadingChanged

00:00:06.465 [warn]  webengine_kiosk(stderr): QObject::connect:  (sender name:   'web')

00:00:06.465 [warn]  webengine_kiosk(stderr): SET FROM web:  QQuickWebEngineView_QML_37(0x26d5d1e0, name="web", parent=0x26d5cf50, geometry=0,0 1680x1050) 

00:00:06.465 [warn]  webengine_kiosk(stderr): 

I don’t know if it is significant, or I just get a white screen because I have not found out how to set up content yet:-)

Build notes and patched mix.exs now up in my github repo.

git clone -b roger GitHub - rogerjames99/nerves_rpi4_webkiosk_playground: Kiosk Test

Best of luck.

1 Like

thanks. I’ll look into it.