Wotchya, Mark.
mark-me wrote:I had fun reading it.
Jolly good.
Perhaps it'd be a good idea to have a "system info" screen with IP address and such like on it.
It is. I'll add it in a next iteration
Thank you, kind sir.
But when I build my box (I hope the carpenter is finishing the basics soon) I will take it off again. The buttons are flimsy and they would screw up the design of my box.
Take it off? Is there a downside that I'm not seeing, here?
I'll take a look; it *ages* since I did any serious soldering. (I gave up when everyfink seemed to be going SMD...)
This isn't *entirely* consistent but I'm keeping an Eye on things to see if I can narrow the problem down a bit.
I have no idea why PiJ went comatose or why it it didn't react anymore. A KWORKER thread is system related... weird... Let me know what you find.
This problem is getting quite common.
After faffing with the RPi, Sonata and GMPC when PiJ was "sleeping", PiJ crashed with this output:
Traceback (most recent call last):
File "pi-jukebox.py", line 89, in <module>
main()
File "pi-jukebox.py", line 79, in main
screens.process_mouse_event(event) # Handle mouse related events
File "/home/pi/Pi-Jukebox/gui_screens.py", line 217, in process_mouse_event
ret_value = self.screen_list[self.current_index].on_click(x, y) # Relay tap/click to active screen
File "/home/pi/Pi-Jukebox/screen_player.py", line 253, in on_click
mpd.player_control_set('pause')
File "/home/pi/Pi-Jukebox/mpd_client.py", line 329, in player_control_set
self.mpd_client.pause(1)
File "/home/pi/Pi-Jukebox/mpd.py", line 600, in decorator
return wrapper(self, name, args, bound_decorator(self, returnValue))
File "/home/pi/Pi-Jukebox/mpd.py", line 236, in _execute
self._write_command(command, args)
File "/home/pi/Pi-Jukebox/mpd.py", line 263, in _write_command
self._write_line(" ".join(parts))
File "/home/pi/Pi-Jukebox/mpd.py", line 242, in _write_line
self._wfile.write("%s\n" % line)
File "/home/pi/Pi-Jukebox/mpd.py", line 75, in _dummy
raise ConnectionError("Not connected")
mpd.ConnectionError: Not connected
I'm wondering - especially in view of the (apparant) involvement of a kernel thread - whether the problem is the connection between PiJ and MPD. Perhaps, for some reason, the connection is broken and PiJ is waiting for a response that'll never come. How do you handle sending commands to MPD? Is it merely a case of assembling the buffer and blocking on a function call that spits it out of the appropriate socket? (The PiJ screen doesn't update when it's asleep even though one can, for example, load a different playlist and start playing the songs via another MPD client. This leads me to suspect a blocked socket call.)
On the library screen, would it be possible to *sort* them? It looks a bit strange when they come up (apparantly) unsorted.
What isn't sorted? With me everything is sorted. I will add a sort in the code as well to make sure it is returned sorted with your collection as well.
Well, that *is* weird. My lists - at least the artists, albums, tracks and playlists are definitely *not* sorted. I wonder why *yours* are? (My version of Python is 2.7.3, by the way.)
Any chance of adding a "reboot" option to the "Quit" screen?
Didn't think of that. Will do.
In case you're wondering why I'd like this, I sometimes forget to connect the two disjoint parts of my network before turning on the PiJ's RPi. As a result, it doesn't mount the remote music directory and, hence, can't play any music ('cept IR stations, p'raps). A quick reboot (after turning on the network "valve") is the simplest cure for this.
I suppose what I really need is a script that keeps trying to mount the music if it's not already mounted.
Perhaps something like the Android "Back" icon in, say, the top, right-corner would be a good idea.
A button in the top left corner would look ugly as hell....
Um, *right*-hand corner was what I thought'd do the trick.
PiJ doesn't appear to allow uppercase in the station names...
In this evenings upload it will play nice with your case of cases.
Thanks. (You can call me a "fussy bugger" if you like.

)
I find entering data on the LCD screen a bit of a pain in the bottom and, if IR stations were in "normal" playlists, I could enter them using a third-party MPD client.
I'm not quite sure what you mean by this. I understand entering the URL's is a pain, but you could SSH into the raspberry and use nano to add stations? Afterwards is just a question of selecting stations.
I find it difficult entering text on the RPi's screen - I must be gettin' old - but, really, it's more to do with the fact that I see no reason to treat IR stations any different to "normal" music. Other than doing the Right Thing if the track starts "http://", I can't really see the need to distinguish it from any ol' bog-standard track. At least, that's what *our* music server did.
With *our* system, the hardest thing to do was to get the *right* URI in the first place. Our system didn't cope with file (or rather, connection and bad URI) errors as well as MPD...
My preferred method was to use a web browser to gather URI candidates and then to try them in LinkyPLAY to see if it actually *worked*.
As you say, I could also "cheat" and SSH the text into PiJ's config or playlist files. (O'course, I've already been *doin'* that - that's how I knew that upper-case didn't work.)
If you need to distinguish IR stations from "normal" tracks, you could put something "special" into an .M3U comment line. (I think that the "#container" line in that example .M3U file that I gave in a previous post was LinkyPLAY-specific.)
I think the last interation gave form to the idea I had. Let me know whether you like it.
Yeah, well... I find it a *bit* strange that if I'm playing an IR station, the "current playlist" still shows the last "real" music loaded.
Here's a question for you: how do *you* find (and vet) URIs for IR stations?
I'm *very* tempted to add some MPD emulation code into our ancient LinkyPLAY music server simply because it'd be so damned convenient to control it from a 'phone.
I already do this. But why I did this project is because I didn't always want to reach for my phone, or maybe I don't always have wifi available. This is where I thought that Pi-Jukebox would come in.
One thing that *our* music clients had was remote controls. The WMA11Bs were designed to be connected to TV sets; we re-wrote the client-side software so that it was usable with just audio output. (Including the facility to *speak* the time when a button was pressed.

)
Hmmmm. I have a spare HAMA remote control. P'raps I should see if I can get it to work with PiJ...
But why would I bother using a web interface if I can use my phone or Pi-Jukebox?
Indeed. O'course, when we developed our system, smart phones were relatively new. (I used an "HTC Universal" AKA "Orange SPV M5000". Ah, *those* were the days...)
I have some further items for you:
[a] Try this: load an album from the list and select the "Songs Of" option. I frequently find that the screen is blank and tapping on it will cause a crash. I can't *guarantee* it, but I *think* that this is the corresponding debug output:
Traceback (most recent call last):
File "pi-jukebox.py", line 89, in <module>
main()
File "pi-jukebox.py", line 79, in main
screens.process_mouse_event(event) # Handle mouse related events
File "/home/pi/Pi-Jukebox/gui_screens.py", line 217, in process_mouse_event
ret_value = self.screen_list[self.current_index].on_click(x, y) # Relay tap/click to active screen
File "/home/pi/Pi-Jukebox/screen_player.py", line 157, in on_click
mpd.play_playlist_item(selected_index + 1)
File "/home/pi/Pi-Jukebox/mpd_client.py", line 349, in play_playlist_item
self.mpd_client.play(index - 1)
File "/home/pi/Pi-Jukebox/mpd.py", line 600, in decorator
return wrapper(self, name, args, bound_decorator(self, returnValue))
File "/home/pi/Pi-Jukebox/mpd.py", line 238, in _execute
return retval()
File "/home/pi/Pi-Jukebox/mpd.py", line 595, in decorator
return function(self, *args, **kwargs)
File "/home/pi/Pi-Jukebox/mpd.py", line 363, in _fetch_nothing
line = self._read_line()
File "/home/pi/Pi-Jukebox/mpd.py", line 275, in _read_line
raise CommandError(error)
mpd.CommandError: [2@0] {play} Bad song index
I've discovered that the screen isn't *empty*; it's merely that PiJ is displaying a page off of the *end* of the list. Scrolling up shows the correct output.
While playing around with IR stations, I managed to get PiJ to generate this while it was starting up. I had to change the playlist via another MPD client before PiJ would start up again:
Traceback (most recent call last):
File "pi-jukebox.py", line 89, in <module>
main()
File "pi-jukebox.py", line 64, in main
if not mpd.connect():
File "/home/pi/Pi-Jukebox/mpd_client.py", line 187, in connect
self.__starts_with_radio()
File "/home/pi/Pi-Jukebox/mpd_client.py", line 194, in __starts_with_radio
now_playing.now_playing_set(self.mpd_client.currentsong()) # Get currenly plating info
File "/home/pi/Pi-Jukebox/mpd_client.py", line 47, in now_playing_set
self.track_file = now_playing['file']
KeyError: 'file'
OK, that's enough waffle from me.
Bye fer now.
Regards,
Mark.