balena-io-experimental / browser Goto Github PK
View Code? Open in Web Editor NEWA drop-in web browser block
A drop-in web browser block
Is this project supposed to have HDMI output audio?
Running on a raspberry pi4, with a microHDMI -> HDMI cable running to a display with internal speakers, I cannot get audio to function.
I see we usermod chromium into the audio group, would there be more to do to support HDMI audio out?
It'd be nice if there were a config option to set an idle timer so the screen powers down if there's no user interaction for a certain amount of time.
[phil-d-wilson] Create VERSION file and copy into block. The block should cat
the file to console on start-up
I try to use this balenablock as described in readme.md
(docker-compose file), but on the Balena device (Raspberry Pi 4), the image I get from Docker registry (balenablocks/browser:latest, same as balenablocks/browser:raspberrypi4-64) does not contain current v2.0.1 code (https://github.com/balenablocks/browser/tree/v2.0.1), but v1.0.1 code (https://github.com/balenablocks/browser/tree/v1.0.1).
To finish with an idea, perhaps automated pushing of docker images from continuous delivery would allow easier review from the community and prevent such errors. I don't know if it is possible in Balena ecosystem.
https://github.com/balenablocks/browser/blob/2739c0f00933116d5e4eff4ee453dbd067702d1f/start.sh#L124
Allow changing the last command that runs in the script. E.g in balenaDash, we would rather start with tohora
This along with #17 would make it easier catering for different use cases of the browser block
The issue can be found on this thread from the balena forumslink .
Does anyone have a fix?
Hi everyone,
Does anyone know if it is possible to launch multiple instances of the browser block? I mean, my ultimate goal is to use a single device with two screens attached to launch two different URLs (each screen displays a different URL).
Many Thanks
Provide a way to set a scaling factor for high density displays.
Hi!
I'm trying to play a youtube video. It looks like it is starting the video, then gives a black screen with "Audio renderer error. Please restart your computer."
I'm using the release 2.0.4 and a raspberry 4.
Do you know what could be wrong?
Users currently have to use the ROTATE_DISPLAY and WINDOW_SIZE enVars to get a screen rotated and viewed correctly. Look into whether we can swap the values of the detected resolution, to do this for the user when they set the ROTATE variable:
Example:
There are cases where being able to add extensions would be helpful. eg
Currently the su
command uses the whitelist option to pass in chromium configuration environment variables. However, this doesn't pass in other variables, for instance tz
where a user is overriding the timezone. Instead of keep adding to the whitelist manually, we should pass in all the enVars from the main process into the su
command, to catch them all.
A user sees a download chrome pop up after a few hours. I see this is a known "bug"
I am trying to reproduce this locally, but not sure how many hours it's going to take to get there. Also, I am wondering if this is a pop-up in the traditional sense of it, or is it some native google chrome thing. Because typically we can disable popups in the settings
Just a basic push and it does not come up
[Logs] [9/4/2021, 8:38:29 AM] Service exited 'browser sha256:fa7ca3bc2ac4314d5f68595bb8cb219c1b9259cffa39ae6f4617f1024543104c'
[Logs] [9/4/2021, 8:39:21 AM] Restarting service 'browser sha256:fa7ca3bc2ac4314d5f68595bb8cb219c1b9259cffa39ae6f4617f1024543104c'
[Logs] [9/4/2021, 8:39:22 AM] [browser] Running balena base image entrypoint...
[Logs] [9/4/2021, 8:39:22 AM] [browser] setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file
[Logs] [9/4/2021, 8:39:27 AM] [browser] Using default chromium flags
[Logs] [9/4/2021, 8:39:27 AM] [browser] Enabling GPU acceleration
[Logs] [9/4/2021, 8:39:27 AM] [browser] Custom window size set to 800,600
[Logs] [9/4/2021, 8:39:27 AM] [browser] Using default window position
[Logs] [9/4/2021, 8:39:27 AM] [browser] Enabling kiosk mode
[Logs] [9/4/2021, 8:39:27 AM] [browser] Enabling cursor
[Logs] [9/4/2021, 8:39:31 AM] Service exited 'browser sha256:fa7ca3bc2ac4314d5f68595bb8cb219c1b9259cffa39ae6f4617f1024543104c'
[Logs] [9/4/2021, 8:40:32 AM] Restarting service 'browser sha256:fa7ca3bc2ac4314d5f68595bb8cb219c1b9259cffa39ae6f4617f1024543104c'
[Logs] [9/4/2021, 8:40:32 AM] [browser] Running balena base image entrypoint...
[Logs] [9/4/2021, 8:40:33 AM] [browser] setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file
[Logs] [9/4/2021, 8:40:34 AM] [browser] Using default chromium flags
[Logs] [9/4/2021, 8:40:34 AM] [browser] Enabling GPU acceleration
[Logs] [9/4/2021, 8:40:34 AM] [browser] Custom window size set to 800,600
[Logs] [9/4/2021, 8:40:34 AM] [browser] Using default window position
[Logs] [9/4/2021, 8:40:34 AM] [browser] Enabling kiosk mode
[Logs] [9/4/2021, 8:40:34 AM] [browser] Enabling cursor
[Logs] [9/4/2021, 8:40:38 AM] Service exited 'browser sha256:fa7ca3bc2ac4314d5f68595bb8cb219c1b9259cffa39ae6f4617f1024543104c'
I suggest adding a new environment variable AUTO_REFRESH_ON_CRASH. When enabled and chrome crashes the page should try to reload.
Example code:
https://github.com/guysoft/FullPageOS/blob/devel/src/modules/fullpageos/filesystem/home/pi/scripts/start_chromium_browser
https://github.com/balenablocks/browser/blob/2739c0f00933116d5e4eff4ee453dbd067702d1f/start.sh#L86
If we overwrite the KIOSK flag, it is not as easy to detect if KIOSK mode is enabled when we use the browser block in other projects.
Also, It doesn't seem we are using the exported KIOSK values in the flags when launching chromium.
https://github.com/balenablocks/browser/blob/2739c0f00933116d5e4eff4ee453dbd067702d1f/start.sh#L115
Is https://github.com/balenablocks/browser/blob/2739c0f00933116d5e4eff4ee453dbd067702d1f/start.sh#L88
only necessary?
When running the browser in different modes such as kiosk or normal windowed view, the end user may want to toggle the cursor visibility. Currently, this is configurable only in kiosk
mode.
When connecting to tvs/monitors the image doesn't fit the actual full-screen size.
--> See black borders even with window position 0,0
use: BALENA_HOST_CONFIG_disable_overscan=1
Hey guys!
I have a really simple setup:
Fin CM3 4GB
Official RPi 7" display
docker-compose.yml
version: '2'
services:
browser:
image: balenablocks/browser:raspberrypi4-64
privileged: true
network_mode: host
volumes:
- 'settings:/data'
restart: unless-stopped
environment:
- KIOSK=1
- PERSISTENT=1
- ROTATE_DISPLAY=inverted
- LAUNCH_URL=http://google.com
volumes:
settings:
However, the display is always in the normal mode.
I've tried playing around with different settings from balenaDash and balenaBrowser but no luck so far.
If I have to switch to the cloud to configure it, that's fine, but I'm in local mode right now.
Thanks for any help.
Paul
I created a very simple server that serves a static mp4 file, and whenever the browser tries to read it it crashes with:
[Logs] [9/4/2020, 2:51:07 PM] [browser] hostname: No address associated with hostname
[Logs] [9/4/2020, 2:51:07 PM] [browser] xauth: file /home/chromium/.Xauthority does not exist
[Logs] [9/4/2020, 2:51:07 PM] [browser] xauth: (stdin):1: bad display name "aff8c20:0" in "add" command
[Logs] [9/4/2020, 2:51:07 PM] [browser]
[Logs] [9/4/2020, 2:51:07 PM] [browser]
[Logs] [9/4/2020, 2:51:07 PM] [browser] X.Org X Server 1.20.4
[Logs] [9/4/2020, 2:51:07 PM] [browser] X Protocol Version 11, Revision 0
[Logs] [9/4/2020, 2:51:07 PM] [browser] Build Operating System: Linux 4.15.0-99-generic armv8l Raspbian
[Logs] [9/4/2020, 2:51:07 PM] [browser] Current Operating System: Linux aff8c20 4.19.75 #1 SMP Thu Jun 4 14:39:26 UTC 2020 armv7l
[Logs] [9/4/2020, 2:51:07 PM] [browser] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=1184 bcm2708_fb.fbheight=624 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:AB:E2:34 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 rootfstype=ext4 rootwait root=UUID=ba1eadef-cae9-446c-a81f-1a39b4c52dab rootwait
[Logs] [9/4/2020, 2:51:07 PM] [browser] Build Date: 07 July 2020 09:38:51PM
[Logs] [9/4/2020, 2:51:07 PM] [browser] xorg-server 2:1.20.4-1+rpt2 (https://www.debian.org/support)
[Logs] [9/4/2020, 2:51:07 PM] [browser] Current version of pixman: 0.36.0
[Logs] [9/4/2020, 2:51:07 PM] [browser] Before reporting problems, check http://wiki.x.org
[Logs] [9/4/2020, 2:51:07 PM] [browser] to make sure that you have the latest version.
[Logs] [9/4/2020, 2:51:07 PM] [browser] Markers: (--) probed, (**) from config file, (==) default setting,
[Logs] [9/4/2020, 2:51:07 PM] [browser] (++) from command line, (!!) notice, (II) informational,
[Logs] [9/4/2020, 2:51:07 PM] [browser] (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[Logs] [9/4/2020, 2:51:07 PM] [browser] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Sep 4 12:51:07 2020
[Logs] [9/4/2020, 2:51:07 PM] [browser] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[Logs] [9/4/2020, 2:51:08 PM] [browser] --disable-quic --enable-tcp-fast-open --ppapi-flash-path=/usr/lib/chromium-browser/libpepflashplayer.so --ppapi-flash-args=enable_stagevideo_auto=0 --ppapi-flash-version=
[Logs] [9/4/2020, 2:51:10 PM] [browser] [114:154:0904/125110.806190:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[Logs] [9/4/2020, 2:51:11 PM] [browser] libEGL warning: DRI2: failed to authenticate
[Logs] [9/4/2020, 2:51:11 PM] [browser] [114:345:0904/125111.585364:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[Logs] [9/4/2020, 2:51:11 PM] [browser] [114:345:0904/125111.673111:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[Logs] [9/4/2020, 2:51:11 PM] [browser] [114:345:0904/125111.673679:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[Logs] [9/4/2020, 2:51:12 PM] [browser] [114:368:0904/125112.036430:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[Logs] [9/4/2020, 2:51:12 PM] [browser] [114:368:0904/125112.037712:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[Logs] [9/4/2020, 2:51:12 PM] [browser] [114:368:0904/125112.038577:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[Logs] [9/4/2020, 2:51:12 PM] [browser] [114:368:0904/125112.040527:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[Logs] [9/4/2020, 2:51:12 PM] [browser] [114:368:0904/125112.041620:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[Logs] [9/4/2020, 2:51:12 PM] [browser] [163:163:0904/125112.345495:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[Logs] [9/4/2020, 2:51:12 PM] [browser]
[Logs] [9/4/2020, 2:51:12 PM] [browser] (chromium-browser-v7:114): Gtk-WARNING **: 12:51:12.793: Could not load a pixbuf from icon theme.
[Logs] [9/4/2020, 2:51:12 PM] [browser] This may indicate that pixbuf loaders or the mime database could not be found.
[Logs] [9/4/2020, 2:51:12 PM] [browser]
[Logs] [9/4/2020, 2:51:12 PM] [browser] (chromium-browser-v7:114): GdkPixbuf-CRITICAL **: 12:51:12.794: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
[Logs] [9/4/2020, 2:51:12 PM] [browser]
[Logs] [9/4/2020, 2:51:12 PM] [browser] (chromium-browser-v7:114): GdkPixbuf-CRITICAL **: 12:51:12.795: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
[Logs] [9/4/2020, 2:51:12 PM] [browser]
[Logs] [9/4/2020, 2:51:12 PM] [browser] (chromium-browser-v7:114): GdkPixbuf-CRITICAL **: 12:51:12.800: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
[Logs] [9/4/2020, 2:51:12 PM] [browser] (chromium-browser-v7:114): GdkPixbuf-CRITICAL **: 12:51:12.800: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
[Logs] [9/4/2020, 2:51:12 PM] [browser]
[Logs] [9/4/2020, 2:51:12 PM] [browser] (chromium-browser-v7:114): GdkPixbuf-CRITICAL **: 12:51:12.804: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
[Logs] [9/4/2020, 2:51:12 PM] [browser]
[Logs] [9/4/2020, 2:51:12 PM] [browser] (chromium-browser-v7:114): GdkPixbuf-CRITICAL **: 12:51:12.804: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
[Logs] [9/4/2020, 2:51:13 PM] [browser] usrvcsm: [vcsm_malloc_cache]: [163] [ChromeBuf]: ioctl mem-alloc FAILED [-1] (hdl: 0)
See this repo: https://github.com/balena-io-playground/steve-play-with-blocks
I was doing localpush to an rpi3 device.
https://github.com/balenablocks/browser/blob/a53ab4ce87d08a0ba14eb51a1d7f6640a8618d3e/start.sh#L71
Someone trying to keep persistence working but only modifying some other flags might have to remember to add the above option to the flags?
maybe we export PERSISTENT_FLAG="--user-data-dir=/data"
if we detect the variable then do
echo "chromium-browser $CHROME_LAUNCH_URL $FLAGS $PERSISTENT_FLAG --window-size=$WINDOW_SIZE --window-position=$WINDOW_POSITION $OUTPUT" >> /home/chromium/xstart.sh
here
https://github.com/balenablocks/browser/blob/a53ab4ce87d08a0ba14eb51a1d7f6640a8618d3e/start.sh#L150
This will allow using the logic when using browser block in other projects.
E.g In balenaDash we need to check the Env Vars everytime link is changed via Tohora
manifest for balenablocks/browser:raspberry-pi2 not found: manifest unknown: manifest unknown
The current version of the browser block does not rotate the display on the RPi 4 with the current settings / vc4-fkms-v3d.
If you decide to rotate, it will just resize the window - starting on 0,0 and then not e.g. landscape it like normal, but resize it in portrait if you ROTATE_DISPLAY=right - but not rotate the display/screen.
The only reliable way i found was to leave the ROTATE_DISPLAY and WINDOW_SIZE settings all alone and rotate the screen itself on boot by using BALENA_HOST_CONFIG_display_hdmi_rotate=3 (for 270 degree clockwise rotation). Then it will work flawlessly.
Similar to what's mentioned in the readme https://github.com/balenablocks/browser/tree/4676a0230886b68afd613992a2039ee141423dc6#partial-display-output I'm experiencing chrome not using the whole screen. I noticed the following in the log:
30.03.21 19:00:26 (+0800) kiosk Running balena base image entrypoint...
30.03.21 19:00:27 (+0800) kiosk setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file
30.03.21 19:00:27 (+0800) kiosk Using default chromium flags
30.03.21 19:00:27 (+0800) kiosk Enabling GPU acceleration
30.03.21 19:00:27 (+0800) kiosk Adding user settings directory
30.03.21 19:00:27 (+0800) kiosk Custom window size set to
30.03.21 19:00:27 (+0800) kiosk Enabling kiosk mode
30.03.21 19:00:27 (+0800) kiosk Enabling cursor
Note the "Custom window size set to". This indicates that in the following code
the if
doesn't take the right branch, even though I haven't configured a device service variable WINDOW_SIZE.
I'm hesitant to conclude that the particular if
syntax doesn't do what it's supposed to do, given that it's used in that form in so many other places in https://github.com/balenablocks/browser/blob/4676a0230886b68afd613992a2039ee141423dc6/start.sh .
I observed that there's a device variable by the name WINDOW_SIZE
in the balena dashboard. Maybe that interferes?
User wanted to be able to specify an inactive timeout after which their touchscreen should turn off, and wake on the next user input.
Thank you for this seed project. I have two mild bugs and/or suggestions:
In many kiosk instructions, there will be the following mild hack
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences
so that when you deploy again you won't get an offer to "restore tabs". I'd also suggest
--noerrdialogs \
--disable-infobars \
to gain even more real estate in "kiosk" mode.
Consider checking not only port 80 but also 443
https://github.com/balenablocks/browser/blob/2062d3769cff4098a1f405a55afe7983dc222f0e/start.sh#L36
Readme suggests
Rotates the display (Pi4 only)|
11.05.21 10:00:36 (+0000) browser Fatal server error:
11.05.21 10:00:36 (+0000) browser (EE) no screens found(EE)
11.05.21 10:00:36 (+0000) browser (EE)
11.05.21 10:00:36 (+0000) browser Please consult the The X.Org Foundation support
11.05.21 10:00:36 (+0000) browser at http://wiki.x.org
11.05.21 10:00:36 (+0000) browser for help.
11.05.21 10:00:36 (+0000) browser (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
11.05.21 10:00:36 (+0000) browser (EE)
11.05.21 10:00:36 (+0000) browser (EE) Server terminated with error (1). Closing log file.
When ROTATE_DISPLAY
is set the output is rotated but input events from a touchscreen are not.
The touchscreen I'm using is the 11.6inch Waveshare FHD screen with touch attached via USB.
The chromium browser shows a black border in the top and left sides of the screen by default. In order to utilize the full real estate of the screen, one has to add an environment variable FLAGS
with a value of --window-position=0,0
.
This should be the default value for this flag.
I found it pretty handy that the browser tries to look for a local service running on port 80, but the functionality is pretty limited. This can still be an opt-in functionality, but what is more practical is if the server itself announces to the browser what endpoint to hit and when, which should give the control for retries, failure handling, etc. to the other services.
I was developing a couple of services locally and using livepush the server would restart, and the browser wouldn't show an empty page and it wouldn't try to reconnect to the server. I can imagine the same thing happening in production and the only way to recover will be to restart the browser service.
The Web Browsing is slow on RPI4 with 4GB ram. I compared it with raspian native installed. Are there any settings in balena?
Same situation when GPU enabled, doesnt matter if enabled or disabled.
thx for your help
Now two Chromium extensions are preinstalled using the policy.json file:
I'm having problem with the second one.
At this moment it's indirectly blocking any communication with sentry.io API - which I use for error reporting.
Using error reporting tool is very important for me as some of the issues are unique for Chromium running on low CPU devices.
While for my use case it would be enough to omit the Adblock Plus extension, I imagine that other developers could benefit from option to add other extensions to the list.
We should display a webpage if LAUNCH_URL=''
Hey All,
I am using this block as a service on my Raspberry Pi 4 to get display from a custom url. However, I always get top left corner part of the website. Even when I try to change WINDOW_SIZE at start.sh bash file, that only makes the display bigger but, still get only a part of the site.
Is there any other configuration that I miss?
Is anyone else getting RESULT_CODE_MISSING_DATA errors?
I'm seeing the error occur sporadically on my fleet of rpi3b+ devices running 32 bit Balena OS. Restarting the service resolves the issue, until the next random occurrence. An individual device can go weeks between errors, but even with a smallish fleet it quickly becomes a support headache.
Hey All,
So I noticed that this block does not have the capability for the user to set the time zone. And for a browser, I feel like this is a key need, so I figured I would bring it up.
I will try my hardest to start looking into ways to get this implemented, but I am fairly new to this arena so I figured I would reach out and see if anyone with a bit more experience would be able to get a PR together sooner, and then I could learn that way also.
Anyways, suggestions would be appreciated too. Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.