Page 2 of 3

Re: [API] SamyGO web API

Posted: Mon Mar 12, 2018 2:24 pm
by gogo
I don't understand this step:
CMD_ON:/mnt/scripts/onPowerOn.sh CMD_OFF:/mnt/scripts/onPowerOff.sh

Where can I download those scripts? :?

Re: [API] SamyGO web API

Posted: Mon Mar 12, 2018 2:38 pm
by mad_ady
The onPowerOn.sh/onPowerOff.sh scripts (among other functionality) should set a flag by creating a file called

Code: Select all

/dtv/tvIsSleeping

:

onPowerOn.sh: rm -f /dtv/tvIsSleeping
onPowerOff.sh: touch /dtv/tvIsSleeping

If you don't use libSoftPowerOff, the TV powers off and the web API is no longer accessible.
You should just create them, like this (minimum; you can run your own code in them as needed):
/mnt/scripts/onPowerOn.sh:

Code: Select all

#!/bin/sh
rm -f /dtv/tvIsSleeping
/mnt/scripts/onPowerOff.sh:

Code: Select all

#!/bin/sh
touch /dtv/tvIsSleeping
Make sure both scripts are executable:

Code: Select all

chmod a+x /mnt/scripts/onPower*.sh

Re: [API] SamyGO web API

Posted: Sun May 27, 2018 9:31 pm
by WarLLe
Would it be possible to provide support for "libAlert"?

Re: [API] SamyGO web API

Posted: Mon May 28, 2018 6:43 am
by mad_ady
Do you mean showing an alert on-screen injected via the API? Sure. Can you show me an example alert via the command line?

Re: [API] SamyGO web API

Posted: Mon May 28, 2018 11:40 am
by WarLLe
Yea exactly.

It's the App from here viewtopic.php?f=63&t=9099 .

And the command is something like:

Code: Select all

samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libAlert.so BLINKS:3 DELAY:200 MSGBOX:"Blah!"
There are some arguments you can check them in the Topic.

Re: [API] SamyGO web API

Posted: Tue Jun 05, 2018 7:59 am
by mad_ady
I've added support for libRunWidget (viewtopic.php?f=63&t=9306) and updated the first post with examples. Sadly, it crashes my H6400 when I try to run a widget (even via the command line), but give it a try on other systems:

Code: Select all

[root@tv rwcommon]# /mnt/opt/privateer/usr/bin/samyGOso -d -T -B -l /mnt/opt/privateer/usr/libso/libRunWidget.so ID:111299001922
samyGOso v1.2.5 (c) bugficks 2013-2014, sectroyer 2014-2015
Injecting '/mnt/opt/privateer/usr/libso/libRunWidget.so' resident: '0'
mprotect: 0x4227c020
dlopen: 0x424a0d80
dlclose: 0x424a0e14
dlsymaddr: 0x424a0e78
pc=42324eec lr=42324ed0 sp=be2a7de0 fp=302af40
r0=302af44 r1=80
r2=1 r3=0
stack: 0xbe288000-0xbe2a8000 length = 131072
executing injection code at 0xbe2a7c88
library injection completed!
Succeeded.
[root@tv rwcommon]# 
I will add libAlert next.

Re: [API] SamyGO web API

Posted: Tue Jun 05, 2018 8:54 am
by zoelechat
Inject -A, not -T :)

Re: [API] SamyGO web API

Posted: Tue Jun 05, 2018 10:09 am
by mad_ady
You're right zoelechat, now it works without crashing. Thanks.
I also added libAlert support and updated the first post.
Enjoy!

Re: [API] SamyGO web API

Posted: Tue Jun 05, 2018 12:32 pm
by WarLLe
mad_ady wrote: Tue Jun 05, 2018 10:09 am You're right zoelechat, now it works without crashing. Thanks.
I also added libAlert support and updated the first post.
Enjoy!
Thanks for that fast delivery of the feature request.
I am in developement for an FHEM Module for your API.
Who is interested in that can find it here:
https://forum.fhem.de/index.php/topic,88116.0.html

I got not all features at the moment cause it's still dev build.

Re: [API] SamyGO web API

Posted: Thu Jun 07, 2018 7:48 am
by mad_ady
Nice. Good luck with it!
Try not to have many simultaneous calls to the API because it will either fail, or risk crashing the TV. This is because to extract data I have to inject some libraries into a running process and if there are many injections it can fail. There is a locking mechanism inside the API, but I haven't tested it extensively.