Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-18 Thread Terry Coles
On Thursday, 18 February 2021 10:10:47 GMT Hamish McIntyre-Bhatty wrote: > I'm just finishing off my assignment, but should be able to look at > several WMT things this afternoon with luck. Hamish, I've just cracked the freezing problem, so you only need to look at the sockets error that I

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-18 Thread Terry Coles
On Thursday, 18 February 2021 10:10:47 GMT Hamish McIntyre-Bhatty wrote: > I'm just finishing off my assignment, but should be able to look at > several WMT things this afternoon with luck. That would be appreciated. -- Terry Coles -- Next meeting: Online, Jitsi,

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-18 Thread Hamish McIntyre-Bhatty
Yep, I saw it. I'm just finishing off my assignment, but should be able to look at several WMT things this afternoon with luck. Hamish On 18/02/2021 10:08, Terry Coles wrote: > On Thursday, 18 February 2021 09:48:20 GMT Hamish McIntyre-Bhatty wrote: >> Can't recall if you've tried this, but

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-18 Thread Terry Coles
On Thursday, 18 February 2021 09:48:20 GMT Hamish McIntyre-Bhatty wrote: > Can't recall if you've tried this, but what if you replace the call to > mpg123 with a call to echo or similar, just to narrow down whether it > might be mpg123 that's causing the issue. > > If it only crashes with mpg123,

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-18 Thread Terry Coles
On Wednesday, 17 February 2021 13:32:19 GMT Terry Coles wrote: > In any case, the Bells Pi code uses the same approach, so how come that > works and the Music code doesn't? I think I've sussed this. :-) At least I think I know what is going wrong. In order to respond to commands coming in from

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-18 Thread Hamish McIntyre-Bhatty
Hi Terry, Can't recall if you've tried this, but what if you replace the call to mpg123 with a call to echo or similar, just to narrow down whether it might be mpg123 that's causing the issue. If it only crashes with mpg123, perhaps there are some verbose or debug flags you can use for mpg123 to

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-17 Thread Terry Coles
On Tuesday, 16 February 2021 15:25:28 GMT Terry Coles wrote: > So I'm kind of back where I started. This morning I tried a variety of things to solve this; still to no avail. I've attached two more code fragments to this message; these are copied from the latest version of the software on the

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-16 Thread Terry Coles
On Tuesday, 16 February 2021 13:54:55 GMT Terry Coles wrote: > I've just spotted a difference between the code used by the Change Rings > Player on the Bells Pi and the code used by Music Player on the Music Pi. > I'm hopeful that this will be the problem. Well it looked useful, but made no

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-16 Thread Terry Coles
On Tuesday, 16 February 2021 12:33:45 GMT Terry Coles wrote: > I'm going to do a bit more testing after lunch. I've just spotted a difference between the code used by the Change Rings Player on the Bells Pi and the code used by Music Player on the Music Pi. I'm hopeful that this will be the

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-16 Thread Terry Coles
On Tuesday, 16 February 2021 12:25:10 GMT Hamish McIntyre-Bhatty wrote: > If I find some time, I'll look into this for you, but I figure the issue > you posted on the forum is higher priority? Probably not in fact. I only posted that there because it related to the sockets code and you wrote

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-16 Thread Hamish McIntyre-Bhatty
On 16/02/2021 12:15, Terry Coles wrote: > On Tuesday, 16 February 2021 12:03:28 GMT Hamish McIntyre-Bhatty wrote: >> Well I must say, I'm not that familiar with apscheduler, but it looks to >> me as if it's causing more issues and complexity than threading would, >> at least in some cases. >> >> I

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-16 Thread Terry Coles
On Tuesday, 16 February 2021 12:03:28 GMT Hamish McIntyre-Bhatty wrote: > Well I must say, I'm not that familiar with apscheduler, but it looks to > me as if it's causing more issues and complexity than threading would, > at least in some cases. > > I also don't think it exactly avoid threading,

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-16 Thread Hamish McIntyre-Bhatty
On 16/02/2021 11:59, Terry Coles wrote: > On Tuesday, 16 February 2021 10:50:59 GMT Terry Coles wrote: >> If anyone wants to look at the full package the code is on our GitLab >> Repository at: >> >> https://gitlab.com/wmtprojectsteam/minster_bells_re-engineering > BTW. I've now realised that I

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-16 Thread Terry Coles
On Tuesday, 16 February 2021 10:50:59 GMT Terry Coles wrote: > If anyone wants to look at the full package the code is on our GitLab > Repository at: > > https://gitlab.com/wmtprojectsteam/minster_bells_re-engineering BTW. I've now realised that I introduced (yet another) bug when I did the

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-16 Thread Terry Coles
On Monday, 15 February 2021 19:55:25 GMT Patrick Wigmore wrote: > On Mon, 15 Feb 2021 17:13:12 +, Terry Coles wrote: > > When the button is pressed, the Webserver generates a message > > > > which it sends to the Music program. There is a cron job, triggerd > > by apscheduler which parses

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-15 Thread Patrick Wigmore
On Mon, 15 Feb 2021 17:13:12 +, Terry Coles wrote: > When the button is pressed, the Webserver generates a message > which it sends to the Music program. There is a cron job, triggerd > by apscheduler which parses the message and in this case calls the > next_playlist() function. Ah, I

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-15 Thread Terry Coles
On Monday, 15 February 2021 17:06:07 GMT Patrick Wigmore wrote: > I'm left wondering: > "Where are you calling next_playlist()?" > "What do you mean by 'freezes'?" That is triggered by another button on the Webserver Control page. > If you are calling next_playlist from an interrupt handler and

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-15 Thread Patrick Wigmore
On Mon, 15 Feb 2021 15:02:23 +, Terry Coles wrote: > I just realised that things aren't quite as I thought. If I start > the program with the Plylist Number set to zero, the Music Player > doesn't start, as is expected. If I then call next_playlist(): > > def next_playlist(): > global

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-15 Thread Terry Coles
On Monday, 15 February 2021 16:51:06 GMT Patrick Wigmore wrote: > mp3_player_start() contains a while loop, and it looks like that is > not supposed to terminate until playlist_index == 0. > > If your interrupt handler calls restartmp3(), and restartmp3() calls > mp3_player_start(), then the

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-15 Thread Patrick Wigmore
On Mon, 15 Feb 2021 12:53:24 +, Terry Coles wrote: > To me it seems that the software suddenly starts ignoring interrupts This makes me think the code that handled the previous interrupt might still be running. Having the previous interrupt handler still running is likely to block further

Re: [Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-15 Thread Terry Coles
On Monday, 15 February 2021 12:53:24 GMT Terry Coles wrote: > To me it seems that the software suddenly starts ignoring interrupts because > the command should be detected after no more than 1 second when apscheduler > calls the command checking function which works fine up to that point. I just

[Dorset] On Second Entry to MP3 Player Function Program Stops Responding to External Commands

2021-02-15 Thread Terry Coles
Hi (Again), I'm inching towards squashing the (known) bugs in my Music Player and Bells software. By and large the Flask code is doing exactly what it should do and displays the current status of the two programs and also sends the correct commands to them when the control buttons are