Movienow! app is free! TOTALLY FREE! If you want to support the project, Feel free to donate any amount!


Donators Rank Level
Image MovieNow - Digital Poster Ready Packet Available for Pre-order!
Image MovieNow Ver 3.0 - Public Release Available!
Image If you don't receive the activation Email, Please Check your Spam folder!

Default to custom posters if Kodi/Plex connection lost

Post all your suggestions/requests/ideas
RockDawg
Donator Rank **
Donator Rank **
Posts: 3
Joined: Sat Feb 01, 2020 5:09 pm

Default to custom posters if Kodi/Plex connection lost

Sat Feb 08, 2020 10:42 pm

We only use our theater room once or twice a week and I've had a couple instances where my Nvidia Shield has exited out of Kodi for some reason. So when I initially go downstairs MovieNow is just showing a black screen until I go into the theater room and start Kodi. Certainly, this is not a problem with MovieNow! but it would be nice if MovieNow! would detect this lost connection and switch to custom posters so It is never displaying black screen. Ideally it would remember that it was set to display Kodi and when connection is reestablished it would automatically start showing Kodi posters. Even if that proves too much and we have to manually switch back to Kodi/Plex, I would still like to see this. It would help eliminate any instance of MovieNow! not displaying a poster.
User avatar
0raid
Site Admin
Contact:
Location: Athens / Greece
Posts: 81
Joined: Sat Feb 01, 2020 1:31 am

Re: Default to custom posters if Kodi/Plex connection lost

Sat Feb 08, 2020 11:38 pm

you can do it already with a small script and the schedule feature!

1) connect to your Rpi terminal [server: movienow.local or Rpi IP address , username: pi , password: movienow
2) sudo bash [enter]
3) cd /var/www/html/settings/ [enter]
4) nano kodistatus.sh [enter]
5) copy paste the code:

* replace the 192.168.5.180 with your kodi IP *

Code: Select all

# check if KODI is responding
if ping -q -c 1 -W 1 192.168.5.180 >/dev/null; then
# if KODI is UP - do nothing
else
# if KODI is offline swich to custom posters
DISPLAY=:0.0
export DISPLAY
xhost +
xdotool key ctrl+3
fi
6) CTRL + O (you will see in the bottom (File Name to Write: kodistatus.sh) [enter]
7) CTRL + X [enter]
8) chmod +x kodistatus.sh [enter]

test the script:

./kodistatus.sh [enter]

if everything works great (ignore any error in terminal), just look if change the view from KODI to Custom when KODI is OFF!

Now open the web interface > Schedule > New CronJob

if you want to check every minute in the left options put in all the fields * (check also the screenshot)

and finally in the right , put the command of where is the script (this is the full path)

sudo /var/www/html/settings/kodistatus.sh

and press save New CronJob!

DONE! , schedule is running the kodistatus.sh script every minute to check if KODI is ONLINE or NOT!

**** The Schedule Feature its very powerfull , you can make and run anything you can imagine!! ****
Attachments
Screenshot 2020-02-09 at 1.37.00 AM.png
Screenshot 2020-02-09 at 1.37.00 AM.png (94.83 KiB) Viewed 76 times
RockDawg
Donator Rank **
Donator Rank **
Posts: 3
Joined: Sat Feb 01, 2020 5:09 pm

Re: Default to custom posters if Kodi/Plex connection lost

Wed Feb 12, 2020 3:54 pm

I haven't yet tried this but I'm thinking this won't work in my situation. It appears to be determining if Kodi is running by pinging an IP address. The issue is that Kodi doesn't have it's own IP address. The machine it runs on does. So even if Kodi is not running, the machine will still respond to the ping.
User avatar
0raid
Site Admin
Contact:
Location: Athens / Greece
Posts: 81
Joined: Sat Feb 01, 2020 1:31 am

Re: Default to custom posters if Kodi/Plex connection lost

Wed Feb 12, 2020 10:19 pm

yes the script its only for people who run KODI in dedicated device! (openelenc. coreelec , libreelec)

i will add another script which ping IP and specific port (KODI port)

Return to “Feature Requests”