While running Chromium with
chromium-browser –display=:0 https://www.picockpit.com
will allow you to start Chromium from an SSH connection (and it will output to the main display in the X Server), this will fail when you try to run it with subprocess.Popen in Python:
„command“: [„chromium-browser“, „–display=:0“, “https://picockpit.com”]
(this is part of the JSON format I have specified for PiControl – the main idea is that this Array is passed in into subprocess.Popen).
The actual call to run the command is:
proc = subprocess.Popen(
preexec_fn=demote(user, uid, gid)
Chromium will exit immediately with an error status code of -5. (And yes, the user and group are set to pi, and the additional group memberships for the user are set).
I have not found documentation about Chromium exit codes, however I have come up with a fix for this particular problem (and also which should help you to debug other exit codes as well).
„command“: [„chromium-browser“, „–display=:0“, „–enable-logging=stderr“, „–kiosk“, https://picockpit.com]
(the –kiosk part is optional – it will start Chromium in kiosk mode, that is no URL bar, full screen, to avoid the user “escaping” your application on public facing interactive kiosks).
The full command definition for PiControl (for picockpit.com) looks like this:
It is contained in a JSON file on the particular pi. This way, you will be able to define many different commands (which will show up as buttons in the webinterface) for the Raspberry Pi by simply editing a JSON file.
We consult for the Raspberry Pi platform (hardware & software development, business concepts), and all things Raspberry Pi! Please get in touch with us today.