gopro / OpenGoPro

An open source interface specification to communicate with a GoPro camera with accompanying demos and tutorials.
https://gopro.github.io/OpenGoPro/
MIT License
711 stars 153 forks source link

No root or sudo needed #188

Closed peetCreative closed 2 years ago

peetCreative commented 2 years ago

Is your feature request related to a problem or use case? Please describe. I want to write a linux service running in background using the OpenGoPro API using Python. But my programm is asking me for sudo rights on the command line. Disabling Wifi with GoPro(enable_wifi=False) won't work, because WifiModule is instantiated in GoPro anyways.

Describe the solution you'd like

  1. I configure my linux using /etc/network/interfaces or similar to automatically connect the right way to the GoPro AP if available.
  2. When disabling Wifi, don't initialize WifiController. Then I'm not asked for any password anymore.

Describe alternatives you've considered Passing the password into the file starting the service.. That means in some file in /etc/... I have to state the plaintext password.

tcamise-gpsw commented 2 years ago

This seems very reasonable as there is no reason to request sudo if you do not want to use WiFi.

I'll look into adding this, it should hopefully be pretty trivial.

tcamise-gpsw commented 2 years ago

Hi I just merged a change that will:

So you have lots of options now. If you don't need wifi, you can set enable_wifi to false and you will never be prompted for the password. Or you can send the password via stdin, for example: cat mypasswordfile.txt | gopro-photo --password