RaspberryPi - Execute samsungctl within php

87 Views Asked by At

I'm trying to run the command: <"samsungctl --host 192.168.1.157 --method websocket KEY_MUTE"> in order to control my samsung smart TV, using shell_exec(<"command">); samsungctl is a python program that controls Samsung TV's

From terminal the command executes just fine and the TV indeed Mutes. As I understand the problem is that, from php the command is executed with user www-data and the problem is the permissions of the user www-data.

I've tried various solutions as i found them here: https://nocurve.com/2018/04/23/running-python-script-from-php-as-www-data/ https://forums.raspberrypi.com/viewtopic.php?t=50225 Also I've tried to control samsung TV directly from php using this: https://gist.github.com/hkalina/b70dff4369ff2f0a2afe And many more similar solutions, but all of them unfortunately failed.

Can anyone help me ? Thank you

0

There are 0 best solutions below