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 thi

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 i

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 pl

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 inter

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 in

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 r

[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 pressed.