Latest Public Release (Ver 3.0) (Compatibility: Rpi Zero & Rpi1,2,3)
Current Donation Release (Ver.4.1) (Compatibility: Rpi2,3,4)

Under Development (Ver 5.0)

If you want to support the project and download donation releases , Feel free to donate any amount! (minimum 10€)


Donators Rank Level
ImageMovieNow Ver 5.0! - [Under Development]
ImageMovieNow Ver 4.1 - Donation Release Available!
Image All the orders for "Digital Poster Ready Packet" delay because the COVID-19! please be patience.
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: 18
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: 409
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 1122 times
RockDawg
Donator Rank **
Donator Rank **
Posts: 18
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: 409
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)
RockDawg
Donator Rank **
Donator Rank **
Posts: 18
Joined: Sat Feb 01, 2020 5:09 pm

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

Wed Feb 26, 2020 2:01 am

So I went down to the theater tonight and again my Shield had exited out of Kodi so my poster TV was displaying a black screen when I first went down. Researching a little I found someone mention the nc command and it seems to work. Can you offer an assistance on how to alter your previous script for this command?

192.168.1.30 is a Shield box with Kodi running and 192.168.1.32 is a box where Kodi is closed.

Code: Select all

pi@movienow:~$ nc -vz 192.168.1.30 8080
Connection to 192.168.1.30 8080 port [tcp/http-alt] succeeded!
pi@movienow:~$ nc -vz 192.168.1.32 8080
nc: connect to 192.168.1.32 port 8080 (tcp) failed: Connection refused
pi@movienow:~$
User avatar
MidnightWatcher
Donator Rank **
Donator Rank **
Location: Ontario, Canada
Posts: 87
Joined: Sat Feb 01, 2020 4:50 pm

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

Wed Mar 11, 2020 6:17 am

If it hasn't been added yet, I think this should be the default behaviour when we select Kodi posters. If Kodi isn't playing a movie then display posters from another directory.
Vero 4K | Epson 5030UB | 100" EluneVision Ref 4K Screen | Denon X3600H @ 5.2.4 | 4x ADX Maximus & Dayton Audio SA230 | Polk RTiA9 + CSiA6 + OWM3 + SVS PC2000 + Monolith 15 | 40" HDTV + RPi4 & MovieNow! v4 | 32TB HDDs + 4x DLink DHP-701AV
ae0705t
Donator Rank **
Donator Rank **
Posts: 34
Joined: Mon Feb 17, 2020 9:15 pm

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

Sat Mar 14, 2020 4:02 pm

The last comment in this thread sounds like it doubles with another request ... if Kodi/Plex isn't playing, use another Poster category. I would LOVE that one.
User avatar
MidnightWatcher
Donator Rank **
Donator Rank **
Location: Ontario, Canada
Posts: 87
Joined: Sat Feb 01, 2020 4:50 pm

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

Sat Mar 14, 2020 4:46 pm

In my case, I have a bunch of 70's and 80's nostalgic posters in the Classic folder and I have these selected to play. When a movie isn't playing in Kodi I'd like these posters displaying again.
Vero 4K | Epson 5030UB | 100" EluneVision Ref 4K Screen | Denon X3600H @ 5.2.4 | 4x ADX Maximus & Dayton Audio SA230 | Polk RTiA9 + CSiA6 + OWM3 + SVS PC2000 + Monolith 15 | 40" HDTV + RPi4 & MovieNow! v4 | 32TB HDDs + 4x DLink DHP-701AV
tomoffel
Donator Rank *
Donator Rank *
Posts: 53
Joined: Sat Feb 01, 2020 10:06 pm

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

Sun Mar 15, 2020 12:37 am

I"ve gave this a shot and got it to work with my kodi setup

My Kodi is running on my firetv stick, so its not every time active. I've modified the script to check If the port is open, if so, switch to the kodi tab, if not, switch to the custom tab

Code: Select all

#!/bin/bash
SERVER=192.168.1.43
PORT=8080
nc -z -v -w5 $SERVER $PORT &> /dev/null
result1=$?

#Do whatever you want

if [  "$result1" != 0 ]; then
  echo $?
  echo  port $PORT is closed on $SERVER
  sudo /var/www/html/settings/tab1.sh
else
  echo $?
  echo port $PORT is open on $SERVER
  sudo /var/www/html/settings/tab2.sh
fi
Change the Variables on top (SERVER and PORT) to your setup!

Hope someone will find this usefull!

MAybe I will extend it if I can find out which tab is active, so we can make it not switching away from the "welcome to the theater" poster and stuff!
User avatar
0raid
Site Admin
Contact:
Location: Athens / Greece
Posts: 409
Joined: Sat Feb 01, 2020 1:31 am

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

Sun Mar 15, 2020 7:55 pm

tomoffel wrote:
Sun Mar 15, 2020 12:37 am
I"ve gave this a shot and got it to work with my kodi setup

My Kodi is running on my firetv stick, so its not every time active. I've modified the script to check If the port is open, if so, switch to the kodi tab, if not, switch to the custom tab

Code: Select all

#!/bin/bash
SERVER=192.168.1.43
PORT=8080
nc -z -v -w5 $SERVER $PORT &> /dev/null
result1=$?

#Do whatever you want

if [  "$result1" != 0 ]; then
  echo $?
  echo  port $PORT is closed on $SERVER
  sudo /var/www/html/settings/tab1.sh
else
  echo $?
  echo port $PORT is open on $SERVER
  sudo /var/www/html/settings/tab2.sh
fi
Change the Variables on top (SERVER and PORT) to your setup!

Hope someone will find this usefull!

MAybe I will extend it if I can find out which tab is active, so we can make it not switching away from the "welcome to the theater" poster and stuff!
Nice!

Return to “Feature Requests”