Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread:
Thread Closed 
Wake up NAS from Popcorn
03-11-2009, 08:04 PM (This post was last modified: 07-01-2009 08:13 AM by dc11ab.)
Post: #1
Wake up NAS from Popcorn
I have found a workaround solution for waiking up nas storage.

1.
Install busybox using community installer, just search this forum for a link to page

2.
Create file :NAS-start.cgi on root of your HDD mounted in popcorn.
Paste code below inside NAS-start.cgi, change mac addres of your NAS server instead <i>put_mac_addres_here</i> and save file.
Remember it is a linux system so before saving convert it to linux format - there are some differences in reading endline char ... I think ....

Code:
#!/bin/sh

MARKER="#M_A_R_K_E_R_do_not_remove_me"


start()
{
    echo -n "Sending MP to NAS"
    /opt/sybhttpd/localhost.drives/HARD_DISK/.bin/busybox ether-wake -b put_mac_addres_here
    echo "Magic Packet Send..."
}


start_html()
{
    echo "Content-Type: text/html"
    echo ""
    cat <<EOF
<html>
<head>
<title>
NAS WOL started
</title>
</head>
<body>
            
EOF
}
            
end_html()
{
    cat <<EOF
</body>
</html>
EOF
}
start_html
start
end_html

exit 0

--- code end
3.
add new web service in popcorn:

url: http:\\localhost.drives:8883\HARD_DISK\NAS-start.cgi

Now you can wake up nas server using built menu of popcorn

Note:
I'm not a sh programer - I just follow some tutorials to get this job done ( just took me about 10 minutes to write it and i'm happy cos its working Wink, so it is not a smartes code in a world Wink. Feal free to modify.
Just did it for my own purpose, but I just thought i could share so someone else can enjoy it. Taking NO responobily for it - use it in at your own risk Wink
ps Sorry for my english ...


Enjoy
Find all posts by this user
[+] 3 users say Thank You to mrfac for this post
03-11-2009, 08:11 PM
Post: #2
RE: Wake up NAS from Popcorn
What Nas are you using for everyones information?

I have a DNS323 and it wakes up everytime I click on the share in PCH.

Hasn't failed once in 5 months I have had it.
Find all posts by this user
03-11-2009, 08:15 PM (This post was last modified: 03-11-2009 08:17 PM by mrfac.)
Post: #3
RE: Wake up NAS from Popcorn
(03-11-2009 08:11 PM)Sailorman Wrote:  What Nas are you using for everyones information?

I have a DNS323 and it wakes up everytime I click on the share in PCH.

Hasn't failed once in 5 months I have had it.

Great to hear that - I didn't know that clicking on a share wakes up NAS ...
I'm using a winXP computer ( as NAS server with myiHome for browsing content )with few batch and scheduled task on it so it automaticly unpack *.rar, reads freame rates form movies and downloads and converts subtitles to popcorn format.
Popcorn didn't wake my computer ( NAS server ) automaticly for me ...

Damn you are quick in replaying ... I havent finished fixing typos and there is a replay already - WoW Wink
Find all posts by this user
03-11-2009, 10:43 PM
Post: #4
RE: Wake up NAS from Popcorn
@mrfac,

Could you please re-edit your first post and put the actual code inside of forum CODE tags (the # button)
Without it some critical code could be missing because of forum posting.
Find all posts by this user
03-11-2009, 10:45 PM
Post: #5
RE: Wake up NAS from Popcorn
Most NAS will wake. Your pc should wake up to unless its in standby.
Find all posts by this user
03-12-2009, 04:47 PM
Post: #6
RE: Wake up NAS from Popcorn
Maybe I would add shares properly if the popcorn didn't always forget them. I will use this because I am lazy - and also the auto mount script elsewhere posted in these forums.
Find all posts by this user
04-05-2009, 05:06 AM
Post: #7
RE: Wake up NAS from Popcorn
Seems most PC's do wake on LAN traffic ... any traffic ...
You will need to set it (nVidia chipset) to "Wake-On-LAN" (instead of 'Wake-on-Pattern") to prevent your Windows box to stay on all the time.
(even if I force my XP box to go to standby, wake-on-pattern will wake it up with a minute or 2 - unlike Wake-on-lan where it actually wait for a WOL packet).

Webmaster http://www.weethet.nl
Find all posts by this user
06-30-2009, 07:17 PM (This post was last modified: 06-30-2009 07:35 PM by nianoniano.)
Post: #8
RE: Wake up NAS from Popcorn
I'm linux noob, and I created file with NotePad++:

Code:
#!/bin/sh

MARKER="#M_A_R_K_E_R_do_not_remove_me"


start()
{
echo -n "Sending MP to NAS"
/opt/sybhttpd/localhost.drives/HARD_DISK/.bin/busybox ether-wake -b put_mac_addres_here
echo "Magic Packet Send..."
}


start_html()
{
echo "Content-Type: text/html"
echo ""
cat <


EOF
}

end_html()
{
cat <
EOF
}
start_html
start
end_html

exit 0

Save, and trough telnet ./NAS-start.cgi

but don't work, what I'm doing wrong?

EDIT Sintax error in line 18, unexpected newline.
Find all posts by this user
06-30-2009, 07:23 PM
Post: #9
RE: Wake up NAS from Popcorn
(Moved thread to the development section)

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
06-30-2009, 07:29 PM
Post: #10
RE: Wake up NAS from Popcorn
(06-30-2009 07:17 PM)nianoniano Wrote:  I'm linux noob, and I created file with NotePad++:

Code:
#!/bin/sh

MARKER="#M_A_R_K_E_R_do_not_remove_me"


start()
{
echo -n "Sending MP to NAS"
/opt/sybhttpd/localhost.drives/HARD_DISK/.bin/busybox ether-wake -b put_mac_addres_here
echo "Magic Packet Send..."
}


start_html()
{
echo "Content-Type: text/html"
echo ""
cat <


EOF
}

end_html()
{
cat <
EOF
}
start_html
start
end_html

exit 0

Save, but don't work, what I'm doing wrong?

I think you need to put the MAC address of the computer you want to wake up where it says "put_mac_address_here."
Find all posts by this user
06-30-2009, 09:20 PM
Post: #11
RE: Wake up NAS from Popcorn
(06-30-2009 07:29 PM)beffect Wrote:  I think you need to put the MAC address of the computer you want to wake up where it says "put_mac_address_here."

No, I've put mac adress of pc. If I do in shell ether-wake -b 00:01:....... works, but srcript don't
Find all posts by this user
07-01-2009, 12:03 AM
Post: #12
RE: Wake up NAS from Popcorn
(06-30-2009 07:17 PM)nianoniano Wrote:  I'm linux noob, and I created file with NotePad++:
...
Save, and trough telnet ./NAS-start.cgi

but don't work, what I'm doing wrong?

EDIT Sintax error in line 18, unexpected newline.

You created the file using NotePad++, which is good, but did you tell it to set the file type as Unix/Linux
file endings? Otherwise you probably have Windows CR/LF characters in the file causing the problem.

Or fix it by using Telnet to access the box, cd into the folder where the file is, and run the command
/share/bin/dos2unix ./NAS-start.cgi
Find all posts by this user
[+] 1 user says Thank You to garp99 for this post
07-15-2009, 01:46 AM
Post: #13
RE: Wake up NAS from Popcorn
This works like a charm and something I wanted for ages. I just couldn't figure it out, but you did, so 3 cheers to you!
Find all posts by this user
07-20-2009, 01:21 PM
Post: #14
RE: Wake up NAS from Popcorn
hi,

Great staff. How can the script be invoked through the remote? Any ideas?

Uros
Find all posts by this user
07-20-2009, 04:33 PM
Post: #15
RE: Wake up NAS from Popcorn
You can probably make a TVID in a custom index html file to assign the script to a certain rc button, but I guess the NAS-cgi solution in the web service described above is accessed quite fast already.

Example:
http://www.networkedmediatank.com/showth...#pid214083

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  PopCorn MKV AudioConverter HeartWare 1,810 1,866,870 03-17-2014 09:34 PM
Last Post: kae
  SqueezeSlave available for Popcorn Hour duanep 15 10,069 12-03-2013 09:08 PM
Last Post: danny harris
  Shairport (emulator airport express) on popcorn lololo 8 6,476 09-17-2012 09:34 PM
Last Post: LordHelmchen
  Support thread for HeartWare's PopCorn MKV Chapter Maker HeartWare 72 54,872 01-01-2012 10:10 AM
Last Post: halfelite
Rainbow Litepodder v1.0.0 for Popcorn Hour A-100/A-110/B-110 (podcast downloader) philofred 117 50,667 04-05-2011 03:17 AM
Last Post: jasch
  Setting up Popcorn Hour to Logitec Harmony Remote collingwood 5 12,487 12-30-2010 08:54 AM
Last Post: halfelite
  Popcorn does not see Twonky or PS3 Media Server rgn2000 0 3,992 09-02-2010 09:14 PM
Last Post: rgn2000
  SqueezeSlave for PopCorn (??) jjnh 0 2,982 08-20-2010 06:57 PM
Last Post: jjnh
  gedit for popcorn hour? hakank22 5 4,534 05-23-2010 06:22 AM
Last Post: hakank22
Information aMule 2.2.3-2 build for NMT Popcorn Hours [updated 3/31/2009] empatico 59 42,350 03-01-2010 06:19 AM
Last Post: fancyboy2k

Forum Jump: