piccap icon indicating copy to clipboard operation
piccap copied to clipboard

Piccap autstart does not work

Open denimjeans opened this issue 2 years ago • 21 comments

Hi, first of all: thanks everyone who contributed to this project. :-)

I have an issues with autostart on my TV:

    "board_type": "O18_DVB",
    "hardware_id": "HE_DTV_W18O_AFABABAA",
    "product_id": "OLED65C8LLA",
    "core_os_release": "4.4.0-9",
    "webos_manufacturing_version": "05.40.09",

using piccap version 2.3

When I turn on the TV, background lit up, but stays on white color. I need to go into Piccap and stop & start service to have connection to the hyperion server. then it works fine. Any Idea why it does not work automatically?

denimjeans avatar Jan 27 '22 16:01 denimjeans

I have exactly the same problem

gomble avatar Jan 27 '22 17:01 gomble

I assume both of you are using libdile_vt?

Have you used some older piccap version? If so, then please try running rm /var/lib/webosbrew/init.d/piccapautostart, then go to piccap settings, disable autostart, save, reenable autostart, save... I think we still have a minor bug in autostart handling which fails when some old piccap version (before 0.2.x) was installed before and left some files on the filesystem.

Informatic avatar Jan 27 '22 17:01 Informatic

I assume both of you are using libdile_vt?

Have you used some older piccap version? If so, then please try running rm /var/lib/webosbrew/init.d/piccapautostart, then go to piccap settings, disable autostart, save, reenable autostart, save... I think we still have a minor bug in autostart handling which fails when some old piccap version (before 0.2.x) was installed before and left some files on the filesystem.

yes i had 2 older versions of picap on my lg. I will test this and come backk

gomble avatar Jan 27 '22 18:01 gomble

did that, but for me it seems not to fix the issue. Autostart seems to working, but not connecting to the hyperion server. via manual start it works. how can i deinstall completely and install again?

it looks like it does not load a config, only when manual restart then it does... at least this describes my issue

denimjeans avatar Jan 27 '22 19:01 denimjeans

Do you guys have some more information for us? Which settings are you using?

TBSniller avatar Feb 06 '22 14:02 TBSniller

I investigated a workaround to autostart the capture service without rebooting the tv or disabling the quick start. I used home assistant to turn off and on the capture service once the tv turned on. If someone is interested in it .. Don't know if this is the right place for this.

wehrstedt avatar Feb 16 '22 22:02 wehrstedt

I investigated a workaround to autostart the capture service without rebooting the tv or disabling the quick start. I used home assistant to turn off and on the capture service once the tv turned on. If someone is interested in it .. Don't know if this is the right place for this.

yes i am interested in can you post it ?

gomble avatar Feb 16 '22 22:02 gomble

I investigated a workaround to autostart the capture service without rebooting the tv or disabling the quick start. I used home assistant to turn off and on the capture service once the tv turned on. If someone is interested in it .. Don't know if this is the right place for this.

yes i am interested in can you post it ?

  1. Enable SSH access on your tv.
  2. Place your public key on your tv for connecting via ssh without password
  3. Create the following script in /home/root on your tv:
root@LGwebOSTV:~# cat my-piccap-service.sh
#!/bin/bash

set -e
luna-send -d -n 1 "luna://org.webosbrew.piccap.service/$1" "{ \"method\": \"$1\"}" &
  1. Create a shell command in home assistant (configuration.yaml). You have to change the path to your private key (im using docker and had to mount my key in the home assistant container):
shell_command:
  piccap_capture_service: 'ssh -i "/config/.ssh/id_rsa" -o "StrictHostKeyChecking=no" root@<your-tv-ip> "bash my-piccap-service.sh {{ command }}"'
  1. Create an automation which triggers when your tv turns on:
- service: shell_command.piccap_capture_service
  data:
    command: stop
- delay:
    hours: 0
    minutes: 0
    seconds: 5
    milliseconds: 0
- service: shell_command.piccap_capture_service
  data:
    command: start

I don't know if its necessary to stop the service first. But it works. And I dont know why the luna command has to be launched as a background service (&). But without the command gets not executed.

wehrstedt avatar Feb 16 '22 22:02 wehrstedt

in which format is your ssh key ? i got following error: ➜ /config ssh -i "/ssl/lg_homeassistant_private" -o "StrictHostKeyChecking=no" [email protected] "bash my-piccap-service.sh {{ command }}" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0744 for '/ssl/lg_homeassistant_private' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/ssl/lg_homeassistant_private": bad permissions

My Public key: lg_homeassistant_private image

public key in authorization file: image

gomble avatar Feb 17 '22 15:02 gomble

Permissions 0744 for '/ssl/lg_homeassistant_private' are too open. That's a good summary. You first need to run:

chmod 0600 /ssl/lg_homeassistant_private

Informatic avatar Feb 17 '22 15:02 Informatic

Permissions 0744 for '/ssl/lg_homeassistant_private' are too open. That's a good summary. You first need to run:

chmod 0600 /ssl/lg_homeassistant_private

okay its working thank you 👍

gomble avatar Feb 17 '22 15:02 gomble

Hello,

i have also the problem that the autostart doesn't work. If i open piccap manuel, than it works. Setting is new 2020+ tv / video capture / graphic capture. I think it worked until there was a update from the tv. but root is still ok says webosbrew. Can I just root the TV again to be sure that this is not the problem or will this cause other problems? Thank you in advance!

Laudings avatar Mar 10 '22 18:03 Laudings

Hi Is there any other solution to this issue? Because the app doesn't start for me either. It only works if you send the TV to the reboot from the app itself. Larsen

Larsen23 avatar Aug 25 '22 07:08 Larsen23

I investigated a workaround to autostart the capture service without rebooting the tv or disabling the quick start. I used home assistant to turn off and on the capture service once the tv turned on. If someone is interested in it .. Don't know if this is the right place for this.

yes i am interested in can you post it ?

  1. Enable SSH access on your tv.
  2. Place your public key on your tv for connecting via ssh without password
  3. Create the following script in /home/root on your tv:
root@LGwebOSTV:~# cat my-piccap-service.sh
#!/bin/bash

set -e
luna-send -d -n 1 "luna://org.webosbrew.piccap.service/$1" "{ \"method\": \"$1\"}" &
  1. Create a shell command in home assistant (configuration.yaml). You have to change the path to your private key (im using docker and had to mount my key in the home assistant container):
shell_command:
  piccap_capture_service: 'ssh -i "/config/.ssh/id_rsa" -o "StrictHostKeyChecking=no" root@<your-tv-ip> "bash my-piccap-service.sh {{ command }}"'
  1. Create an automation which triggers when your tv turns on:
- service: shell_command.piccap_capture_service
  data:
    command: stop
- delay:
    hours: 0
    minutes: 0
    seconds: 5
    milliseconds: 0
- service: shell_command.piccap_capture_service
  data:
    command: start

I don't know if its necessary to stop the service first. But it works. And I dont know why the luna command has to be launched as a background service (&). But without the command gets not executed.

Welcome. This looks like exactly what I need. but lack of knowledge to setup ssh connection(

lightzhuk avatar Aug 25 '22 22:08 lightzhuk

Autostart is already fixed in newer development versions. If you aren't able to connect to your TV using SSH, just wait a bit more until release.

TBSniller avatar Aug 26 '22 23:08 TBSniller

@TBSniller :

  1. how to we start & stop the service.
  2. As the autorun does not work, therefore I need to STOP and START manually, sometimes it happens that the service does not start anymore, then I need to reboot completely, any chance via SSH? What the exact command to start / stop the service
  3. Are there any precompiled more recent development versions avaiable? I dont have any enviroment setup yet, therefore I am asking. When is the new release planned approx?

denimjeans avatar Aug 27 '22 07:08 denimjeans

2. sometimes it happens that the service does not start anymore, then I need to reboot completely

try killall -9 hyperion-webos via ssh and start should work

mksy avatar Aug 27 '22 07:08 mksy

  1. sometimes it happens that the service does not start anymore, then I need to reboot completely

try killall -9 hyperion-webos via ssh and start should work

thank you, and restarting (starting) ? hyperion-webos & ?

denimjeans avatar Aug 27 '22 07:08 denimjeans

luna-send -n 1 'luna://org.webosbrew.piccap.service/start' '{}'

mksy avatar Aug 27 '22 08:08 mksy

in my case, I created a script on the TV, and call it via SSH twice if the autostart does not work

#!/usr/bin/sh
pc_status=`luna-send -n 1 'luna://org.webosbrew.piccap.service/start' '{}'`
if echo $pc_status | grep -q '{"returnValue":false}'; then
	killall -9 hyperion-webos
	luna-send -n 1 'luna://org.webosbrew.piccap.service/stop' '{}'
fi

mksy avatar Aug 27 '22 08:08 mksy

thanks @mksy, I will give it a try. Looks good.

denimjeans avatar Aug 27 '22 21:08 denimjeans

With latest release we reworked almost anything. Please check it out, it should work now for webOS 3.4 and above.

TBSniller avatar Sep 25 '22 11:09 TBSniller

Thanks for the new version. But its now even worse. Need to reboot to get it working. Before manul restarting worked at least with 0.23

denimjeans avatar Sep 25 '22 19:09 denimjeans

@denimjeans Can you please create an issue here https://github.com/webosbrew/hyperion-webos/issues ? We would also need some logs. You can get them in Log Tab in PicCap -> First set it up using buttons in log tab -> Then produce your problem -> then get last log -> Put the picture in your issue.

You can also get logs directly from CLI by manually running it: https://github.com/webosbrew/hyperion-webos#running Make sure to kill proccess kill -9 $(pidof hyperion-webos) and PicCap before

TBSniller avatar Sep 25 '22 21:09 TBSniller

@TBSniller thank you. issues opened here -> #https://github.com/webosbrew/hyperion-webos/issues/95

for everyone who has the same issue. I know that there are at least 2 ppl with the same issue

denimjeans avatar Sep 27 '22 20:09 denimjeans

@TBSniller one thing more: could you please let me know on how to downgrade from 0.41 to 0.23. I have managed to copy the 0.23 ipk file to /tmp. But not sure on how to install now? ipkg and opkg not working here. thanks

denimjeans avatar Sep 27 '22 21:09 denimjeans

@TBSniller one thing more: could you please let me know on how to downgrade from 0.41 to 0.23. I have managed to copy the 0.23 ipk file to /tmp. But not sure on how to install now? ipkg and opkg not working here. thanks

@denimjeans sure, you can use Install command mentioned here: https://github.com/TBSniller/piccap#manual-way Just replace it with your filename. When its finished you can exit it with CTRL+C

Btw Just make sure to uninstall latest version before installing the old one

TBSniller avatar Sep 27 '22 21:09 TBSniller

luna://org.webosbrew.piccap.service/$1

hey this still works for you?

I would like to turn on and off piccap from ha but i am missing something copying your way. I put a public key in my tv, and placed the private one in a file in ha but the shell command always gives de error 255.

edit. actually i wanted to ask that to @lightzhuk, since i was trying to do the way he didi it, sorry.

finipini avatar Feb 19 '23 21:02 finipini