NAS-WOL-handling by runeaudio

Raspberry Pi related support

NAS-WOL-handling by runeaudio

Postby al.einstein » 03 Mar 2015, 17:30

Hi there,

i´m using an selfmade NAS/Homeserver running Openmediavault 1.13 as storage for my music-collection and mounting the CIFS/SMB-Share in runeaudio workes nicely. The problem is: the NAS isn´t running all the time and must be WOLed by the client (which works perfectly with an Openelec-RPi2 and an i3-based Mediaportal-HTPC).

My first Question is: how can i make Runeaudio send a WOL-Packet prior to playback?
Weird thing happens when i choose a file from the playlist to be played while the NAS is still asleep.......playback starts (clock ticks up) but there´s no output, understandably.

My second Question is a little bit more complicated:

Same NAS is able to set itself to sleep-mode on various preconditions (i.e. checking for specific IP-adresses or monitoring the amount of data traffic). In my case the NAS checks if there are SMB/CIFS-Connections on Port 445. Server-Logs tell me that runeaudio doesn´t seem to close this connection after playback has stopped, so the NAS stays awake. Again: Openelec and Mediaportal work perfectly on that topic.

Is there a way to close the connection automatically - lets say - 5 mins after playback has stopped?

Cheers


al
al.einstein
 
Posts: 4
Joined: 03 Mar 2015, 17:16

Re: NAS-WOL-handling by runeaudio

Postby al.einstein » 05 Mar 2015, 20:51

No ideas :cry: ?
al.einstein
 
Posts: 4
Joined: 03 Mar 2015, 17:16

Re: NAS-WOL-handling by runeaudio

Postby Orion » 05 Mar 2015, 21:49

Hi Al, here is some answers for you.

al.einstein wrote:My first Question is: how can i make Runeaudio send a WOL-Packet prior to playback?
Weird thing happens when i choose a file from the playlist to be played while the NAS is still asleep.......playback starts (clock ticks up) but there´s no output, understandably.


You have to follow this guide and install the proper software.
Than you have to hook the WOL command with the system. I suggest you to not hook with playback commands but hook it with system startup, it is an easier task. You can do that in an easy way by adding this line:

Code: Select all
sysCmd('wol MACADDRESS');

at the beginning of the RuneAudio system worker (rune_SY_wrk), before this line should be fine.

al.einstein wrote:My second Question is a little bit more complicated:
Same NAS is able to set itself to sleep-mode on various preconditions (i.e. checking for specific IP-adresses or monitoring the amount of data traffic). In my case the NAS checks if there are SMB/CIFS-Connections on Port 445. Server-Logs tell me that runeaudio doesn´t seem to close this connection after playback has stopped, so the NAS stays awake. Again: Openelec and Mediaportal work perfectly on that topic.
Is there a way to close the connection automatically - lets say - 5 mins after playback has stopped?


You are right, RuneAudio is intended to handle network connections in a permanent way, so this behaviour is expected. But you can tweak the mount string acting on this line of code.

Ciao.
Simone
RuneAudio - Embedded Hi-Fi music player
SoloStereo - Alla riscoperta dell'alta fedeltà
User avatar
Orion
RuneAudio co-founder
 
Posts: 189
Joined: 29 Nov 2013, 02:03
Location: Udine, Italy

Re: NAS-WOL-handling by runeaudio

Postby al.einstein » 08 Mar 2015, 11:43

Hi and thanks for the answer,

hooking the wol-command to the system startup won´t work because - sorry not to mention that - i´m using an Raspberry Pi which basically runs all the time.

You are right, RuneAudio is intended to handle network connections in a permanent way, so this behaviour is expected. But you can tweak the mount string acting on this line of code.


I´m not into Linux very much, so is there an option to "dismount" a network drive after a specific time?

Chers

al
al.einstein
 
Posts: 4
Joined: 03 Mar 2015, 17:16

Re: NAS-WOL-handling by runeaudio

Postby Orion » 08 Mar 2015, 18:45

Hi Al,
you can simply schedule a cronjob that execute the unmount command at a specific time.

You can create a script that stops MPD and unmount your mountpoint; for example you can call it umount-rune.sh and put into /root/ directory:

umount-rune.sh

Code: Select all
#!/bin/bash
mpc stop
umount /mnt/MPD/NAS/<mountpoint name>


and then you need to schedule it by editing the system schedule /etc/crontab

Code: Select all
# execute the umount-rune.sh script at 15:30 every day.
30 15 * * *       root      /root/umount-rune.sh


If CRON package isn't istalled, you have to install it using pacman

Code: Select all
pacman -S cronie


You can use the same approach to auto-mount your NAS mount point at a specific time.

Ciao.

Simone.
RuneAudio - Embedded Hi-Fi music player
SoloStereo - Alla riscoperta dell'alta fedeltà
User avatar
Orion
RuneAudio co-founder
 
Posts: 189
Joined: 29 Nov 2013, 02:03
Location: Udine, Italy

Re: NAS-WOL-handling by runeaudio

Postby al.einstein » 08 Mar 2015, 22:19

Hi Orion,

okay, the NAS could be unmounted at a specific time with "cron"......but can it be unmounted just after playback has been stopped?

To clarify things: choosing a song/album/playlist etc. for playback wakes the NAS via WOL and starts playing the music normally. When Playback has ended the NAS should automatically be unmounted and the connection via SMB/CIFS be dropped.

Fundamental Question: would it be easier on that topic to use NFS or DLNA?

Cheers

al

EDIT: I dicovered another very unpleasing behavior of my RPi running Runeaudio: if another client wakes my NAS runeaudio connects automatically an therefore keeps it awake even if there is no playback from RPi at all.........
al.einstein
 
Posts: 4
Joined: 03 Mar 2015, 17:16

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 14 guests