hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
834 stars 202 forks source link

Cannot find on wifi #47

Open gearhead opened 10 years ago

gearhead commented 10 years ago

Probably a user error, but I cannot figure out why I cannot see the renderer on wifi. It works perfectly on cat5, but on the same subnet, I cannot see it from winmedia or bubble upnp or any other player. I have been using it woth a wired connection and now I must use wifi.

I start it using the init script and it starts at boot. Do not know why it is not showing up. I am using the /etc/init.d/gmrenderer script verbatim. If I start it from the command line, it appears to show up.

hzeller commented 10 years ago

Try to give gmrender-resurrect the IP address to listen on. It only can listen on one interface (due to some underlying reasons in the UPnP library).

With the command 'ifconfig' (older) or 'ip addr' (newer distributions) you can figure out on your machine which IP your wifi is configured for. Then start gmrender-resurrect with the --ip-address flag that you give that IP.

Let me know if that works.

gearhead commented 10 years ago

Hmmm. When I launch it from the command line, it appears. It is only when I launch it from the init script that it didn't show up. I know the ip address in any case. The WiFi is temporary. I guess I'll have to edit the init script for each setup. On Nov 13, 2013 8:02 PM, "Henner Zeller" notifications@github.com wrote:

Try to give gmrender-resurrect the IP address to listen on. It only can listen on one interface (due to some underlying reasons in the UPnP library).

With the command 'ifconfig' (older) or 'ip addr' (newer distributions) you can figure out on your machine which IP your wifi is configured for. Then start gmrender-resurrect with the --ip-address flag that you give that IP.

Let me know if that works.

— Reply to this email directly or view it on GitHubhttps://github.com/hzeller/gmrender-resurrect/issues/47#issuecomment-28453610 .

hzeller commented 10 years ago

Well, you could determine the IP address automatically in that script. For instance:

MYIP=$(ip addr | sed 's/inet ([.0-9])._wlan0/\1/p;d') .. then add this on the call to gmediarender ... --ip-address $MY_IP

Make sure that at the time your gmediarender is started, the network is up (e.g. numbering in /etc/rc2.d/)

gearhead commented 10 years ago

Henner,

I hard coded the IP address in the startup script b/c the SED script did not work.

$> MY_IP=$(ip addr | sed 's/inet ([.0-9]).wlan0/\1/p;d') sed: -e expression #1, char 27: invalid reference \1 on `s' command's RHS

I guess my question is more that gmediarender acts differently when you start adding parameters than when you just give it a name.. For example:

> /usr/local/bin/gmediarender -f "LabMusic" -d

will launch it and show that name on the network regardless of which interface is connected. No need to tell it what the IP address is.

When I launch it from the script, it seems to 'need' to know the ip address of the interface.

... start-stop-daemon -x $BINARY_PATH -c "$DAEMON_USER" -S -- -f "$UPNP_DEVICE_NAME" -d -u "$UPNP_UUID" $GS_SINK_PARAM $GS_DEVICE_PARAM --gstout-initial-volume-db=$INITIAL_VOLUME_DB --ip-address $MY_IP ...

What am I missing?

Keith

On Wed, Nov 13, 2013 at 9:03 PM, Henner Zeller notifications@github.comwrote:

Well, you could determine the IP address automatically in that script. For instance:

MYIP=$(ip addr | sed 's/inet ([.0-9])._wlan0/\1/p;d') .. then add this on the call to gmediarender ... --ip-address $MY_IP

Make sure that at the time your gmediarender is started, the network is up (e.g. numbering in /etc/rc2.d/)

— Reply to this email directly or view it on GitHubhttps://github.com/hzeller/gmrender-resurrect/issues/47#issuecomment-28455842 .

hzeller commented 10 years ago

Looks like the github rendering thing ate all the backslashes. Let's try that again, hopefully it renders now as 'code'

 MY_IP=$(ip addr | sed 's/inet \([.0-9]*\).*wlan0/\1/p;d')

the fact if you add the flag '-f' to give it a name should not change anything. You should try the usual debugging tricks with shellscripts to print out what the final command line looks like (e.g. 'echo' it). Also, write the gmrender logfile to some place where you can inspect it after the script started - it might reveal the proper reason what went wrong ( --logfile=/tmp/gmrender.log or something ) Also, did you verify that the network is up when the gmrender script is started ?

sm7xvd commented 10 years ago

I'll confirm that this last suggestion works. At least for me.

gearhead commented 10 years ago

Just did a clean new install and it works 'out of the box' for WiFi or ethernet