NextPVR Forums

Full Version: How to run npvr.cgi and startmeup from a linux box
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Why would you want to do this i hear you ask?
Reason is that I let my NPVR machine go to sleep when not in use for a while
Obviously mvpmcx2 and the rest won't run if the NPVR box isn't up
So it struck me that I could run NPVR.cgi from my linux machine which is always up, and patch in a loop to the cgi which would check whether the NPVR box is up and if not send a wake-up-on-lan message, then wait a few seconds before proceeding
I got it to run npvr.html from the linux box (set up a new share), but the cgi script which the html calls doesn't seem to work.
It still works fine if I run it from the NPVR box.
Is this mission impossible???
Steve Hodge
Yes, that works, in fact that is how I have mine setup, the share doesn't even need to be called mvpmc Just make sure the IP in the npvr.cgi and the name in N-PVR.html after /NETWORK_SHARE/ are for to the linux box.

You don't need to create to script, in startmeup just add the command line option
--em-wolwt ## to increase to the wait time for your server to ## seconds. The default without this is 30 seconds.

Martin
Indeed - that wolwt made the whole experience for me much better for servers that go to sleep.
At one time I was running the initial scripts from an IP security camera that was always on !!
I have a local drive in the NMT now which solved that problem though.
Thanks Martin, works fine now if I don't start the NMTs from cold. Can't get them to load mvpmcx2 from cold though; they don't seem to want to mount the mvpmc directory from the linux server. Something to do with my linux box I expect, permissions probably, but I fiddle with linux so rarely that i get rusty and it has got me beat for the moment. Am I right that there is no telnet capability in the NMT until you get all your stuff loaded? I was trying to see what was wrong with telnet, but it would not connect until I loaded mvpmcx2 and the rest in the original way

Steve
Did you try using the IP and not SMB name in the NMT URL field?

And yes the script installs the telnet server, it is not part of the NMT firmware.

Martin
Thanks Martin

It was passwords and permissions (as usual). The share would not mount without a username and password, all working now anyway

Comment: this WOL trick seems like magic to me. How does the program know the right MAC address even when started from cold, so that mvpmxc2 has to be reloaded. I can see how it might remember the MAC address between warm boots, but it seems to be able to do it starting from cold too!. Has to be magic!!!!

Steve
You will have to add the ether-wake program to the sahre and then manually add the MAC address to the command line in the NPVR.cgi script.

Martin
Bit off-topic but my setup is similar in using a WoL packet to wake-up the NPVR server. I've got a home automation setup so my PCH remote is used to send an IR signal based on the green button. The TV powers on from the wall as does the PCH, the HA server is a small mini-itx machine that runs 24x7 (consumes <40W) and also sends a WoL packet from a PowerShell script to the NPVR server. The NPVR server is a bit of a beast as it is a quad-core CPU with 5 drives and consumes 120W at idle. After I've finished watching the film / TV I hit the red button on the PCH. The IR signal is fed to the HA server which reverses the procedure, wall socket for the TV turns off, PCH wall socket turns off, HA server sends a shutdown command to the NPVR server. It all works very well for me.

Paul