INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: JRemote and JRiver on Raspberry Pi - keep disconnecting  (Read 6453 times)

PrinterPrinter

  • World Citizen
  • ***
  • Posts: 204
JRemote and JRiver on Raspberry Pi - keep disconnecting
« on: June 25, 2015, 06:09:23 am »

Hello,
I'm using JRemote on iPhone 6 and my JRiver renderer runs on Raspberry pi.
They are both connected to the same router (in the same room) via Wifi.

I can connect to the server and use it to change songs or volume, but if I leave it for a few minutes and then access it again you can see it's not responsive and often require a re-connect to resume functionality...

Didn't have this issue with JRiver running on a windows 7 PC

Please advise,
Thanks
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5177
  • "Linux Merit Badge" Recipient
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #1 on: July 13, 2015, 08:08:57 am »

Have you tried logging into the Pi directly from JRemote rather than logging into your server and controlling the Pi from there?  I often get better results logging directly into a renderer with JRemote.
Logged

PrinterPrinter

  • World Citizen
  • ***
  • Posts: 204
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #2 on: July 13, 2015, 08:13:27 am »

Have you tried logging into the Pi directly from JRemote rather than logging into your server and controlling the Pi from there?  I often get better results logging directly into a renderer with JRemote.

Thanks McWilliams this is exactly how I do it - log directly into the pie while sitting in the same room with the router about 3m away...

I can control it (change song, volume whatever) leave the phone alone for a minute and then when I pick it up again it ahs to once again connect to the RPI...

Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5177
  • "Linux Merit Badge" Recipient
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #3 on: July 13, 2015, 08:49:17 am »

When you say it's disconnecting, what do you mean exactly?  Does it require manual intervention?  Or does it just take a second to reconnect automatically? 

If the latter, I see the same behavior, and I'm not sure that's necessarily bad behavior (you wouldn't want JRemote to stay logged into the Pi indefinitely pinging it constantly when you're not interacting with it, right?).  I usually just wait a few seconds and it's fine.

If it's failing to log in and requires manual interaction, then you're seeing something different and we can try some troubleshooting steps.
Logged

PrinterPrinter

  • World Citizen
  • ***
  • Posts: 204
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #4 on: July 13, 2015, 04:23:34 pm »

When you say it's disconnecting, what do you mean exactly?  Does it require manual intervention?  Or does it just take a second to reconnect automatically? 

If the latter, I see the same behavior, and I'm not sure that's necessarily bad behavior (you wouldn't want JRemote to stay logged into the Pi indefinitely pinging it constantly when you're not interacting with it, right?).  I usually just wait a few seconds and it's fine.

If it's failing to log in and requires manual interaction, then you're seeing something different and we can try some troubleshooting steps.

Thanks mate,
it's the latter. I have to manually reconnect to the Pi again, and sometimes it won't succeed - which is weird as the pi is still streaming music and they are both connected to the same router via WiFi... some times I have to close the JRemote (on an iphone 6) and open it again. Quite annoying when you are trying to quickly lower the volume etc...

Any ideas are welcome!
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5177
  • "Linux Merit Badge" Recipient
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #5 on: July 13, 2015, 04:42:09 pm »

Hmm, that's odd, I never see that with any of my pi's.  I wonder if the pi is putting the network device to sleep?  I've disabled power management on all of my Pi WiFi devices because I'd get dropped connections after a while, so that may be why I'm not seeing this behavior.  

Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10730
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #6 on: July 13, 2015, 04:45:28 pm »

I'm not certain about the iOS version of JRemote, but in general, the connection between JRemote/Gizmo and MC is not "persistent". There is no permanent open connection between the two.
As long as the IP of the Pi does not change and it remains reachable on the network, it should not "disconnect" as such, as there is no connection to lose.

The way MCWS works, and as such JRemote and all other remotes, it simply opens a new connection for every command it sends.
The only reason those commands would fail and require a "reconnect" is when either the IP of MC changes, or the Auth token expires - but the token is valid for days.

It is possible that a connectivity loss of the WiFi connection may put JRemote in a "disconnected" state, as requests fail, so the idea with power management may help.
Logged
~ nevcairiel
~ Author of LAV Filters

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71470
  • Where did I put my teeth?
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #7 on: July 13, 2015, 04:52:07 pm »

It is possible that a connectivity loss of the WiFi connection may put JRemote in a "disconnected" state, as requests fail, so the idea with power management may help.
I believe that happens, and also with Gizmo.  If you're playing a long list, any wireless failure will stop playback permanently and you get an error message about every five seconds.
Logged

PrinterPrinter

  • World Citizen
  • ***
  • Posts: 204
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #8 on: July 14, 2015, 03:29:11 am »

Thanks guys,
I believe I have set all USB power management off on the RPI.

I don't think the WiFi connection itself (from the router) disconnects or the RPI changing it's IP address as the music keeps playing...

Oh well, I guess it's one of those unsolved bugs
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5177
  • "Linux Merit Badge" Recipient
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #9 on: July 14, 2015, 07:42:11 am »

Thanks guys,
I believe I have set all USB power management off on the RPI.

I don't think the WiFi connection itself (from the router) disconnects or the RPI changing it's IP address as the music keeps playing...

Oh well, I guess it's one of those unsolved bugs

Mediacenter doesn't stream the data at a uniform rate in my experience; it tends to pull most of the song across as soon as it can, and won't necessarily grab much more data until the next track change.  So unless it's playing several songs and you still can't connect that's not a good indicator that the wifi isn't sleeping.

When you say you "set all USB power management off on the RPI" that's not what I was talking about; USB power management wouldn't cause the problems you're seeing.  The wifi dongle itself has power-saving settings in its driver that need to be explicitly disabled in /etc/network/interfaces as described here: https://www.raspberrypi.org/forums/viewtopic.php?t=46569&p=666920

If you look around the net you'll find rivers of folks complaining about Raspberry Pi's having slow or intermittent connections or losing connection entirely.  The two most important tweaks you can make to the Pi's wifi for connection stability are to

1) disable power management by adding the following in the appropriate spot in your interfaces file:
Code: [Select]
wireless-power offand
2) Change the "wpa-conf" line by substituting "wpa-roam" (leave the rest of the line alone)

Doing 1) improves stability overall and prevents the dongle from turning itself off at inconvenient moments.  2) ensures that the Pi will try to reconnect immediately if it loses the connection.

After doing those two things, my Pi's never lose connection to the router for more than a second or two, and I have no problem connecting to them with JRemote (at least the android version of JRemote).  

If you make those changes (or if you already have) and still get issues, the next step is to try (for diagnostic purposes) another remote (webgizmo, or gizmo) to see if you experience the same issues with those remotes.  It's possible the ios version of JRemote may just be expecting an answer from Pi faster than the Pi can give it.  I only have the android version of JRemote to test with, so I can't test the ios version here.
Logged

mkolmar

  • Recent member
  • *
  • Posts: 40
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #10 on: August 14, 2015, 09:22:15 pm »

I am having a similar problem. JRemote on iPad is able to connect to server on startup. After a few moments, especially if I put JRemote in the background, JRemote is unable to connect to the server. At that point, browser on iPad also cannot connect to server. JRemote on Android at the same time is able to control MC. If I disable and re enable wifi on the iPad, JRemote is able to control MC again, and browser can connect, until the problem repeats.
Logged

PrinterPrinter

  • World Citizen
  • ***
  • Posts: 204
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #11 on: September 08, 2015, 02:33:11 pm »

If you look around the net you'll find rivers of folks complaining about Raspberry Pi's having slow or intermittent connections or losing connection entirely.  The two most important tweaks you can make to the Pi's wifi for connection stability are to

1) disable power management by adding the following in the appropriate spot in your interfaces file:
Code: [Select]
wireless-power offand
2) Change the "wpa-conf" line by substituting "wpa-roam" (leave the rest of the line alone)


Thanks Mate,
I'll give these a shot.

Can I ask you to point me to the location of the 'interfaces file' on the RPI?
Also, can you clarify what you mean by: 'Change the "wpa-conf" line by substituting "wpa-roam" (leave the rest of the line alone)'? What the correct syntax should be?

Apologies for the lame questions, I'm learning slowly... ;-)
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5177
  • "Linux Merit Badge" Recipient
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #12 on: September 08, 2015, 02:47:09 pm »

Thanks Mate,
I'll give these a shot.

Can I ask you to point me to the location of the 'interfaces file' on the RPI?
Also, can you clarify what you mean by: 'Change the "wpa-conf" line by substituting "wpa-roam" (leave the rest of the line alone)'? What the correct syntax should be?

Apologies for the lame questions, I'm learning slowly... ;-)


As noted in my previous post (the part you didn't quote), the file you want is /etc/network/interfaces.  Interfaces contains basic network device configuration. The correct syntax of the wpa-conf line will depend on how you've configured your wifi device, but the line will look something like:
Code: [Select]
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Changing wpa-conf to wpa-roam will cause the Pi to try and reconnect to wifi if it loses connection, which it will not necessarily do with wpa-conf set.  The only thing you have to change is "conf" to "roam"; if you change the rest of the line, you may create trouble for yourself.

In my observation, when I leave it set to wpa-conf, my Pi will keep it's wifi connection for a while, but will inevitably lose it and not recover.  How long it takes to lose the connections depends on the signal strength.  Setting it to wpa-roam means it usually reconnects on it's own when it loses a connection.  

I've tested this with a few "always on" headless Pi's around my house.  With wpa-conf set they'd eventually "go dark" and become (and stay) unreachable.  It might take a few hours, it might take a few days, but sooner or later they'd go.  With wpa-roam, one of them now has 60 days of uptime and is still reachable.  That setting was the only difference between the two configurations.
Logged

PrinterPrinter

  • World Citizen
  • ***
  • Posts: 204
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #13 on: September 09, 2015, 07:52:24 am »

Thank you,
I made those changes, looks like it's working a bit better - I guess time will tell.

Thank you!
Logged

PrinterPrinter

  • World Citizen
  • ***
  • Posts: 204
Re: JRemote and JRiver on Raspberry Pi - keep disconnecting
« Reply #14 on: September 17, 2015, 08:47:34 am »

Hello again,
I seem to have the sane problem and I suspect its the JRemote app on the iPhone... or perhaps the iPhone itself?

I once again have problems connecting to JRiver (running on RPI) via JRemote on iPhone6 - they are both in the same room and connected to the same wifi network - music keeps playing. I tried to connect quite a few times, including closing and reopening he JRemote app which often helps - with no success.

I then tried to open web remote on the iPhone (safari browser) and that too can't connect. I tried opening web remote form a mac book in the same room and here it works...

EDIT: I also tried opening VNV to the RPI via my phone and it couldn't connect whereas the Mac does manage to connect.
I tried connecting to other wifi networks and them to this again and still no contact...

Please share your thoughts, Thank you

I'm puzzled...
Logged
Pages: [1]   Go Up