magdesign / PocketVJ-CP-v3

PocketVJ 3.x Control Panel
https://www.pocketvj.com
Other
156 stars 33 forks source link

help with customscript #65

Closed Prepete closed 5 years ago

Prepete commented 5 years ago

Hi there, I need help executing my customized script. It's impossible to start an instance of OMXPlayer and synchronizing its current playback position to the internal time. The video is 24h long and should be played on the requested, current time.

Here is my script:

kill all running tasks

/var/www/sync/stopall &

start omxplayer with current time

/usr/bin/omxplayer --loop --no-osd -o both /media/internal/video/01_st24.mov -l $(date +"%H:%M:%S") > /dev/null 2>&1 & echo $! &

Thanks for your support!

magdesign commented 5 years ago

Nice script :-)

Did you try to manually execute it in terminal without > /dev/null 2>&1 & echo $! & so you get a console output?

Prepete commented 5 years ago

everything works out fine when I trigger that script directly from the terminal. When put into an executable script nothing happens.

magdesign commented 5 years ago

did you make the script executable ? sudo chmod +x /path/to/customscript

ProjectileObjects commented 5 years ago

Will it run if you comment out: #/var/www/sync/stopall &

magdesign commented 5 years ago

What I am wondering is how do you trigger the custom script, since there are only 2 buttons in CP for Autostart custom scripts, so you would have to reboot PVJ to get it triggered.

Prepete commented 5 years ago

For testing I‘ve modified the customscript trough a ssh session and I also triggered it through this session. On page „aux“ in cp you implemented a button for two custom function. So I wanted to combine both - autostart and for retriggering the button. Later I’ll check the permission and try it by commenting out the „killall-function“.

Prepete commented 5 years ago

hi there, everything is working out fine right now. I changed the permissions and deleted the "kill-process". Trigger works fine on reboot and manually. Thank you!

magdesign commented 5 years ago

I totally forgot about those buttons :-) You should leave the stopall command, since this is essential to kill all running tasks. Its quite sure that the problem was the permissions, so can we mark the issue as solved?

Prepete commented 5 years ago

yes, it's working now... I've put a delay of a few seconds between stopping all and playing back the 24h video... Thank you!