nerves-web-kiosk / webengine_kiosk

Qt WebEngine-based kiosk
Other
74 stars 14 forks source link

Could you help me show example about raspberry pi video permission ? #31

Open zhulinpinyu opened 3 years ago

zhulinpinyu commented 3 years ago

For example, on the Raspberry Pi, you'll need the kiosk user to be part of the video and input groups. You may also need to update the permissions and group ownership on /dev/vchiq if running on Nerves since it doesn't yet do that by default.

about this description, how can I set permissions for /dev/vchiq

pavels commented 3 years ago

That depends on how you actually start the kiosk app and if your elixir application runs as root (that is the case when running under Nerves) or not.

Basically you should create user and group for your kiosk process - let's assume these would be user kiosk and groupkiosk (user kiosk has group kiosk as it's primary group)

Than you need to do chgrp kiosk /dev/vchiq and chmod 770 /dev/vchiq

If your elixir app is running as root, you can do it in the start method of your Application using :os.cmd like:

def start(_type, _args) do
  :os.cmd('chgrp kiosk /dev/vchiq')
  :os.cmd('chmod 770 /dev/vchiq')
  ...
end

If your elixir app is not running as root, you need to execute chmod and chgrp commands as root before starting kiosk application.

Another option can be udev rule with the same effects, chgrp and chmod