On Monday, 15 February 2021 19:55:25 GMT Patrick Wigmore wrote:
> On Mon, 15 Feb 2021 17:13:12 +0000, 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 think that changes things. Triggering a cron job is going to
> have an effect similar to starting a new thread. (Indeed, that might
> be precisely why you are using a cron job.) In which case, my
> hypothesis could well be completely wrong.

Well.  This morning I rewrote the startup code so that mp3_player_start() 
would always be started the same way, ie via apscheduler.  First, I modified 
the startup code to ensure that whether the program was started inside Opening 
Hours or outside apscheduler would always be the calling function.  This 
worked perfectly but the problem still exists.

I have posted a screenshot of the three consoles that show whats going on at:


The large pane on the left hand side shows the program minstermusic.py 
executing and top right shows the Webserver output.  Bottom right is the 
minsterbells.py execution which isn't really relevant to this, but it does 
show several messages being exchanged successfully.

The point is that everything proceeds fine until I press the 'Start Music 
Button'.  This message is sent using sockets code and is successfully received 
by the Music program (this is flagged about half-way down) and the commend is 
enacted.  The Webserver then asks the Music Player for a Status update (the 
last message in its pane), but the player does nothing.  The only way out is 
to Ctrl-C.

Has anyone got any other thoughts?

If anyone wants to look at the full package the code is on our GitLab 
Repository at:



                Terry Coles

  Next meeting: Online, Jitsi, Tuesday, 2021-03-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to