[Dorset] Next Meeting - One Week Tonight

2016-06-28 Thread Terry Coles
Hi,

The next meeting is just one week tonight: 8 pm at The Broadway in Bournemouth 
on 
Tuesday, 2016-07-05.

See:  http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway[1] 

See you there!

Chris,

My turn to drive.  Can you confirm?  I've just spoken to Paul and he's going.

-- 



Terry Coles


[1] http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway
-- 
Next meeting:  Bournemouth, Tuesday, 2016-07-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Kaffeine problems.

2016-07-07 Thread Terry Coles
On Thursday, 7 July 2016 14:06:45 BST Peter Merchant wrote:
> I have had a couple of sessions of upgrades to keep my system
> 'up-to-date' since I last ran Kaffeine. I glanced at the list and I
> believe saw something possibly related. Where do I find the logs of
> these updates?

Open the Update Manager, then click on More..., Advanced, History.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-08-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Alternative fonts

2016-07-09 Thread Terry Coles
On Saturday, 9 July 2016 13:27:16 BST Ralph Corderoy wrote:
> Old English

Except that the Goths were a Germanic tribe, not Old English :-)

See https://en.wikipedia.org/wiki/Gothic[1] 

Clive hasn't shown us an example of the 'Old English' that he needs, but 
looking at the 
examples on the Internet it looks like whoever named it had no idea that the 
font that he 
had created looks like the one everyone else calls Gothic and therefore hardly 
English.

-- 



    Terry Coles


[1] https://en.wikipedia.org/wiki/Gothic
-- 
Next meeting:  Bournemouth, Tuesday, 2016-08-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Alternative fonts

2016-07-09 Thread Terry Coles
Dowh!  I got the quoting wrong ;-(

On Saturday, 9 July 2016 13:27:16 BST Ralph Corderoy wrote:
> "Gothic" is another common description of this style to help your
> search.  https://en.wikipedia.org/wiki/Gothic_font

Except that the Goths were a Germanic tribe, not Old English 

See https://en.wikipedia.org/wiki/Gothic[1] 

Clive hasn't shown us an example of the 'Old English' that he needs, but 
looking at the 
examples on the Internet it looks like whoever named it had no idea that the 
font that he 
had created looks like the one everyone else calls Gothic and therefore hardly 
English.


-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-08-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Help Needed: Can anyone with a Windows Phone or an older iPhone or iPad test this link?

2016-08-07 Thread Terry Coles
On Saturday, 6 August 2016 19:59:47 BST Patrick Wigmore wrote:
> On Saturday 06 Aug 2016, at 18:45:45, Terry Coles wrote:
> > ...what I need to know is can people play the samples on the
> > page below with a Windows Phone or older iPhone or iPad?
> 
> I tried the page in Safari on my university-issued iPad Mini,

Thanks.

> I am not sure whether it counts as an old iPad. The hardware is
> getting on a bit, but the software is up to date.

Yes, I guess what I really need is testing by someone who has an old 'i' or 
Windows device which is no longer kept up to date by the vendor.

> The MP3 and WAV versions work. The OGG version does not.
> 
> The MP3 version appeared to load entirely as soon as the page was
> viewed. It played back with no noticeable delay after pressing
> play.

That's what I expected.

> The WAV version appeared not to load onto the device at all until
> I had pressed play. It also played back with no noticeable delay
> after pressing play, while the rest of the file loaded in the
> background, which took about a second on my WiFi/ADSL connection.

That surprises me a bit, but if Safari is capable of playing the file while it 
is still loading, I guess it make no difference to the user.
 
> If nobody on this list has a suitable device, perhaps you or
> someone else could take advantage of the Open Device Lab
> Bournemouth to do this sort of testing.
> https://odl.wearebase.com/

That looks like a useful place.  I may pop along and have a look at it 
sometime, possibly when we have a prototype ready.

Thanks again.

Any other people out there with 'i' or Windows Mobile / Phone devices?   (I 
suppose I'm a bit optimistic asking for Windows stuff on a Linux List   )

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Help Needed: Can anyone with a Windows Phone or an older iPhone or iPad test this link?

2016-08-06 Thread Terry Coles
Hi,

Those who were at the Meeting last Tuesday will be aware that one of the 
projects for the Wimborne Model Town this winter is to develop an Audio guide 
for visitors to use on their phones and other mobile devices.  To avoid having 
to develop multiple apps for Android, iOS and Windows, we intend to serve up a 
web page from a local Wireless Access Point with the audio simply accessed via 
an  tag.

On Tuesday evening, some reservations were expressed about the codecs that 
would be compatible with the different OS types.

I've coded a very crude web page with a sample telling the History of the 
Model Town.  Ignore the level (which is a bit low at present) and my rubbish 
narration, what I need to know is can people play the samples on the page 
below with a Windows Phone or older iPhone or iPad?

Key information I need is:

1.  What works?

2.  If it doesn't work, what is the device and what is the codec?

3.  How long it takes for each sample to commence playing after the play 
button is pressed?

4.  Can you see the sample loading when you first visit the page?  (You might 
have to look out for this, because the device caches the audio.)

Samples are pre-loaded, so there shouldn't be an appreciable lag after all of 
the samples have arrived.  The .wav is the biggest file and I can visibly see 
it loading on my phone, especially when I'm in a low signal area (eg, not on 
Wi Fi).  However, as long as it loaded at all (sometimes it didn't), it 
doesn't take too long.

http://www.hadrian-way.co.uk/HTML5_Test/Audio_test.html[1] 

I've tested it with my desktop, my Nexus 5 Android phone, my laptop, my 
daughters (Android) phone and my Chromebook.  All three codecs work using 
Chromium and Firefox.  My daughter's partner also tested it on his newish 
iPhone and .ogg didn't work.  On a Windows 10 laptop, .ogg also failed.

What we would like to do is use .mp3, because, so far it has worked on 
everything and it is smaller than .wav.  However, if it turns out that Windows 
phone or old iOS devices won't load .mp3, then I'll have to provide .wav too.

As far as I'm aware, .mp3 has worked on Android for ever, but if anyone knows 
different..

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Help Needed: Can anyone with a Windows Phone or an older iPhone or iPad test this link?

2016-08-06 Thread Terry Coles
On Saturday, 6 August 2016 19:12:28 BST Ralph Corderoy wrote:
> I can't help with device testing, but peruse
> http://caniuse.com/#search=audio and you will see details of what
> browsers support the  tag, and what audio file formats are
> supported by different browsers.  The columns default to the mainstream,
> but "Show all" adds many more.  Don't know if they include the mobile
> ones you're interested in.  You can search for "ogg" too, as an example.

Thanks Ralph, I searched for 'What codecs can I play in an iPhone | Windows' 
phone and still didn't find that. 

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Help Needed: Can anyone with a Windows Phone or an older iPhone or iPad test this link?

2016-08-09 Thread Terry Coles
On Monday, 8 August 2016 23:37:23 BST you wrote:
> Hi The links work on my iphone which is running IOS 6.1.6 !

Thanks.  According to various sources iOS 6 was released in Sept 2012, with 
iOS 6.0.1 to 6.0.3 coming out in Nov to Dec.  I can't work out when iOS 6.0.6 
was released, but 6.1 was released early in 2013, so it looks like iPhones 
manufactured after mid 2012 will all work with an .mp3 file.

I suspect that in the phone market a four-year old phone is a rarity 
(especially iPhones which had batteries that couldn't easily be replaced), so 
we may be OK with any iOS phone that is likely to turn up.  Tablets may last 
longer though, so earlier reports would still be welcome.

I have now tested using an Asus Transformer running Ice Cream Sandwich, (circa 
Oct 2011), so I'm feeling fairly comfortable with Android devices too.

I still need information regarding Windows Phone/Mobile, if anyone has a 
device.



-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Next Meeting - One Week Tonight

2017-01-31 Thread Terry Coles
All,

The next meeting is one week tonight at The Broadway, Bournemouth on Tuesday, 
2017-01-07 at 20:00.  See:

http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway

Paul,

Are you going? 

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Next Meeting - One Week Tonight

2017-02-01 Thread Terry Coles
On Wednesday, 1 February 2017 12:32:15 GMT Ralph Corderoy wrote:
> Glad to hear work on the Wimborne Model Town time machine has continued
> apace.

Yes.  It has.  Where did you hear that?

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] SSID Hiding

2017-02-06 Thread Terry Coles
On Tuesday, 7 February 2017 07:47:19 GMT Patrick Wigmore wrote:
> MAC address filtering does not really add any security. Before it
> comes into play, the attacker still needs to crack your WPA2
> encryption. If that's within their capability, then they almost
> certainly know how to discover and spoof an authorised MAC
> address by eavesdropping on your network traffic.

A fair point. 

> Determining and spoofing the MAC address and SSID is totally
> feasible.

But probably not by an up and coming geek.  I live on the edge of Corfe 
Mullen, if there are any seasoned, skilled and determined hackers out there, 
then they'll probably get through anyway.

To a certain extent, I agree with you and Ralph on this; some of these 
measures are simply security theatre; the manufacturers want to be seen to be 
doing something.

However, my view is that by using belt, braces *and* safety pins, all but the 
most determined are likely to fall at one hurdle or another.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] SSID Hiding

2017-02-07 Thread Terry Coles
On Monday, 6 February 2017 16:19:26 GMT Terry Coles wrote:
> I have just installed a shiny new Netgear VSDL Router to replace the never
> updated Plusnet supplied one.
> 
> The main reasons that I bought it is that the Plusnet router has the above
> mentioned lack of security patches and the inability to filter on MAC
> Addresses or hide the SSID.

Thanks for all the comments on SSID hiding.  Overnight, my son had problems 
with a couple of Windows machines that he uses and during his researches he 
also discovered the issues with spoofing etc mentioned by Ralph et al.

As a result, I've now turned SSID hiding off.

I will be asking Netgear for their opinion, given the debate.

-- 



        Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] SSID Hiding

2017-02-06 Thread Terry Coles
Hi,

I have just installed a shiny new Netgear VSDL Router to replace the never 
updated Plusnet supplied one.

The main reasons that I bought it is that the Plusnet router has the above 
mentioned lack of security patches and the inability to filter on MAC Addresses 
or hide the SSID.

Having set the router up, I find that all of the devices in the house work 
fine, 
except an aging (but frequently used) Asus Transformer.  The wireless connects 
fine until I hide the SSID and then the Transformer reports that there is no 
Internet and there is no wireless symbol in the task bar.  A message then pops 
up stating that wireless networks are available, but needless to say, not my 
hidden ones.

Devices that work include two Android phones, a Chromebook, a Raspberry Pi, 
two Win 10 machines (an old MSI laptop and a new home-brewed gaming desktop), 
a Roku TV box, a Panasonic TV box, a YouView TV box and this Dell Optiplex 
running Kubuntu.

I'm assuming that the problem is the incredibly early version of Android on 
the Transformer, but has anyone got any other ideas?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-22 Thread Terry Coles
Hi,

My bells software for the Wimborne Model Town is getting close to fruition.  
With lots of 
help from you guys, I have been able to demonstrate the chimes ringing whilst 
at the 
same time playing music in another area of the Model.

Pretty much the last thing left to do is the User Interface.  This consists of 
a row of four 
SPDT (centre biased off) switches on the front of the control box which 
contains the Pi and 
other hardware; such as the audio amplifiers and MOSFETs to drive the Quarter 
Jack 
solenoids.

Each of these four switches is connected to a couple of GPIO pins configured as 
inputs.  
Using the information provided here:

http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio[1]
 

I have been able to set up eight event detectors of the form:

GPIO.add_event_detect(20, GPIO.RISING, callback=extended_hours_triggered, 
bouncetime=500)
GPIO.add_event_detect(21, GPIO.RISING, callback=extended_hours_disabled, 
bouncetime=500)

  and five more

GPIO.add_event_detect(27, GPIO.RISING, callback=wedding_sequence_disabled, 
bouncetime=500)

The idea is that when the user presses a switch down, the associated callback 
enables  the 
function by setting a global variable and calling the appropriate Procedure.  
Pressing the 
switch up unsets the var.  These functions do such things as provide an MP3 
player and 
fire off a wedding sequence of music and bells.  Earlier discussions have 
allowed me to 
ensure that these functions are in separate subprocesses and code within the 
Procedure 
that started the subprocess monitors the appropriate global so that the process 
can be 
terminated when necessary.

The above events work perfectly until the associated function has started, then 
switch 
toggling has no effect until the procedure has terminated.  Clearly the 
Procedures need to 
be themselves running in separate threads. 

Having looked at various sources, it would seem that multiprocessing rather 
than 
multithreading might be more appropriate, but I'm finding the documentation 
hard going 
and none of the examples that I've found seem to lend themselves to what I want 
to do.

Can anyone help?  I think that all that's needed is to get the Procedure 
defined in the 
callback to fire even when the MP3 player (say) is playing.  I'm fairly sure 
that the events 
are happening, it's what happens afterwards that seems to be the problem.

All contributions gratefully received, as always.

-- 



Terry Coles


[1] 
http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio
-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-20 Thread Terry Coles
On Monday, 20 February 2017 10:40:18 GMT Ralph Corderoy wrote:
> If Audio_Guide is hard to type that's because it's not the more normal
> audio-guide.  Terry, are you putting QR codes about for mobiles to open
> the URL?  You could have a Wimborne Minster tower.
> https://research.swtch.com/qart

Once the system is installed, no-one will need to type Audio_Guide, audio-
guide or even just Guide (or guide).  The function will be accessed from the 
top level menu.

I like the idea of using a QR code to open the URL, especially if it can be 
based on a picture of the Minster.  My original plan was to have the landing 
page automatically open when the user connects to the WiFi (rather like the 
cloud does in the pub).  If I can't work out how to do that (I haven't really 
looked at that bit yet), then a QR code would be a good alternative.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-20 Thread Terry Coles
On Sunday, 19 February 2017 21:55:52 GMT Ralph Corderoy wrote:
> AKA Apache does some brain-damaged DWIM that just digs a deeper hole
> when the magic isn't apparent.  :-)
> http://www.catb.org/jargon/html/D/DWIM.html

:-)

This comes under the heading of the road to good intentions

Presumably this was done to compensate for Windows users who don't see a 
difference between lc and uc chars in a filename.  The trouble is it hides 
errors that will bite the user in the b*m, ie me, when the code is ported to a 
different server.

I really thought that it couldn't be a simple as filenames, because it worked 
on my domain.

-- 



        Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-19 Thread Terry Coles
On Sunday, 19 February 2017 18:28:30 GMT Ralph Corderoy wrote:
> Have you found nginx's log files yet?  It will give you a clue whether
> the request for the MP3 is reaching it from the browser, and what it did
> in turn.

I did originally, but it didn't tell me anything useful, so I didn't look 
again until just now; the entry was Error 404 - File not found.

> I find I first get re-directed.
> 
> $ curl -sSI
> 'http://www.hadrian-way.co.uk/WMT/Guide/2)%20Gardens%20Area.mp3' HTTP/1.1
> 301 Moved Permanently
> Content-Type: text/html; charset=iso-8859-1
> Connection: keep-alive
> Keep-Alive: timeout=15
> Date: Sun, 19 Feb 2017 18:23:21 GMT
> Server: Apache
> Location: http://www.hadrian-way.co.uk/WMT/Guide/2)%20Gardens%20Area.MP3
> 
> And then told it's audio/mpeg.
> 
> $ curl -sSI
> 'http://www.hadrian-way.co.uk/WMT/Guide/2)%20Gardens%20Area.MP3' HTTP/1.1
> 200 OK
> Content-Type: audio/mpeg
> Content-Length: 768
> Connection: keep-alive
> Keep-Alive: timeout=15
> Date: Sun, 19 Feb 2017 18:23:39 GMT
> Server: Apache
> Last-Modified: Sun, 19 Feb 2017 12:21:56 GMT
> ETag: "32de88-548e1315f1ce6"
> Accept-Ranges: bytes

When I tried curl I suddenly got the clue; the filenames in my html are *.mp3 
and the actual filenames are *.MP3.  

I changed the filenames on the server to match the ones in the code and it 
works!

Presumably, Apache works some magic to ignore the case, whereas nginx doesn't.

Thanks for all the clues (which I didn't always get).

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-19 Thread Terry Coles
OK, I've fixed it, but I'm not sure why.  More about that later.

Replying to both Ralph and John:

===  Ralph ===
On Saturday, 18 February 2017 17:47:32 GMT Ralph Corderoy wrote:
> What's the user, group, and permissions on /var/www, e.g. `ls -ld
> /var/www'?

pi@raspberrypi:/var/www/html $ ls -ld
drwxr-xr-x 4 root root 4096 Feb 19 09:19 .
pi@raspberrypi:/var/www/html $ ls -la
total 20
drwxr-xr-x 4 root root 4096 Feb 19 09:19 .
drwxr-xr-x 3 root root 4096 Aug 10  2016 ..
drwxr-xr-x 2 root root 4096 Aug 18  2016 Guide
-rw-r--r-- 1 root root  867 Feb 19 09:19 index.html
drwxr-xr-x 2 root root 4096 Aug 18  2016 Quiz

These permissions are identical for the Pi 2 running the SD Card that worked 
in August and the Pi 3 running the latest Raspbian.  (Except, this gave me the 
clue, because the directory names were different on the two devices).

===  John  ==
On Saturday, 18 February 2017 18:00:25 GMT John Carlyle-Clarke wrote:
> Hi Terry. It's probably file permissions. Check what user the nginx server
> runs as, and make sure they have access to the files. They will need rx
> permission at least to every directory down to them from / as well, I
> believe.
> 
> To check, switch to root then do:

Why do I need to switch to root ?  The command below is prefixed with sudo.

>  sudo -i -u nginx
> 
> (Replace nginx with the actual user name)

The user is root.  Is that normal?

> Then make sure you can read one of the files.

Well the command put me into the root home directory, so I wasn't sure what 
this was doing.

===  The solution  ===

When I spotted that the the directory names were different on the two devices, 
I tried surfing to the correct one on the Pi 2; this worked (I had forgotten 
that I changed them when I moved to the Pi.  I then changed the directory 
names on the Pi 3 to match the Pi 2 and everything worked.

My recollection is that I only changed those names on the Pi (compared to the 
version on my server), to make typing easier, but clearly having the Directory 
names as Audio_Guide and Kiddies_Quiz instead of Guide and Quiz was what was 
needed.

Why would that be?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-19 Thread Terry Coles
On Sunday, 19 February 2017 10:52:37 GMT Ralph Corderoy wrote:
> > >  sudo -i -u nginx
> > > 
> > > (Replace nginx with the actual user name)
> > 
> > The user is root.  Is that normal?
> 
> No, the user isn't root.  The user and group on /var/www/html is
> root:root;  that's normal.  But Jon meant the user that nginx runs as
> when processing incoming HTTP requests, e.g. `www-data'.  This is done
> so an error in nginx, or in code you ask it to run, has limited access
> rights when it goes haywire, or is exploited by an attacker.

Hmm.  I think I understand.  I wouldn't have known how to identify the user 
that nginx runs as other than looking in top.  That said 'root'.

> > My recollection is that I only changed those names on the Pi (compared
> > to the version on my server), to make typing easier,
> 
> You are aware of Tab completion in the shell?  `cd Aud' completes
> to Audio_Guide.

:-)  Of course.  It wasn't in the shell that I was having difficulty; it was 
typing the full path into the browser on the phone.

(I'm just working on a landing page, with buttons to link to the underlying 
functions.)

> > but clearly having the Directory names as Audio_Guide and Kiddies_Quiz
> > instead of Guide and Quiz was what was needed.  Why would that be?
> 
> You earlier wrote:
> > The latest pages are working on my website at:
> > http://hadrian-way.co.uk/Audio_Guide/audio_guide.html
> > 
> > and
> > 
> > http://hadrian-way.co.uk/Kiddies_Quiz/index.html
> 
> nginx is taking the path part of the URL, from the `/' after the domain
> name to the optional query parameters starting with a `?', and trying to
> access that tacked on to /var/www/html.  If the URL's path is
> Audio_Guide then the directory has to match.  This is why I suggested a
> simple top-level now.txt as a known thing under /var/www/html.  Or am I
> misunderstanding the question?

To clarify; I can surf to the Audio Guide or the Kiddies Quiz, by typing in 
the links I gave you to my own webserver and it works.  On the Raspberry Pi 
they didn't, even when the code (meaning directory names) was identical to 
that on my domain.  When I shortened the directory names (and changed the 
Audio Guide html page to index.html), everything worked.

So the question is why is it OK on my website and not on the Pi?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-24 Thread Terry Coles
On Wednesday, 22 February 2017 17:49:08 GMT Ralph Corderoy wrote:
> > They seem to get variously called Procedures and Functions in my
> > 'Learning Python' Book (which doesn't cover multiprocessing).  I mean
> > a piece of code defined within a 'def' block.
> 
> The book's wrong.  :-)  In Python, they're functions, lower F.  Even a
> function without an explicit return statement still returns None whether
> the caller wants it or not.

Well to be fair, the book does mention in a couple of places that they are 
called functions and are similar to procedures in other languages, but then 
mentions procedures quite a few times in a fairly ambiguous way.  (I had to 
search through the eBook version to discover that statement BTW.)

> > Well the documentation for RPi.GPIO seems to consist only of the
> > Tutorials  on Alex Eames' website
> 
> I was looking at
> https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/
> Don't know if that's the same thing.  And then
> https://sourceforge.net/p/raspberry-gpio-python/code/ci/default/tree/source/
> event_gpio.c#l36

Those are one of several places that I looked.  What I haven't found is a 
definitive list of methods that RPi.GPIO supports.

> > def change_rings():   # Play a file of change rings
> > 
> > global chr_subdir
> > global chr_control
> > 
> > c_file = 'Wimborne_Minster_StedmanCinques_16-10-2016.mp3' # Change
> > rings.
> > c_path = os.path.join(chr_subdir, c_file)
> > blackhole = open(os.devnull, 'w')
> 
> I'd open this once as a global variable.  Python will garbage collect
> and close the file descriptors over time as all the references die out,
> but that's assuming they do die out.  If they don't, the process will
> use up ever more file descriptors and there's a couple of limits it
> could reach that would make open() fail.

This part has me somewhat confused.  When you say 'I'd open this once as a 
global variable', you surely don't mean the function?  How would you do that?

> > print 'Playing Changes - ', c_file, 'to the Tower'
> > c_player = subprocess.Popen(['mpg321', '-q', '-m', '-a', 'hw:0,0',
> > c_path],
> > 
> > stdin=subprocess.PIPE, stdout=blackhole, stderr=blackhole)
> > 
> > while chr_control:
> > c_player.poll()   # check to see if terminated
> > 
> > if c_player.returncode != None:
> > break
> > 
> > time.sleep(0.1)
> 
> Does this busy loop really need to exist?  Instead, change_rings() could
> just kick off the subprocess, stash the `c_player' somewhere, and then
> return.  Callbacks often do a small slice of work and then return,
> otherwise the `main loop' can't continue, as you've found.
> 
> The callback for the switch to nobble the bells can then terminate(),
> since it's OK to do that whether mpg321 has finished or not as long as
> the zombie child hasn't been reaped with poll().

I think I understand what you are suggesting here.  What I believe that you 
are saying is that c_player should be made into a global variable and the 
callback in the GPIO event should perform the terminate().  Is that what you 
were leading up to above?

Assuming this is possible, would it be something like:

GPIO.add_event_detect(20, GPIO.RISING, callback=c_player.terminate(), 
bouncetime=500)

Can that be done (or something like it)?

Assuming that it can, it still leaves me with some work left to do.  I picked 
the change_rings() function because it was one of the simplest, but maybe I 
should have been more explicit.  The are four functions that are controlled by 
the toggle switches on the front of the Control Box:

1.  Extended Hours Control - Change the 'Opening Hours' that determine when 
the hours, Quarter Jack chimes and other playing functions are allowed to 
sound.  This needs to set / unset a variable and play a short message to 
inform the user of the current state, eg 'Extended Hours Enabled'.  The 
variable is then used to inhibit playback outside opening hours.

2.  Change Rings Control - The simplest function.  It either plays the bells 
or it stops them.  No extra feedback needed for the user.  I could seen that 
your suggestion could work here.

3.  MP3  Control - The most complicated.  Depressing the switch increments a 
variable, plays a user message to indicate which Playlist is selected and then 
fires off the player whaich will then loop through the Playlist until stopped 
by an upwards click.

4.  Wedding Sequence - A kind of extended Change Rings, except that there are 
three tracks to play.

So you see, for most cases it isn't enough to simply kill the MP3 player.  
There are generally at least one other thing that needs doing; hence my query 
about threaded or mu

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-24 Thread Terry Coles
Ralph,

Quick initial response.  I'll be looking to implement this tomorrow.

In the meantime, I'll try to answer one or two of your queries and also ask a 
couple more of my own, so that I have a better understanding of what you've 
proposed.

Many thanks for all your hard work on this. 

On Friday, 24 February 2017 15:43:04 GMT Ralph Corderoy wrote:
> This looks like a good start.
> https://sourceforge.net/p/raspberry-gpio-python/code/ci/default/tree/source/
> py_gpio.c#l954 You can also call dir() on an object.

You do this every time :-)  I search the interwebs high and low and never find 
what I want and you come along with exactly what I needed.   :-)

> Yes.  I think you're familiar with co-operative multi-tasking?  You can
> imagine your Python program comprises the kernel that's passing control
> to a callback on the event, and the callback then runs for a little
> before co-operatively returning to give something else a chance.

> Taking them out of order...
> 
> > 2.  Change Rings Control - The simplest function.  It either plays the
> 
> bell_player = None
> 
> def start_bell_player(gpio):
> global bell_player

What is the 'gpio' in this and the other functions?  Also, what calls the 
function?  How do these functions tie in with the GPIO.add.event.detect 
statement.

Sorry to be a bit dense here, but I seem to have a missing link somewhere.

> What's the main bit of Python code do once it's registered the
> callbacks?  Just sit there somehow and let it all go on in the
> "background"?

The current version of the software (which works, but without any User 
Interface) simply sits around waiting for the apscheduler events to trigger 
the hours and quarters and, if I remove the comments, plays the Change Rings, 
MP3 playlist and Wedding Sequence one after the other (there's no loop in the 
MP3 Player function yet).

> You might want to consider playing a brief sound on every switch
> activation as user feedback to show the program's operating and seen the
> movement.  Two tones could match the up and down, on- and off-ness.  So
> stopping would terminate, then play the pong.  Starting would play the
> ping and then subprocess.Pipe to start the long-running mpg321.  Given
> the two audio channels, one could stress test by multiple hands flicking
> the switches about for a minute.

What we said we would do is to play a verbal message after most of the switch 
actuations, eg 'Extended Hours Enabled', 'Playlist One', 'Wedding Sequence 
Disabled', etc.

The users will not be able to read the labels on the switches easily, without 
actually getting inside the Minster Model, so they will be relying on counting 
the switches from one end.  This was to give them confidence that they had 
pressed the right switch and it had worked.

I may have more questions after I've had a chance to try all this ;-)

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-25 Thread Terry Coles
Ralph,

I'm still struggling a bit (well a lot actually ;-) ).  The problem is still 
how to get all the things done that I need to get done.

In this message, I'll try to answer some of your questions that I've failed to 
address and raise a few more for you.

On Friday, 24 February 2017 15:43:04 GMT Ralph Corderoy wrote:
> > The are four functions that are controlled by the toggle switches on
> > the front of the Control Box:
> And the switches can be held up or down and spring back to the centre
> "off" position.

Yes.

> def start_bell_player(gpio):
> global bell_player

I'm still unsure what the 'gpio' in the function call is for in your example.

> > There are generally at least one other thing that needs doing; hence
> > my query about threaded or multi-processed function calls.
> 
> Still don't think you need it.  The Pi GPIO library takes care of your
> second thread to call your registered event callbacks.  The subprocess
> module handles starting child processes running external programs.  You
> don't want any more parallelism that this else you have to worry about
> things happening at the same time and communicating between parts to
> stop it going wrong, e.g. a quick switch up then down could have two
> callbacks running at once as a race.

This is the key point I think.  Reading through the C code in the RPi.GPIO 
Library that you provided the link to yesterday, I can see the code to handle 
the callbacks, but my understanding of C is insufficient to inform me what is 
going on.

There are a number of references in the code to 'callbacks' (as opposed to 
'callback'), so I started off thinking that I could add multiple callbacks to 
the GPIO.add_event_detect() statement by listing them as you indicated for 
your example code in your later message that I reference below.  However, if 
this is the case, I can't work out how to do it and even if I could, it would 
probably still not help because the new code needs to run in a separate 
thread, not just the call to it.

On Saturday, 25 February 2017 00:10:59 GMT Ralph Corderoy wrote:
> Once everything is set up, your code has to pass control over to the
> library by calling its handle_events().  It then toils and calls back to
> your code if it so deigns.  This is the `inversion of control' compared
> to normal imperative programming.

So, I'm think that what you were leading up in your example to is some scheme 
whereby I set up and create an event handler similar to the one you created in 
this message.  This code is run before the GPIO.add_event_detect() statements 
and the callback in each of those statements references the appropriate 
function.  These functions are where I put my code to change the state of the 
global control flags, kill the mpg321 player and play the message to the user.

Is that what you had in mind?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-25 Thread Terry Coles
Cross-over :-)

On Saturday, 25 February 2017 14:37:53 GMT Ralph Corderoy wrote:
> > How do these functions tie in with the GPIO.add.event.detect
> > statement.  Also, what calls the function?
> 
> They are the callbacks registered using GPIO.add_event_detect().  They
> are called by the GPIO module when it learns an event has happened.  The
> module sets up a second thread, separate from the first where your main
> Python code is running, and it's that thread that waits for events and
> calls your callbacks.

Yes.  I understand that part.  This is the bit that works.

> > What is the 'gpio' in this and the other functions?
> 
> Like my other email with the callback example, the GPIO module passed in
> "event data" to the callback function when it calls it.  You've
> 
> GPIO.add_event_detect(20, GPIO.RISING, callback=foo, bouncetime=500)
> 
> def foo():
> 
> from your earlier emails, but I'd be surprised if that works because
> foo's expecting no arguments, but one, the `gpio', is going to be passed
> in.

Oh OK.  The example on Alex Eames website uses (channel).  I wasn't really 
sure what that was for either.  It works OK as long as the program isn't busy 
elsewhere.

> Ah, OK, so it's basically `sleeping' as far as the kernel is concerned.
> Is there any problem with the quarters playing in the middle of one of
> your other mpg321 playbacks so you need to step in and ensure it doesn't
> happen?

No I've proved that.  The chimes are fired off using subprocess.Popen() and so 
is the mp3 player, change rings etc.  It works well.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-25 Thread Terry Coles
On Saturday, 25 February 2017 14:56:53 GMT Ralph Corderoy wrote:
> Although your code now has two threads, your first initial main one, and
> the one GPIO creates once you start wanting it to watch for interrupt
> events, there's still Python's GIL, Global Interpreter Lock, and the
> second thread's C code has to aquire it before it can run the Python
> code of your callback function, and then release it.  Once released,
> Python code in your main thread, that was held up waiting for the lock,
> will continue.
> 
> Does that explain the `isn't busy' behaviour?

Yes.  And I kind of understood that.  I have read about the GIL without 
necessarily understanding it other than that it limits how many threads Python 
can manage at once.

It's one reason why I thought multiprocessing might be needed, because I 
understand that this gets over the problem with the GIL.
 
> Your callbacks will need a `gpio' or `channel' parameter else I'd expect
> an error when GPIO tries to call them.

I never tried it without one; if I copy code then I don't change anything that 
doesn't look as if it needs changing :-)

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-25 Thread Terry Coles
On Saturday, 25 February 2017 15:20:58 GMT Ralph Corderoy wrote:
> > I'm still struggling a bit (well a lot actually ;-) ).  The problem is
> > still how to get all the things done that I need to get done.
> 
> If you keep cycling back over the old emails as you learn more things,
> they may make more sense.  :-)

Oh they do.  It's just that my 66 year-old brain doesn't multi-task very well 
(it never did much) and my memory is not getting any better.  Add to that a 
very good long-term memory, a very poor short-term memory and a not too 
brilliant ability to sort out logic, you'll perhaps understand why I 
specialised in systems engineering and not programming :-)
 
> > it would probably still not help because the new code needs to run in
> > a separate thread, not just the call to it.
> 
> Don't know what `new code' is here.

I was meaning my functions to control the players.  ('New' was probably not 
the right description.)
 
> No, GPIO provides handle_events();  it was under the `Library code, used
> by everyone' comment.  You write a bunch of callbacks, register them
> all, and forget about it in that main thread, getting on with your timed
> chime playing.
> 
> You'll end up with this.
> 
> python-process
> │
> ├── python-main-thread
> │   │
> │   └─/─ quarters-process
> │
> └── python-gpio-thread
>   │
> ├─/─ bell-player-mpg321-process
> ├─/─ playlist-mpg321-process
> └─/─ wedding-sequence-mpg321-process

Light is beginning to dawn.  What you are saying is that everything except the 
code to time and ring the quarters (and the hours) will be registered as a 
callback; one callback for each thing that I want to do (eg play the change 
rings, stop them, setup the MP3 Playlist and play it, stop the player etc.

> A lot of your callbacks will use the subprocess module to run mpg321.
> These will again be new processes, just as quarters-process was.  Some
> will .call() it, waiting for it to finish, and others will .Popen()
> where you Python callback code continues to run without waiting for,
> say, bell-player-mpg321-process, to finish.  You callback will finish,
> having kicked off mpg321, and you'll return to the C code in
> python-gpio-thread that called you.  That will release Python's GIL and
> your Python code in python-main-thread is free to continue if it needs.

So the key thing that I need to keep in mind is that I cannot fire off a new 
block of code until the old one is finished and a new event from GPIO triggers 
a new callback.  This is going to take a bit of thinking about.  
Unfortunately, I'll have to sleep on it, because my daughter came to stay for 
the weekend this morning, so I'll not be able to dedicate as much time to it 
as I'd have liked.

I'll report back tomorrow with an update on what's working, (or not).

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-19 Thread Terry Coles
On Sunday, 19 February 2017 17:48:48 GMT Stephen Wolff wrote:
> might be mime types but i'd have thought nginx would have mp3s by default
> (if thats the audio file type)

They are all MP3s.  What should I be looking for?

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] nginx Setup / Configuration

2017-02-18 Thread Terry Coles
Hi,

Back in August we had some discussion about setting up a webserver to run in a 
walled 
garden (literally :-) ) at the Wimborne Model Town.  As a proof of concept, I 
created two 
simple pages (Audio Guide and Kiddies Quiz, see below) and put them onto a 
Raspberry Pi 
running nginx.  At the time they worked perfectly when I connected the Pi to a 
Wireless AP 
mounted on a pole in the corner of the site.  (I was able to use both functions 
from my 
phone.)

Since then, we've pretty much concentrated on the bells project and I've only 
picked this 
up again in the last few days.  The problem is, that I can't get access to the 
two pages 
anymore ;-(  I can connect to the nginx landing page at the root of the server, 
but anything 
else gives me an error 403 (do not have permission to view the page).

Quite a few things have changed since then and I confess that I never tested 
the original 
SD Card before I copied it and went through a full upgrade + installation of 
the code for 
the UPS Pico that we are using.

The problem seems to come down to the fact that I can no longer access the 
content that 
I've copied into the html directory at /var/www.  Worse, I've just plugged the 
original SD 
Card into my old Pi 2 (not the Pi 3 we are using for the WMT) and I'm getting 
the same 
problem.

The only other thing that has changed since then is the router (I'm not even 
trying to 
access the Pi from an independent AP yet), but since I can get to the nginx 
landing page, I 
can't see that that is relevant.

Any ideas what could be going on here?

The latest pages are working on my website at:

http://hadrian-way.co.uk/Audio_Guide/audio_guide.html

and

http://hadrian-way.co.uk/Kiddies_Quiz/index.html[1] 

-- 



Terry Coles


[1] http://hadrian-way.co.uk/Kiddies_Quiz/index.html
-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] SSH into Raspberry Pi Problems

2017-02-18 Thread Terry Coles
On Saturday, 18 February 2017 10:09:42 GMT PeterM wrote:
> For the last little while, I have not been able to access my R-Pi
> software after creating new SD cards. I thought it was something that I
> have done wrong.
> 
> Now I find out it isn't
> 
> www.raspberrypi.org/documentation/remote-access/ssh/
> 
> 
> 3. ENABLE SSH
> 
> As of the November 2016 release, Raspbian has the SSH server disabled by
> default. You will have to enable it manually. This is done
> usingraspi-config
> <https://www.raspberrypi.org/documentation/configuration/raspi-config.md>:
> 
> There is a workaround apparently.
> 
> For headless setup, SSH can be enabled by placing a file named 'ssh',
> without any extension, onto the boot partition of the SD card.
> 
> 
> Because I don't have another means of connecting to my R-Pi.
> 
> *Bah*

Peter,

The change was not unreasonable, because the device was wide open otherwise, 
with SSH on by default, with login to a default username and password.

Do you really not have any means to access the Pi other than SSH?  I bought a 
cheap HDMI to VGA adapter off amazon and an almost equally cheap mouse and 
keyboard.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] nginx Setup / Configuration

2017-02-18 Thread Terry Coles
On Saturday, 18 February 2017 17:47:32 GMT Ralph Corderoy wrote:
Ralph,

I've got a few things to do tonight, so won't get onto this until tomorrow.  
In the meantime:

> Does your nginx set-up have /etc/nginx/sites-{available,enabled}?  Are
> symlinks in the latter pointing at configuration files in the former?
> Might just be `default' unless you've added others.

Just the default is enabled.  I think that is needed to get the nginx landing 
page to work anyway.

> What's the user, group, and permissions on /var/www, e.g. `ls -ld
> /var/www'?

The content is in /var/www/html.  Is it the permissions of that directory or 
the higher one?

> Create a simple file in there.
> 
> sudo sh -c 'date >/var/www/now.txt'
> sudo chmod 444 /var/www/now.txt

Again.  Should this be in /var/www/html?

> And then attempt to fetch that with curl(1) so the complicted browser
> isn't involved.  What `hostname' are you using in the URL?
> 
> curl -sS http://127.1/now.txt   # On the Pi.
> curl -sS http://FIXME/now.txt   # Elsewhere.

I'll report back tomorrow.

Thanks.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-22 Thread Terry Coles
On Wednesday, 22 February 2017 15:10:21 GMT Terry Coles wrote:
> while chr_control:
> c_player.poll() # check to see if terminated
> if c_player.returncode != None:
> break
> time.sleep(0.1)
> 
> if c_player.returncode == None or chr_control == 0:   # kill the
> player if it's still running
> c_player.terminate()
> c_player.wait()

I just noticed a bug in that bit of code.   The var chr_control was originally 
an int, but it made sense to change it to a boolean, so the test in the final 
if should be checking for False, not 0.

Of course, I haven't been able to test that bit of code yet, (I needed the 
switches to be working), so there could well be other bugs :-)

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-02-22 Thread Terry Coles
On Wednesday, 22 February 2017 18:54:34 GMT Ralph Corderoy wrote:
> There's at least three other experienced Python programmers on the list
> so they can pipe up if they disagree, but it's idiomatic to test for
> `truthness' rather than absolute values.
> 
> Python defines truth very consistently.  (Unlike PHP.)
> https://docs.python.org/2/library/stdtypes.html#truth-value-testing
> 
> So it's written `if foo' rather than `if foo == True', and `if not foo'
> for the opposite.  After all, your `foo == True' is itself an expression
> that is True or False so needs testing again: `foo == True == True'.
> And so's that...

That's what I intended to do, once I had defined the var as boolean.

> It follows that the choice of identifier makes it read well with the
> right meaning.  `if ringing_changes' perhaps, I don't know the subject.

The var is intended to mean 'change rings control'.  I have added a comment in 
the code to that effect.

> It doesn't have to be a Boolean to do this.  If `child' is an int that's
> either 0 when there's no child yet, or its PID when there is, then the
> test is `if child' rather than `if child != 0'.  It reads more simply
> too.

Now that I wasn't sure of, so I was sticking to making use of the boolean 
form.  I think that I still will in the interests of clarity for future 
'makers' who might take over the maintenance of this system.  I feel that the 
meaning is much more obvious if the var is declared as a boolean than as a 
simple int, unless you have a background in CS.

Bearing in mind the situation here, my view is that if I'm not sure of the 
meaning of something in the code, then there will be others who will have 
similar problems; particularly since they won't necessarily know what I'm 
trying to do.  Of course, I appreciate that this code is not Python 101 
anymore; as mentioned earlier, my 'Learning Python' book (1540pp) doesn't even 
cover multi-processing and multi-threading, so I guess that this point will be 
pretty moot if they have a similar background to me :-) 

I'm still working my way through the rest of your message and the earlier one, 
but I have other stuff to do elsewhere today, so I may not get round to trying 
out your suggestions until tomorrow.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Another question about using apscheduler in Python?

2016-08-21 Thread Terry Coles
On Sunday, 21 August 2016 17:10:32 BST Ralph Corderoy wrote:
> Try
> 
> sched.add_cron_job(hours, args=('1',))
> 
> And look for `args' and `kwargs' in the documentation for the add*
> functions you're using.  It's a Python convention, but not part of the
> language;  apscheduler will have explicit code to stash away the tuple
> or list you pass as the `args' named parameter and to retrieve it later
> to pass to your function.

Thanks.  I'll have a look at that tomorrow; there's no rush, we've got until 
next April :-)  I've just been trying to find out what's possible.

On the piCore forum, the guys were trying to get me to use asyncio, instead of 
apscheduler, but I found a total lack of suitable examples and I got the 
impression that it wasn't really intended for what I wanted to do; it just was 
possible.  (I also found the documentation totally incomprehensible to my 
hardware oriented brain.)  Anyway, one of the guys there is now looking into 
adding apscheduler as a piCore extension.  If it proves difficult, I might 
still 
have to look into using asyncio, but all these stumbling blocks will still 
help me avoid the same problems later.

BTW, pylint is extremely useful and does a far better job of checking for 
errors than Idle.  Most important of all is that it doesn't stop when it hits 
the first error.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Another question about using apscheduler in Python?

2016-08-21 Thread Terry Coles
On Sunday, 21 August 2016 18:13:14 BST Peter Merchant wrote:
> What book do you have? I have two free ebooks on it byteofpython,
> http://python.swaroopch.com/ and diveintopython.
> http://www.diveintopython.net/

I paid for mine :-)

I have Learning Python ( http://shop.oreilly.com/product/0636920028154.do[1] ) 
in 
paper and ebook versions.

-- 



        Terry Coles


[1] http://shop.oreilly.com/product/0636920028154.do
-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Can anyone help with using apscheduler in Python?

2016-08-21 Thread Terry Coles
Hi,

Most of you are aware by now that Clive and I have a project to bring the 
bells back to the Wimborne Model Town Minster.  I've been experimenting with 
using apscheduler and mpg321 in Python to realise this.  It's pretty crude at 
the moment, but if I run two separate programs (the bells and the schedule) 
both parts work.

Taking mpg321 first; this code works perfectly:

#!/usr/bin/env python
from time import sleep
import os, random

try:
while True:
os.system('mpg321 -g 100 -q ./mp3/amersham.mp3')
sleep(1);

os.system('mpg321 -g 100 -q ./mp3/nottingham_smv.mp3')
sleep(1);

os.system('mpg321 -g 20 -q ./mp3/peterboro.mp3')
sleep(1);

finally:
sleep(1)

Also, here is a fragment of my (separate) scheduling program, without the 
bells:

#!/usr/bin/env python2.7
import datetime
import time
from apscheduler.scheduler import Scheduler

# Start the scheduler
sched = Scheduler()
sched.daemonic = False
sched.start()

def one_oclock():
print("One O'clock")
print(datetime.datetime.now())
time.sleep(1)

# Schedule functions to be run 
sched.add_cron_job(one_oclock,  hour='1')

So far so good.  However, when I combine the two and add the system call to 
mpg321 after the sleep into my functions, eg:

def one_oclock():
print("One O'clock")
print(datetime.datetime.now())
time.sleep(120)
os.system('mpg321 -g 20 -q ./mp3/Wedding_March.mp3')
time.sleep(300)
os.system('mpg321 -g 100 -q ./mp3/amersham.mp3')

I get:

Python 2.7.12 (default, Jul  1 2016, 15:12:24) 
[GCC 5.4.0 20160609] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: /home/terry/Development/Wimborne_Model_Town/Winter_2016-17_Projects/
Code/Minster_Bells/Scheduler_V2.py 
>>> 
2016-08-21 15:15:00.006585
No handlers could be found for logger "apscheduler.scheduler"

The debugger doesn't really help, so how can I find out what I'm doing wrong?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Can anyone help with using apscheduler in Python?

2016-08-21 Thread Terry Coles
On Sunday, 21 August 2016 15:53:47 BST Terry Coles wrote:
> > Add `import logging' to your other imports, and then immediately after
> > try `logging.basicConfig()'.
> 
> I've done that and am currently waiting for the next schedule job to occur
> (1600).  Where should I expect the logger to write its output?

Answering myself; it wrote to the shell :-)

The problem was that I'd forgotten to import os ;-)

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Can anyone help with using apscheduler in Python?

2016-08-21 Thread Terry Coles
On Sunday, 21 August 2016 16:23:13 BST Ralph Corderoy wrote:
> Going back to your first mail, there's three ways of running it.
> 
> > #!/usr/bin/env python
> 
> ...
> 
> > #!/usr/bin/env python2.7
> 
> ...
> 
> > Python 2.7.12 (default, Jul  1 2016, 15:12:24)
> 
> For the first, env(1) will be using PATH at the time it's run, e.g. by
> cron(8), to find `python', and that might be a 2 or 3 depending on the
> system.  If you know you demand one or the other, e.g. because your code
> is incompatible with 3, then it's better to state it, like in the second
> `#!'.

I see what you mean now.  I would normally define the version, such as in the 
second 
example.  It's just that for these quick and dirty code fragments, I grabbed 
examples off 
the internet and simply ran them to see what would happen; forgetting the 
shebang.

> What was the third?  Is that the output when you run a script under the
> debugger?  (I don't use them much myself.)

Almost; it's the output in the Python Shell.
 
> > The problem was that I'd forgotten to import os ;-)
> 
> Thought it might be.  :-)

> python lacks a `check syntax, but don't run' option.  You can detect
> simple syntax errors before waiting for the next hour to tick around
> with

IDLE has a syntax checker, but IDLE 2 is much more forgiving than Idle 3.  
I tried syntax checking the code in Idle 3, but there is no apscheduler module 
for Python 3, 
so all I got was the 'no module' error.

> python -c 'f = "foo.py"; compile(open(f).read(), f, "exec")'
> 
> And for something to check the semantics, there's
> 
> $ pylint -E foo.py
> No config file found, using default configuration
> * Module foo
> E:  1, 0: Undefined variable 'os' (undefined-variable)
> $
> 
> This kind of thing can be part of your `check' target in your
> ./makefile.  :-)

I will be compiling the finished item so that I can run it efficiently in 
piCore on the Pi Zero, 
but I never thought of compiling it to check the error.

Thanks for your help.  I have another question, but I'll start a new thread ;)

-- 



Terry Coles
-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Another question about using apscheduler in Python?

2016-08-21 Thread Terry Coles
OK.  So now my code runs, but it isn't very efficient.  Currently I have one of 
these for every hour and every quarter throughout the day:

def one_oclock():
print("One O'clock")
print(datetime.datetime.now())
time.sleep(120)
os.system('mpg321 -g 20 -q ./mp3/Wedding_March.mp3')
time.sleep(300)
os.system('mpg321 -g 100 -q ./mp3/amersham.mp3')

The reason is that I couldn't work out how to pass arguments in the call in 
the list of scheduled functions to be run:

sched.add_cron_job(one_oclock,  hour='1')

I think I'll still need an entry in the schedule for each event, but I feel I 
ought to be able to create a single function for hours and another for 
quarters and get the calling cron_job to pass the hour or minute into it.  I 
tried:

sched.add_cron_job(hours(1),  hour='1')

with the function redefined as:

def hours(hour):
print(hour + "O'clock")


Unfortunately, when I tried it I got run-time errors because of argument 
mismatches (I tried (1) and ('One').  I couldn't see an example in my Python 
book, so kind of ran out of ideas.

Does anyone know what will work?

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Next Meeting - One Week Tonight

2017-02-28 Thread Terry Coles
Hi,

The next meeting is just one week away at the Broadway, Bournemouth on Tuesday 
evening at 20:00; 2017-03-07.  See:

http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway[1] 

Paul,

Are you going?  It's my turn to drive.

-- 



Terry Coles


[1] http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway
-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-03-02 Thread Terry Coles
Hi,

The last time I responded on this thread, I intimated that I would be doing 
some work on 
this on Sunday, because my daughter had come to stay.  In the event, it took 
until today to 
get access to my workroom, where all the kit is, because Becky was taken ill 
and the 
workroom is her bedroom ;-(

In the meantime, I studied all Ralph's messages to get my head round what was 
going on 
and found it a bit of a struggle.  Yesterday evening the penny dropped with an 
enormous 
clang; I had been trying to over-complicate things because I thought I had to 
create new 
threads (over and above the ones created by the GPIO.add_event_detect() 
statements).  
Now I realise that these threads will work fine as long as the called functions 
complete 
their work and return in a very short time, eg less than a few seconds say, so 
that the next 
switch callback is not blocked for too long.

So now I have the Change Rings function working properly (bell_player() in 
Ralph's 
example).  It starts the correctly when I depress the switch and stops when I 
toggle it 
upwards.  However, I do seem to be getting an error when the mpg321 process is 
stopped.

See below.

On Friday, 24 February 2017 15:43:04 GMT Ralph Corderoy wrote:
> bell_player = None
> 
> def start_bell_player(gpio):
> global bell_player
> 
> if bell_player is None:
> bell_player = subprocess.Pipe(...mpg321...)
> 
> def stop_bell_player(gpio):
> global bell_player
> 
> if bell_player is None:
> return
> 
> bell_player.terminate()
> r = bell_player.wait():
> if r:
> print 'bell_player: mpg321 failed: %#x\n' % r
> bell_player = None

start_bell_player(gpio) runs fine with no errors.  However, 
stop_bell_player(gpio) initially 
generates a syntax error on bell_player.wait(): - indicating that the colon 
should not be 
there. When i remove the colon the code runs.

However, when bell_player.terminate() is executed, the bell_player.wait() 
doesn't seem to 
work; I get the 'bell_player: mpg321 failed: %#x\n' % r message, where r is 
0xf.  According 
to:

http://www.chiark.greenend.org.uk/doc/python2.7-dev/html/library/
threading.html#event-objects[1] 

*wait*([/timeout/])
Block until the internal flag is true. If the internal flag is true on entry, 
return immediately. 
Otherwise, block until another thread calls *set()[2]* to set the flag to true, 
or until the 
optional timeout occurs.
When the timeout argument is present and not None, it should be a floating 
point 
number specifying a timeout for the operation in seconds (or fractions thereof).
This method returns the internal flag on exit, so it will always return True 
except if a 
timeout is given and the operation times out.
/Changed in version 2.7: /Previously, the method always returned None.
I think that I should be testing for not r in the if statement (because it 
works) and adding a 
timeout.  What would be a reasonable timeout in this case?  If I've understood 
the 
documentation correctly, it doesn't really matter, because when the mpg321 
process 
terminates it will return immediately, so in the end, the timeout could be 
several seconds 
as long as the user is made aware of the possibility of delay.

Is that right?

-- 



Terry Coles


[1] http://www.chiark.greenend.org.uk/doc/python2.7-dev/html/library/
threading.html#event-objects
[2] http://www.chiark.greenend.org.uk/doc/python2.7-dev/html/library/
threading.html#threading.Event.set
-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Python Multiprocessing (or Maybe Multithreading)

2017-03-02 Thread Terry Coles
On Thursday, 2 March 2017 13:34:19 GMT Terry Coles wrote:
> I think that I should be testing for not r in the if statement (because it
> works) and adding a timeout.  What would be a reasonable timeout in this
> case?  If I've understood the documentation correctly, it doesn't really
> matter, because when the mpg321 process terminates it will return
> immediately, so in the end, the timeout could be several seconds as long as
> the user is made aware of the possibility of delay.

As it happens, I can't find a syntatically correct way to express the timeout 
anyway.  Any number entered such as wait(3) or wait(3.0) returns an error from 
the Interpreter to the effect that the object accepts only one argument and 
there are exactly two. 

-- 



        Terry Coles
-- 
Next meeting:  Bournemouth, Tuesday, 2017-03-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Ubuntu mate

2016-09-05 Thread Terry Coles
On Monday, 5 September 2016 12:05:20 BST Ferret Beevor wrote:
> Hello peeps, when is the next meeting.

Tomorrow evening.  The info is always in the Sig.  :-)

> I have Ubuntu mate installed on a laptop and am having issues with the
> webcam and audio. Is it worth bringing along to the meeting.

We can certainly have a look.  There is 'The Cloud' Internet access there, so 
you might have to sign up to download packages, etc , if you haven't already 
done so. 

-- 



        Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Next Meeting - One Week Tonight

2016-08-30 Thread Terry Coles
All,

The next meeting is one week tonight at The Broadway, Bournemouth on Tuesday, 
2016-09-06 at 20:00.  See:

http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway

Paul,

Are you going?  My turn to drive.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Rejected emails

2016-09-11 Thread Terry Coles
On Sunday, 11 September 2016 16:52:04 BST C Wills wrote:
> Yesterday and today emails sent to my next door neighbour have been
> rejected, on both of his email accounts, with the following info:-
> 
>peter..@gmx.co.uk <mailto:peterandpam.br...@gmx.co.uk>   (change for
> security but was correct) host mx00.gmx.net [212.227.15.10]
>  SMTP error from remote mail server after initial connection:
>  554-gmx.net (mxgmx009) Nemesis ESMTP Service not available
>  554-No SMTP service
>  554-IP address is black listed.
>  554 For explanation
> visithttp://postmaster.gmx.com/en/error-messages?ip=195.26.90.71=bip
> 
> To me it looks as if his address has been 'Black Listed' by GMX or is it
> my address causing the problem?
> Looking on the GMX Website explained each code but I'm not sure I know
> which IP they mean has been black listed, me or him?

I don't think that they would blacklist one of their own IP addresses :-)  But 
who knows.

> Talking to him he's had trouble since GMX changed operations from USA to
> Germany.  As he has just got back from holiday the only emails he's got
> have been from 'logging on' on the Web using his phone.  Could this have
> caused the problem?

He should get in touch with the GMX administrator and get them to sort it out 
toot sweet.  Whether the blacklisted IP is yours or his, neither should be, so 
they either need to change their DNSBL or sort out their own blacklist.  They 
mention both at the link.

--

Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-10-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Restoring Grub on an EFI Machine

2016-10-05 Thread Terry Coles
On Wednesday, 5 October 2016 10:25:55 BST Ralph Corderoy wrote:
> On your laptop at the pub last night I edited /etc/default/grub to
> change true to false for GRUB_DISABLE_OS_PROBER.  And then run
> `update-grub'.  All sudo'd.
> https://help.ubuntu.com/community/Grub2/Setup#line-237

And there hangs a tale ;-(

In the stock Kubuntu installation (and I assume on Ubuntu as well), that line 
doesn't even exist, let alone be set to true.

Last evening and this morning, I've been pondering why Dell set that flag at 
all.  I'm assuming that this was to protect their support staff from people 
ringing them up and trying to get problems solved when the default shipped 
version had been upgraded or superseded with  a dual-boot, as I had done.

However, there are two arguments against that.  First, anyone who installs an 
extra distro will find it working perfectly at first because update-grub will 
have been run by the new distro's installer not by the shipped distro.  That 
all works fine until the shipped distro has another kernel update, as happened 
a week or so ago.  Now grub-update ignores the new distro's partition and the 
user is left wondering why it has broken.  As with myself, this might only be 
discovered weeks after the kernel update that triggered the problem.

The second argument against that is that Dell are not supporting Ubuntu on 
this machine anyway; only W10, so they created a problem for their users for 
absolutely no purpose whatsoever.

So the message here is, no matter how good the reviews are (and they are 
good), don't be tempted into buying a Linux Laptop from Dell.  They are not 
providing anything like the same level of support that a Windows user gets, 
but they charge a premium price.  It is a nice laptop, but I'd have been 
better off by the Windows one and dual-booting that.

Anyway, thanks Ralph for sorting it out for me.


-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Restoring Grub on an EFI Machine

2016-10-06 Thread Terry Coles
On Wednesday, 5 October 2016 18:40:54 BST Ralph Corderoy wrote:
> Are you aware of
> 
> Ubuntu on Dell XPS 13 9350
> http://www.ubuntu.com/certification/hardware/201507-18777/
> 
> If there is an issue with the information for this system, please
> let us know.

What kind of alchemy do you use to find these hits?  I've been searching for 
support on Ubuntu with the XPS-13 9350 since April and never found that page.  
Even when I typed 'Ubuntu on Dell XPS 13 9350' into Google just now, it never 
came up (in the first page of hits anyway).  I had to add 'certification' to 
the 
search string to find it and even then it was over half-way down the page.

Of course I would have had to know so much about that page to invent that 
search string that I might as well have gone straight there ;-(

> Perhaps others have clicked that link and put up questions in the past
> with interesting answers.

No such luck I'm afraid.  Very few hits on 9350 and only about a dozen on 
XPS-13.  Nothing that was useful.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Restoring Grub on an EFI Machine

2016-10-05 Thread Terry Coles
On Tuesday, 4 October 2016 19:22:04 BST Tim wrote:
> I downloaded this boot dvd the last time I had an issue with grub
> 
> http://www.supergrubdisk.org/super-grub2-disk/
> 
> It scanned the disk found the two disk with the two distro on, offered
> me a solution and when I agreed it wrote me a new grub, worked
> perfectly. Don't know if it will work for your or not terry.

Thanks for the link Tim, I had actually tried that (it is included on the 
Parted Magic live disc).  It allowed me to boot into the lost partition, but 
didn't seem to offer a repair tool.  Maybe that wasn't included in the Parted 
Magic version of the tool, because the full PM toolset includes a boot repair 
tool (which didn't work for me).

Ralph sorted it out for me last night at the Meeting.  I'm glad he did (more 
about that later), because if I had fixed it with a tool such as Super Grub2, I 
would never have known *why* it broke in the first place.
 
-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Restoring Grub on an EFI Machine

2016-10-05 Thread Terry Coles
On Wednesday, 5 October 2016 15:06:34 BST John Carlyle-Clarke wrote:
> This thread is a little depressing because at work I was given a brand new
> 15" MacBook Pro on arrival which is very lovely I suppose, but I hate it.
> It seems that installing Linux on it (other than in a VM) is not allowed,
> and besides I get the impression it won't work very well. It seems that
> many people have Dell's with Linux, usually self installed over Windows. I
> was thinking of asking if I could swap for a Dell, and the
> developer edition ones are the obvious choices. However, the more you look
> at them the more you see the potential problems. I hate the idea of buying
> a Windows one and taking pot luck on Linux to run well on it but that may
> be no worse.

I think things will gradually become less depressing.  Kernel version 4.8 
(released at the weekend )and notwithstanding the bug that was only noticed by 
Linus afterwards)), together with versions 4.4, 4.5 etc bring more support for 
the Touchscreen and the Skylake processor.

Out of the box the XPS-13 Developer Edition gave appalling benchmark results 
compared to an ancient laptop that Paul brought to a Meeting a few months ago.  
The kernel version in Ubuntu 14.04 is 3.19, which has zero Skylake support.

When I installed Kubuntu 16.04, the benchmark results shot up (that has kernel 
Version 4.4).  When I booted into the latest version of Parted Magic the 
benchmark results were even better (kernel Version 4.5).

In addition, Dell include about half a dozen proprietary drivers that provide 
Touchscreen support (you can use it as a graphics tablet of a sort).  With the 
standard Ubuntu 14.04 (from the Ubuntu website), the Touchscreen hardly worked 
at all.  In Kubuntu 16.04, the Touchscreen works pretty well but the graphics 
tablet functionality is still missing.  I'm hoping that the kernel will 
eventually support all of the Touchscreen functionality and that the graphics 
subsystem (whatever it ends up being) will support automatic display scaling, 
(like Win 10 does) because text is unreadable on a 13" screen at 3200x1800 
resolution unless the fonts are all scaled up (which only works for some 
things).  In the end I have to run the screen at 1920x1400 to make it usable, 
which kind of defeats the object of having a high-res display.

So.  As I said in my earlier post, the XPS-13 is a really nice machine, but it 
is let down by the total lack of support from Dell.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Restoring Grub on an EFI Machine

2016-10-06 Thread Terry Coles
On Wednesday, 5 October 2016 18:29:58 BST Terry Coles wrote:
> My main gripe with Dell in this instance is that they actually charged more
> for this machine than its Windows counterpart, but provided less support.
> Windows customers get access to downloads of the driver, utilities and an
> image of the factory installation for recovery purposes.
> 
> If you drill down into the Support pages for recent versions of the XPS-13
> Developer Edition and other Linux laptops, they *used to* provide support. 
> I don't recall the specific product numbers, but several have support for
> not one, but several versions of Ubuntu, eg 10.04, 12.04, 14.04 and you can
> download Factory images from their website.
> 
> This one (designated 9350) has none of that and the Restore to Factory
> Defaults hot-key is not active, even though the recovery image occupies a
> partition on the machine.  When I naively upgraded my machine to 15.10 and
> thereby lost all the Dell Drivers, they were unable to tell me how to get at
> that recovery image or provide me with a copy of the image, even though the
> factory must have one.  Initially, I was told that they couldn't help me
> because this Operating System was unsupported.  In the end I took legal
> advice and they gave me a new machine, but they still don't support it.
> 
> How not to keep your customers happy.

I've just discovered that Dell do now support Ubuntu 14.04 on this machine see:

http://www.dell.com/support/home/uk/en/ukbsdt1/product-support/servicetag/5Q4JP72/
drivers?os=ub14a[1] 

It's a great shame because this apparently appeared sometime in June, after the 
5th and 
before the 19th (the dates that I posted a comment about this machine on the 
LXF forums 
after their glowing review and the date that the author responded and mentioned 
that 
they did.  I had given up checking the forum for responses by then, so never 
saw it until 
today.

I received my replacement laptop on the 22nd, so they could have saved 
themselves lots 
of money and me a lot of stress simply by providing the image a month before.

So if anyone wants one, they do at least support it with their special image of 
14.04, 
although to get anything like the proper performance, you need at least 15.10.

-- 



Terry Coles


[1] http://www.dell.com/support/home/uk/en/ukbsdt1/product-support/servicetag/
5Q4JP72/drivers?os=ub14a
-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Restoring Grub on an EFI Machine

2016-10-05 Thread Terry Coles
On Wednesday, 5 October 2016 17:19:54 BST Patrick Wigmore wrote:

> That would fit with my experience buying a laptop from Dell,
> with Ubuntu installed, in 2008.
> 
> A year or two passed before everything in the laptop was
> supported by standard Linux distributions, without Dell's
> customisations. I suspect that some of the people who had
> bought one ended up contributing the support for it into the
> kernel (or elsewhere), to scratch their own itches.

It was always this way, especially before PC vendors started supporting Linux   
Back in 2008 (AFAIR), Dell were only just starting to support Linux, so were 
probably at the other end of the process that they appear to be ending this 
year.

My main gripe with Dell in this instance is that they actually charged more 
for this machine than its Windows counterpart, but provided less support.  
Windows customers get access to downloads of the driver, utilities and an 
image of the factory installation for recovery purposes.

If you drill down into the Support pages for recent versions of the XPS-13 
Developer Edition and other Linux laptops, they *used to* provide support.  I 
don't recall the specific product numbers, but several have support for not 
one, but several versions of Ubuntu, eg 10.04, 12.04, 14.04 and you can 
download Factory images from their website.

This one (designated 9350) has none of that and the Restore to Factory 
Defaults hot-key is not active, even though the recovery image occupies a 
partition on the machine.  When I naively upgraded my machine to 15.10 and 
thereby lost all the Dell Drivers, they were unable to tell me how to get at 
that recovery image or provide me with a copy of the image, even though the 
factory must have one.  Initially, I was told that they couldn't help me 
because this Operating System was unsupported.  In the end I took legal advice 
and they gave me a new machine, but they still don't support it.

How not to keep your customers happy.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Restoring Grub on an EFI Machine

2016-10-04 Thread Terry Coles
Hi,

You may remember that I was less than impressed with Dell when I bought an 
XPS-13 
Developer Edition earlier this year because it came with Ubuntu 14.04 and zero 
support.  
Since I couldn't upgrade the Ubuntu installation without throwing away the 
touchscreen 
capabilities, I compromised and installed Kubuntu 16.04 as a dual-boot system.

This has worked fine until now, but since I last used the machine a week or two 
ago, 
something has overwritten my Grub menu.  The two partitions that I created for 
Kubuntu 
are still intact (I can boot into using Super Grub2 from a live disc), but I 
can no longer see a 
menu from the boot-screen; it goes straight into Ubuntu.

I've tried a few tools from the Parted Magic Live Disc, but cannot seem to be 
able to write 
a viable Grub Menu.  According to this page:

   http://www.wensley.org.uk/gpt[1] 

there are some peculiarities associated with using GPT discs and grub2 has to 
be written 
to a special partition, but I cannot see for certain which one to use and I've 
had problems 
matching the incantations on that page to the reality of my disc line-up, which 
has an SSD 
Drive.

Does anyone know I good (safe) way to recover my grub menu?  I'll be bringing 
the 
machine tonight.

-- 



Terry Coles


[1] http://www.wensley.org.uk/gpt
-- 
Next meeting:  Bournemouth, Tuesday, 2016-10-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Restoring Grub on an EFI Machine

2016-10-04 Thread Terry Coles
On Tuesday, 4 October 2016 16:18:20 BST Ralph Corderoy wrote:
> https://help.ubuntu.com/community/Grub2#GRUB_vs_GRUB_2 says
> 
> On a new installation of Ubuntu 9.10 or later with no other
> installed operating systems, GRUB 2 will boot directly to the login
> prompt or Desktop.  No menu will be displayed.
> 
> Hold down (right) SHIFT to display the menu during boot.  In certain
> cases, pressing the ESC key may also display the menu.
> 
> It also suggests in that list that /etc/grub.d/40_custom is where you
> should stash your own menu entries.  And that `update-grub' looks for
> other OS.  It looks like an interesting read, with links off to other
> pages.

Unfortunately, none of that seems to work.  When I first installed Kubuntu 
16.04, a menu 
was generated, with choices between Ubuntu and Kubuntu.  I didn't need to 
invoke it.

Your link says that '*grub.cfg* is overwritten by certain Grub 2 package 
updates, 
whenever a kernel is added or removed, or when the user runs update-grub'.

It seems to me that grub.cfg was updated at some point when I updated the 
kernel, but 
now it doesn't seem to be writing it to the right place, because no matter how 
I run it, the 
result is the same.

If I run Super Grub2, I can see the bootable kernels and listing the menu seems 
to show 
that both distros are available, but whatever is being run when I boot 
normally, it isn't 
seeing that list.

I suspect that if I re-install Kubuntu, it might all burst into life, but 
that's a bit drastic, so I 
might just wait until (K)ubuntu 16.10 is released next week.  That will include 
kernel V 4.8 
which brings several extras to the party which will (hopefully) enable some 
more of my 
touch-screen features.

-- 



Terry Coles
-- 
Next meeting:  Bournemouth, Tuesday, 2016-10-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] My Introduction

2016-09-19 Thread Terry Coles
On Monday, 19 September 2016 08:22:09 BST Antony Wellings wrote:
> Just thought I'd introduce myself on here, my name is Antony. Recently moved
> down to Bournemouth, well a year ago - kinda recent. Anyway thought I'd
> lookup the local LUG group here. I currently work for the Mercedes dealer
> group in the area looking after there IT systems, helps pass the day,
> nothing spectacular mostly windows deskptop support and some windows server
> stuff that sort of thing. My interest in other OS's began with BSD which I
> still like to use, currently typing this on my mail server which runs
> FreeBSD. I also like to dabble in programming, very much a hobby rather
> than a good level. Currently learning Python at the moment and would like
> to broaden that in to some web development maybe running a website of sort,
> have to figure that out yet. Anyway that's me, just thought i'd say Hi and
> maybe get to know some others around here for some Linuxy geeky techy type
> stuff

Hi, Antony,

Welcome to the Dorset LUG.  Presumably you've found our Wiki at http://
dorset.lug.org.uk/wiki/[1] so you probably know that we meet once a month at 
the The 
Broadway in Bournemouth (just down the road from the Castlepoint shopping 
center).

These tend to be fairly social events, which occasionally get pretty technical. 
 Otherwise we 
try to solve list-members problems online.

Try coming along to the next meeting on the 4th of October (follow the link in 
the Sig).

-- 



Terry Coles


[1] http://dorset.lug.org.uk/wiki/
-- 
Next meeting:  Bournemouth, Tuesday, 2016-10-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] G parted

2016-09-07 Thread Terry Coles
On Wednesday, 7 September 2016 15:50:47 BST Ferret Beevor wrote:
> Manual installed Ubuntu mate as instructed at last nights meeting. Created 3
> partitions

..

> Went to install only to have a window pop up saying something like, this
> system uses uefi firmware. You can go back and create the efi system
> partition or click continue to force it.

I thought you said last night that you already had a UEFI partition?  You 
shouldn't have to create another one

> I went back and did 4 partitions
> 
> Efi
> Primary
> Beginning of the space
> (500 MB I gave it )

I've never had to do this, so I cannot comment whether or not you did it 
right.

.

> The install also mentioned secure boot must be disabled during startup in
> order for third party software to work correctly, I ticked it and created a
> password to enter at boot time.

If you have secure boot disabled, you shouldn't need a UEFI partition AFAIK.

> Have I done it correctly.

It seems not.  Can anyone else help?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-10-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Off topic - Installing M$10 Help please

2016-08-28 Thread Terry Coles
On Sunday, 28 August 2016 05:37:52 BST C Wills wrote:
> Is there anyone willing to assist please, we are in the Wimborne area.

When you asked me about this on Tuesday, I forgot that my son had just 
installed W10!  I don't think he had any problems, because he never asked me 
anything about it.  You won't get him to come out to help since he's a 
recluse, but he may be able to offer some advice on what he did and didn't do.

There is one fundamental difference between what he did and what you tried to 
do with your friend's machine; he started with a clean brand new SSDD, whereas 
your friend's machine presumably came with the OEM installation pre-installed 
and ready to activate.  What he did was to download the W10 image (presumably 
from the M$ site) and purchased a licence (which arrives as a piece of paper).

So if all else fails, one route could be to wipe the hard disk and install 
using the downloaded version of Windows.  During installation, it will ask for 
the licence key (which should be on your friend's machine) and after that, you 
are ready to run the gauntlet of the M$ and third-party crippleware again ;-(

One advantage of this method is that any crippleware added by the machine 
manufacturer will no longer be there, only the M$ stuff.  It may be that the 
item that stopped you was only from the machine OEM, so you would never get to 
it,

Matthew's asleep at the moment (he's a night knadger), but when he gets up 
later this morning, I'll ask him for the details of what he did and what his 
experience was.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-09-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Next Meeting - One Week Tonight

2016-09-27 Thread Terry Coles
All,

The next meeting is one week tonight at The Broadway, Bournemouth on Tuesday, 
2016-10-04 at 20:00.  See:

http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway

Paul,

Are you going? 

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-10-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Problem with security certificate

2016-10-02 Thread Terry Coles
On Sunday, 2 October 2016 17:06:11 BST Graeme Gemmill wrote:
> Enter http://share.gemmill.name/owncloud (i've used Firefox and Konqueror)

Hmmm.  I get timeout messages from that address in both Firefox and Chromium.  
If I 
modify the protocol to https:// I get this in Firefox:

'The connection to share.gemmill.name was interrupted while the page was 
loading.

The page you are trying to view cannot be shown because the authenticity of 
the 
received data could not be verified.'

In Chromium I get:

'This site can’t be reached
*share.gemmill.name* unexpectedly closed the connection.
Try:
 *  Checking the connection
 *  Checking the proxy and the firewall[1]
ERR_CONNECTION_CLOSED'

I saw no Advanced option, just a link to a boilerplate page about security in 
either 
browser.

-- 



    Terry Coles


[1] data:text/html,chromewebdata#buttons
-- 
Next meeting:  Bournemouth, Tuesday, 2016-10-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Bluetooth speaker

2016-10-27 Thread Terry Coles
On Wednesday, 26 October 2016 22:31:03 BST ferret wrote:
> would anyone know how to fix bluetooth connectivity / a2dp issues. A
> straight forwards troubleshooting check list would be appreciated.
> 
> No luck with different forums they are too overblown and very vauge for
> my liking, not to mention many posts are long winded. Alot of the
> replies are written by people who find it impossible to give simplified
> and shortened advise.
> 
> im running linux mint 18 cinnamon.

Not knowing quite what problem you are having, I can only mention that there 
is a known problem with bluetooth support on Linux.  It appears to only affect 
certain chipsets and manifests itself as an irritating habit of dropping the 
connection.

We gave up in disgust trying to connect a bluetooth keyboard and a bluetooth 
mouse to a RaspberryPi 3.  Having got the one connected, it dropped out when 
trying to connect the other and vice-versa.  Even when we decided that life 
was too short and gave up on one of the devices, the other still dropped out 
if left unattended too long.  (This also happens on a W 10 machine, but after 
a longer delay and can be recovered by hitting the shift key, whereas in 
Raspbian we had to reconnect.)

The problem is in the low-level bluetooth code somewhere, not in the GUI tool 
provided to make the connections.  I tracked it down on a x86 forum, but I 
can't remember which one.

Do these symptoms look anything like yours?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How to configure "Reply-To" correctly for list?

2016-10-29 Thread Terry Coles
On Saturday, 29 October 2016 15:10:39 BST Patrick Wigmore wrote:
> Hi All,
> 
> I've just noticed that my messages to this list seem to be set up
> so that replies to them by default go straight to me rather than
> the list. This seems wrong to me. Does anyone know what
> configuration I need to change in KMail so that replies go to the
> list by default?
> 
> I have "Reply-to" set to my own address in my configuration, but
> I would not expect that to apply to list emails. Do I need to
> remove that? (As an experiment, I will remove it for this
> message.)

All I did was click reply.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How to configure "Reply-To" correctly for list?

2016-10-30 Thread Terry Coles
On Saturday, 29 October 2016 17:17:33 GMT Patrick Wigmore wrote:
> On Saturday 29 Oct 2016, at 15:38:52, Ralph Corderoy wrote:
> > The relevant documentation is
> > https://www.gnu.org/software/mailman/mailman-admin/node11.html
> > and this list's settings are
> > 
> > first_strip_reply_to = 0
> > reply_goes_to_list = 0
> > reply_to_address = ''
> 
> I was more inclined to question my own mail user agent's
> behaviour than the configuration of the list, since it seems to
> work fine for everyone else.

Actually, it doesn't work fine for everybody else and it's not uncommon for me 
to reply to a message, neglecting to check the To Address field, and then 
wonder why my message doesn't turn up on the list.

If the sender simply puts the mailman address in the To Address field and 
nothing anywhere else, then the list works fine.  I also find that people who 
send to me and CC the list also cause me to get it wrong. 

Ralph,  I have a vague recollection that this was changed some years ago to 
prevent another problem, but I can't remember what it was.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Ending Playback in mpg321 from Within Python

2016-11-06 Thread Terry Coles
Hi,

By now I think everyone knows that I'm doing some work on the Wimborne Model 
Town again; this year includes getting the bells to work in the model Minster.

As part of this, I'm looking to replace the aging CD/MP3 player that currently 
sits on the floor inside the model and plays (amongst other things) the Wedding 
March.  To this end, I'm currently coding a simple MP3 player in Python, which 
will run on a Pi Zero.  It will select a directory full of files and play them 
in a loop until a staff member presses a button to select a new directory or 
to stop playback.

So far, I can play any selected directory using mpg321 in an os.system call.

My question is about stopping playback, so that a new selection can be made.  
mpg321 has a fair number of command-line argument, but none to stop playback 
or quit.  I think that I might be able do this by sending a signal (I've done 
this from the OS), but I haven't found a way to obtain the PID of the mpg321 
instance from within my script yet.  That method also seems a bit 'harsh'.

Has anyone got any suggestions?
 
-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Ending Playback in mpg321 from Within Python

2016-11-06 Thread Terry Coles
On Sunday, 6 November 2016 13:10:19 GMT William R Sowerbutts wrote:
> Instead of os.system(), which will blocks until the called process
> completes, use the "subprocess" module -- subprocess.Popen() -- which runs
> the player process in parallel with your script. The ".pid" member variable
> of the process object gives you the process ID. You can .send_signal() to
> signal it (and .terminate() which uses this to send it a SIGTERM).

I'll give that I try.  Thanks.

> You can probably send keypresses to stdin with this method also, I expect it
> has a key you can press to quit.

I don't believe mpg321 has an interactive mode; I can start it with all sorts 
of options, but 
once it's going.

However, I gather that mpg123 is the player available on piCore ( which I 
intend to use 
for this) and that does have an Option to accept keyboard inputs.

I'll see where this takes me.

-- 



Terry Coles
-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Ending Playback in mpg321 from Within Python

2016-11-06 Thread Terry Coles
On Sunday, 6 November 2016 14:37:53 GMT William R Sowerbutts wrote:
> Whipped this quick demo up; it will play at most five seconds of each MP3
> file in the current directory. Tested with both mpg321 and mpg123.

Will,

Thanks for this.  I had got as far as getting Popen to play the music, (it 
took me a while to understand the docs), but I hadn't got round to looking at 
how to handle the terminate code yet :-)

Excellent work.  I'll make sure that the Trustees at the Model Town know that 
I had help from this List.  :-)

--

Terry

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Ending Playback in mpg321 from Within Python

2016-11-06 Thread Terry Coles
On Sunday, 6 November 2016 16:46:16 GMT Andrew wrote:
> seem to just work on Ubuntu 16.04. I've attached a simple player program

Andrew,

The list doesn't accept attachments, can you send it to my address instead of 
the list?

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Syntax for aplay

2016-11-11 Thread Terry Coles
For some reason the listserver stripped out the middle part of my message 
(when I view what I sent, it only shows up if I view html, but there wasn't 
nay html in the message) ;-(  Most of the missing text consists of the man 
page fragment for -f, so that is available to all.

Apart from that, the following line was also stripped out:

'I've tried every possible incantation of -f that I can think of, but always 
get the same result.'
 

On Friday, 11 November 2016 10:55:32 GMT Terry Coles wrote:
> Hi,
> 
> I've just received a set of these:
> 
> https://thepihut.com/products/usb-audio-adapter[1]
> 
> As far as I can tell, these are identical to the ones sold by Modmypi and
> others, so I've been trying to get them to play using the tutorial I found
> on the Modmypi site.
> 
> Initially, I'm doing this on my PC for convenience.
> 
> I can identify the devices and aplay attempts to play the file, but
> complains that I've asked for the wrong format:
> 
> ../Playlist1$ aplay -D hw:3,0 01_Wedding_March.wav
> Playing WAVE '01_Wedding_March.wav' : Signed 32 bit Little Endian, Rate
> 44100 Hz, Stereo aplay: set_params:1297: Sample format not available
> Available formats:
> - S16_LE
> 
> I can get the file to play to the default audio device on hw:0,0 without
> complaint, but that of course is my PC sound card.
> 
> The man page for aplay says:
> 
> -f --format=FORMAT
> 
> 
> So my question is twofold:
> 
> 1. What is it that doesn't like the format; the device or the tool?
> 
> 2. If it's the tool; how do I write it to make it work.
> 
> BTW.  I really want to do this using mpg123 eventually, but I haven't found
> a tutorial to help me make that work, so I started with this.


-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Syntax for aplay

2016-11-11 Thread Terry Coles
Hi,

I've just received a set of these:

https://thepihut.com/products/usb-audio-adapter[1] 

As far as I can tell, these are identical to the ones sold by Modmypi and 
others, so I've 
been trying to get them to play using the tutorial I found on the Modmypi site.

Initially, I'm doing this on my PC for convenience.

I can identify the devices and aplay attempts to play the file, but complains 
that I've asked 
for the wrong format:

../Playlist1$ aplay -D hw:3,0 01_Wedding_March.wav 
Playing WAVE '01_Wedding_March.wav' : Signed 32 bit Little Endian, Rate 44100 
Hz, Stereo
aplay: set_params:1297: Sample format not available
Available formats:
- S16_LE

I can get the file to play to the default audio device on hw:0,0 without 
complaint, but that 
of course is my PC sound card.

The man page for aplay says:

-f --format=FORMAT 


So my question is twofold: 

1. What is it that doesn't like the format; the device or the tool?

2. If it's the tool; how do I write it to make it work.

BTW.  I really want to do this using mpg123 eventually, but I haven't found a 
tutorial to 
help me make that work, so I started with this.

-- 



Terry Coles


[1] https://thepihut.com/products/usb-audio-adapter
-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Syntax for aplay

2016-11-11 Thread Terry Coles
On Friday, 11 November 2016 12:37:53 GMT Ralph Corderoy wrote:
> > I installed sox, but found the man page a bit dense
> 
> It just needs reading many more times.  :-)

Maybe next time :-)

> sox has a soxexam man page too with examples so you can then work
> backwards and look at the options in the reference sox(1).  BTW, that
> soxexam mentions sticking with PCM if you're doing multiple
> modifications and that's probably good advice as WAV files can contain
> MP3 lossy compressed sound and not just PCM.  soxexam also introduces
> some of the effects sox can produce;  perhaps they might be helpful if
> you need more of an "echo", etc.

Well at the end of the day I want to play mp3 files, since that is what the WMT 
staff will have most readily available.  I was only using .wav, because the 
Tutorial used aplay and that doesn't support mp3.

Now I am trying to work out how to direct the output of mpg123 to the same 
audio devices.  The format of the command seems to be different to aplay and 
it keeps defaulting to the PC sound card.

Any thoughts on that anyone?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Syntax for aplay

2016-11-11 Thread Terry Coles
On Friday, 11 November 2016 13:35:27 GMT Terry Coles wrote:
> Now I am trying to work out how to direct the output of mpg123 to the same
> audio devices.  The format of the command seems to be different to aplay and
> it keeps defaulting to the PC sound card.
> 
> Any thoughts on that anyone?

Never mind, I've done it.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Thunderbird stacking problem - Re: Syntax for aplay

2016-11-11 Thread Terry Coles
On Friday, 11 November 2016 13:47:40 GMT PeterM wrote:
> On 11/11/16 13:38, Terry Coles wrote:
> > Never mind, I've done it.
> 
> Usually Thunderbird stacks all responses under the initial  email so
> that they are easy to follow, but on this occasion it has not happened.
> They are showing up as individual email. I have not changed anything on
> my setup and it works fine on another list. Not sure if 'stack's is the
> correct terminology, but it shows them as indented  mails under the
> initiating mail.
> 
> Is anybody else having this happen to them?

The word you are looking for is 'threads'  :-)

I'm using KMail and threading is working fine.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Thunderbird stacking problem - Re: Syntax for aplay

2016-11-11 Thread Terry Coles
On Friday, 11 November 2016 13:57:29 GMT PeterM wrote:
> > On Friday, 11 November 2016 13:47:40 GMT PeterM wrote:
> Thanks Terry. Glad you've got your bits working. I have been struggling
> for a week to get my R-Pi to light a couple of LED's and last night
> discovered one LED is dead. Bah!

Exactly.  There was me racking my brains to work out why the music wouldn't 
play, only to find out that there was nothing wrong with what I was doing; it 
was the music that was faulty ;-)

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] SanDisk Secure Access Software in Linux

2016-10-25 Thread Terry Coles
Hi All,

I just received a SanDisk USB Stick.  I only bought it because to make up the 
value of my Amazon order to get free delivery (and you can never have enough 
USB sticks).  I wasn't expecting it, but it includes something called SanDisk 
Secure Access Software, to allow users to create a secure volume on the stick  
Unfortunately SanDisk only support Windows and Mac.

I've Googled around and also tried to get the software to work under wine, but 
although the code runs, it cannot then see the device that it ran from.  I can 
obviously use it in a VM, but I'd like something a bit more versatile.

Assuming that no-one on this list has got this to work, is anyone aware of a 
tool that can be used under any OS?  Could something be done with some kind of 
Portable App perhaps?
 
-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Next Meeting - One Week Tonight

2016-10-25 Thread Terry Coles
All,

The next meeting is one week tonight at The Broadway, Bournemouth on Tuesday, 
2016-11-01 at 20:00.  See:

http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway

Paul,

Are you going?   My turn to drive.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] SanDisk Secure Access Software in Linux

2016-10-25 Thread Terry Coles
I meant to send this to the list, but Tim CCs the List, so my message went to 
him instead...

On Tuesday, 25 October 2016 12:46:50 BST Tim wrote:
> On 25/10/16 11:18, Terry Coles wrote:
> > Assuming that no-one on this list has got this to work, is anyone aware of
> > a tool that can be used under any OS?  Could something be done with some
> > kind of Portable App perhaps?
>
> I have not tried this software but I came across this a while ago while
> looking for something else and bookmarked it for future reference and
> you email reminded me
>
>
> https://veracrypt.codeplex.com/
>
>
> It says it will run on Windows, Mac and Linux

Well it certainly runs on Linux and seems to work well.  The only real problem 
I had was that during the creation of the encrypted volume on the stick it 
said that the format was 100% completed and then took another 4-5 mins for the 
activity icon to stop rotating so that I could mount the volume.

It says that it is a descendant of TrueCrypt and it certainly looks and 
behaves like it.  I'm assuming that I would be able to open my volume if I had 
a copy of VeraCrypt on a Windows machine, just as we used to with TrueCrypt 
years ago.

The downsides are:

1.  To use it, the machine has to have VeraCrypt installed, using the version 
for its OS, or a 'Traveller Disc'  installation has to be copied to the stick, 
but see below.

2.  The 'Traveller Disc' tool, which allows you to install the Veracrypt 
software onto an unencrypted partition on the USB stick, doesn't seem to be 
available in the Linux version.

Otherwise it does seem to be a good cross-platform tool.



-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Syntax for aplay

2016-11-11 Thread Terry Coles
On Friday, 11 November 2016 16:10:45 GMT Ralph Corderoy wrote:
> > For some reason the listserver stripped out the middle part of my
> > message (when I view what I sent, it only shows up if I view html, but
> > there wasn't nay html in the message) ;-(  Most of the missing text
> > consists of the man page fragment for -f, so that is available to all.
>
> When viewing your outgoing email to the list, are the missing bits in
> the text/plain alternative part of your outgoing copy?  Or was KMail
> unable to represent your words in text/plain?

Yes.

> The list's current configuration has it take a multipart/alternative
> email, e.g. with text/plain and text/html parts, strip that down to just
> one alternative, probably the text/html as it's indicated to be the
> "better" representation by coming second, and then convert text/html to
> text/plain before sending out.
> 
> It's possibly the omitted bits were due to some fancy HTML you produced.
> Ideally, send just text/plain to the list so the list won't interfere.
> That's how the list used to work IIRC, before Mailman fept some
> creatures.

I simply copied the text from within a terminal displaying the output of 'man 
aplay'.

The last missing line, I typed myself.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Tools / Methods to Add Content to Web Pages for Non-Techies

2016-11-21 Thread Terry Coles
On Monday, 21 November 2016 17:56:10 GMT Ralph Corderoy wrote:
> You could ditch the database and use text files for your simple needs.
> Concentrate more on how to serve up a web page with a filled-in form and
> process the result.  Flask is a lot more than accessing a database, and
> it's those other bits you need: HTTP serving, HTML generation.

OK.

> You web server should be running your code at the root of your site's
> directory so `change directory' navigation will probably be required.

Your correction noted.
 
> If it's JSON, use a Python library to read and write JSON, not do ad hoc
> parsing with string functions.  That should also ensure correct encoding
> of characters, e.g. `£', depending what staff enter.

OK.  My problem at the moment is that I simply re-used the code I found on the 
Internet, because it did exactly what I wanted it to do.  I really only have a 
vague idea what JSON is. Some learning needed here :-)

> For the non-JSON, you might still want a text file to hold the
> "database", e.g. Python's CSV-handling module, and produce the HTML that
> you're already using from that when you need it using Flask's templates.

OK.  More learning needed :-)

> Present a form with the current values, allowing them to be: edited,
> deleted, perhaps blank entries are purged; added, a blank entry at the
> bottom can be filled in; moved, maybe their ordinal position, 10, 20,
> 30..., can be edited.  A nicer UI comes with using Javascript, but you
> may want to ignore that for the small use it will get.

This where my mind-set  has let me down (that of an applications / systems 
engineer who wrote test programs using spaghetti code 20-30 years ago).

I was thinking of a stand-alone Python program or script that would do all the 
functions that I described.  Clearly, if you're working on a website; use a 
web based solution!  Doh ;-(

> That's the HTML form.

Of course it is; see above :-)

> Process the HTTP POST from the user's browser when they submit the form
> using Flask to gather their new definition.  You need to learn about the
> difference between a GET and POST HTTP request from the browser.

Again, my mindset!  The ability to use forms on a website has been around 
almost since the founding of the world (or the web at least), I just never 
thought of it...

> > 7.  Overwrite the file in the www folder.
> 
> Maybe.  If you do then write a new version and "move" it over the
> existing one as that's an atomic filesystem operation.  Otherwise you
> might hit a problem half-way through writing and trash the file being
> used.

I'll need to work out exactly what that means.

> Or the editing page can show a preview of how it looks so far and the
> public only see the new one on a "finished" commit action by the staff
> member.  Depends if staff need to edit whilst the system's being used.
> 
> > 8.  For the Audio Guide, upload the new MP3 file.
> 
> Forms can upload files.

Yes, and I've done it many times.

> I suggest an account per user rather than shared access.  This makes it
> easier to see who did want.  You can log it.  Or copy the "before"
> version before moving the new one over the top.

Good idea.

Summing up on your advice, we can now update our design to home in the your 
suggested approach, since it is the obvious choice.  Thanks for that.

My problem now is to wade through the Tutorial(s) to get up to speed with 
these techniques.  I'll make a start now, since we're still waiting for some 
hardware, but the priority is the bells, so I may not get far on this for a 
few weeks or months.

I'll report on progress (with more questions I expect) in due course.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Tools / Methods to Add Content to Web Pages for Non-Techies

2016-11-20 Thread Terry Coles
Hi,

I'm working on the Wimborne Model Town stuff again.  The Bells project is 
currently awaiting hardware deliveries and other dependencies, so I've 
returned to our two Web projects; the Audio Guide and the Children's Quiz.

Both of these facilities have been based on code that I culled from the net 
and both use basic HTML and Javascript techniques to create an online MP3 
player with menus for the former and an online randomised question and answer 
system with scoring for the latter.

Both of these systems currently work and lack only styling and content at this 
stage.  Styling will be decided in the coming months, but content will be an 
ongoing requirement that ideally should be added by the non-techie WMT Staff.  
The content is also likely to change as the years go by, as are the Staff.

So, the requirement is to provide the WMT Staff with this capability.  Our 
draft design discusses a number of ideas, including (somehow) making use of 
the current Content Management System used for the WMT Webite or using an 
ordinary PC-based Web Development tool as well as various more primitive 
techniques.  We have some special constraints apart from the skill level:

1.  The users will access the system via a local Wireless Network which is not 
connected to the Internet.  The Staff should ideally access the system for 
updates in the same way, but a local monitor and keyboard / mouse combination 
could be used.

2.  It will be running on a Raspberry Pi, so any tools designed to run locally 
must be compiled for the Pi.

3.  Being non-techie, the WMT Staff may well be put off if they are required 
to do such mystical things such as SSH or FTP.  (There will be a User Manual.)

My preference is to write some kind of script which locates the content 
references in the relevant file and then displays them in a kind of menu, with 
the options 'Add Content', 'Delete Content' etc.  However, I'm aware that this 
would have to run fairly seamlessly, preferably from a Windows PC logged into 
the local network.  Also, I've never done anything quite like that before, so 
I'm in new territory for me.  The content references are held in well 
structured lists in each case, so I'm sure that the technique is doable (apart 
from anything else, this is exactly what my software engineering colleagues 
used to do when I was still working).

Has anyone any ideas?  If I had a starter (preferably in Python), I'd 
definitely give it a go.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Tools / Methods to Add Content to Web Pages for Non-Techies

2016-11-21 Thread Terry Coles
On Sunday, 20 November 2016 18:34:28 GMT Ralph Corderoy wrote:
> Sounds like each of your two existing web sites could do with an "admin"
> entry point where one of the users known to it can edit the data it's
> serving.

Yes that is exactly what I had in mind.

> > If I had a starter (preferably in Python), I'd definitely give it a
> > go.
> 
> http://flask.pocoo.org/ has a reputation for being a small lightweight
> not-too-magical library for writing backends for web sites in Python.
> Looking through its tutorial might give you an idea if that's the route
> you want to take.

Hmmm.  That site seems to provide some pretty comprehensive information, 
especially if 
you are fairly aux faix with database development.  Unfortunately, I'm not ;-)

Our two websites do not use databases.  In the case of the Audio Guide, I've 
based it on 
the Player provided by Neils Harbo at:

http://nielsharbo.dk/?pageId=resources=audioplayer=en[1] 

If you look, you will see that the references to the MP3 files are stored in 
the HTML in the 
form:

 http://www.nielsharbo.dk/test/audioplayer/life.mp3; 
data-oggfallback="http://
www.nielsharbo.dk/test/audioplayer/life.ogg">"Life is..."

In the case of the Children's quiz, the Questions and Answers are held in a 
.json file:

{"quizlist":[
{
"question":"Portuguese is spoken in ___",
"option1":"Brazil",
"option2":"Argentina",
"option3":"Ecuador"
},
{
"question":"What is the capital of Peru?",
"option1":"Lima",
"option2":"Bogota",
"option3":"San Juan"
},
{
"question":"Which country is long and thin?",
"option1":"Chile",
"option2":"Uruguay",
"option3":"Colombia"
}
]
}

(I've lost the link to the site that provided that code, but it was free.)

So (at an extremely high level), I think that what I need to do is:

1.  Prompt the user for the admin login and navigate to the www folder.

2.  Read the relevant file into a variable.

3.  Use the Python Find Function to identify the relevant list, then iterate 
through it to copy 
the list part only into an array (pretty much all of the .json file).

4.  Print the array and prompt the user for input, eg 'Modify' etc, using the 
array index to 
identify the element containing each item in the list.

5  Provide a function that will allow the user to edit the contents of the 
array element 
being modified.

6.  Write the modified array back into the string.

7.  Overwrite the file in the www folder.

8.  For the Audio Guide, upload the new MP3 file.

Clearly, there will be a need for some safeguards so that the user doesn't 
break things, 
but since the data to be changed is all in simple strings, I see no need to 
rewrite what I 
have to put the data into a database.  String handling I've done (in C and some 
other 
languages).  Database queries have always seemed a bit of a black art to simple 
old me :-)

Any comments?

-- 



Terry Coles


[1] http://nielsharbo.dk/?pageId=resources=audioplayer=en
-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Test

2016-11-02 Thread Terry Coles
On Wednesday, 2 November 2016 11:44:45 GMT Ferret Beevor wrote:
> Having some problems with gmail, has anyone got this mailing list email.

Ferret,

Sorry, which 'mailing list email' do you mean?  You just used the list mailbox 
address to send your message.

Are you thinking of another one?

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How to configure "Reply-To" correctly for list?

2016-10-31 Thread Terry Coles
On Sunday, 30 October 2016 17:58:09 GMT Ralph Corderoy wrote:
> That sounds like you're clicking the wrong "reply" button in your mail
> user agent.  Outside of the list, if Patrick emails you, CC me, don't
> you have to be careful when you reply to choose between it going just to
> Patrick or me too?  A choice is also to be made when replying and one of
> the addresses is the list.  Your MUA might note the List-* headers and
> offer list-specific options, but in general it's the same issue: to whom
> do I want to reply.

Reading the thread that you pointed at below, I recall that I customised my 
toolbar to include the Actions 'Reply To All', 'Reply To Author' and 'Reply To 
Mailing List'.  Unfortunately, the last time I upgraded those customisation's 
seem to have been cleared, so all I had left was the default 'Reply' 

I've fixed it (again) now.

> > If the sender simply puts the mailman address in the To Address field
> > and nothing anywhere else, then the list works fine.
> 
> The list works fine?  You mean you get a single copy from the list.  Or

Yes.

> something specific to replying to the email you receive from the list?

No.

> Is it still Thunderbox you're using?

No.  Kontact (KMail).  Always has been since around 2002.

> > Ralph,  I have a vague recollection that this was changed some years
> > ago to prevent another problem, but I can't remember what it was.
> 
> Start reading at
> https://www.mail-archive.com/dorset@mailman.lug.org.uk/msg05999.html and
> work your way down the thread in the footer.  :-)

Yes.  I remember now.  My issue then, as now, is that I never had to do 
anything but hit 'Reply' for years and the message would be sent to the List.  
Then something started sowing confusion (for me at least).  I don't know what 
changed; KMail, or the list, but it still catches me out regularly, 
particulary because the KDE developers keep breaking backwards compatibility 
and settings that have worked for years suddenly disappear ;-(

I keep threatening to abandon KDE, but the trouble is that I like more than I 
hate ;-)

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Issues with Kubuntu 16.10

2016-10-15 Thread Terry Coles
Today I upgraded my laptop (as mentioned elsewhere) and my desktop to Kubuntu 
16.10.  I had two issues.

On both machines upgrading failed.  The Upgrade was offered, but didn't work.  
I resorted to the Kubuntu forums and eventually the answer came back, see:

https://www.kubuntuforums.net/showthread.php?70938-16-10-Upgrade-being-flagged-but-nothing-happens=393888=1#post393888

This was subsequently flagged as a bug on the bugtracker, so it should be fixed 
eventually.

The laptop then upgraded OK, but with the desktop I was unable to get Kontact 
to work, see:

https://www.kubuntuforums.net/showthread.php?70939-Kontact-Error-Akonadi-Service-Not-Running=393896=1#post393896

Hopefully this might save one or two people some grief.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] My Dell XPS-13 DE

2016-10-15 Thread Terry Coles
This is a follow-up to my earlier info about the problems that I experienced 
with my Dell XPS-13 Developer Edition and the unsuitability of the Pre-
installed Ubuntu 14.04 for a machine with Skylake processor and QHD+ high res 
touchscreen.  As I said at one point, I was waiting for Kubuntu 16.10 to be 
released in the hope that things would improve.

Well they have (as expected).  Kernel 4.8 has boosted the benchmarks to a 
sensible number and the touchscreen can be used as a graphics tablet without 
booting into the default installation (just like in the Microsoft Surface ads 
:-) .

Kubuntu still doesn't cope very well with scaling the hi-res screen so I have 
to reset the resolution down to 1920x1080 to make it readable, but otherwise 
it is now quite a nice machine to use.

As to whether it is considered to be value for money, I'll leave up to you.  
In any case the machine is currently unavailable because Dell are updating the 
XPS-13 to the Kaby Lake processor.

Here we go again

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-11-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Things discussed and results:

2016-12-10 Thread Terry Coles
On Saturday, 10 December 2016 11:45:03 GMT William R Sowerbutts wrote:
> You can write a udev rule to name the device according to the USB port it is
> plugged into (either on the host or a downstream hub). This should allows
> you to give them persistent names.
> 
> Here's an example for serial ports, I assume the same can be done for audio
> devices:
> 
> http://askubuntu.com/questions/49910/how-to-distinguish-between-identical-us
> b-to-serial-adapters

Thanks.  From this and the link provided by Ralph, it looks like I should be 
able to do what I want, based on the physical USB socket that the device is 
plugged in to.

This is ideal, because if the device ever fails, we don't want to have to 
reprogram the code, just because someone substitutes the spare.  We just have 
to ensure that the User Manual makes it clear that it is important that the 
correct socket is used.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Things discussed and results:

2016-12-10 Thread Terry Coles
On Saturday, 10 December 2016 10:14:35 GMT Terry Coles wrote:
> My cunning plan thereby comes crashing around my ears.  I only have one of
> the devices here at the moment, but it advertises iSerial as '0', so I've
> no doubt the others will also be called that.
> 
> The system will be run headless except when the code is being developed or
> debugged, so how can I find a foolproof way to identify which channel is
> which? The alternatives to using these devices work out at £30 - £40 per
> channel because they are aimed at the hi-fi market.  These devices are
> about £3 each.
> 
> I've already considered using the hdmi audio channel and putting one track
> on the left channel and one on the right, but that would require that the
> Wimborne Model Town Staff have a means to create the specially crafted mp3
> files.  I'd rather not go down that path.
> 
> Any other ideas?

Answering myself, I suppose that the obvious answer is to play one track into 
the hdmi audio channel and the other track into the USB audio device, (which I 
can identify from its vendor ID).

It seems a bit of a kludge though, so suggestions will still be gratefully 
received!!

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Distinguishing USB Devices. (Was: Things discussed and results:)

2016-12-10 Thread Terry Coles
On Saturday, 10 December 2016 10:53:46 GMT Ralph Corderoy wrote:
> What's the vendor:product ID shown by lsusb?  Some things offer a means
> to set the serial number.  It's unlikely in this case, but worth a
> Google.

I only found examples of the output of lsusb for these devices (Vendor:Product 
0x0d8c:0x013c (C-Media Electronics, Inc :  CM108 Audio Controller)).  These 
examples all said that iSerial was 0, so it looks like that's universal.

> And I think you said in a sealed box, so no switch whereby an operator
> can flip them around if they're wrong after a boot?  Or request a test
> play, etc.  And they're off the network.

We do have switches to control the playback modes and other features of the 
system, so we could use something like that (I had wondered myself).  The 
problem that I see is that the two devices may not just be flipped around, they 
may actually have been allocated to a totally different port, so it could be 
quite a laborious process
 
> I think the port may not change if you don't physically move the USB
> connector?  But it can be assigned a varying device name and that's the
> problem.  Investigate the tree of USB devices, `lsusb -t'.  `find
> /dev/bus/usb | sort' will show the ports you have available to use, I
> think.  Understanding this particular answer may help:
> http://www.linux-usb.org/FAQ.html#i6  Ah, here's someone showing how to
> walk the path to find the port numbers.  http://superuser.com/a/974522

The idea of using the physical connection from the last link looks promising.

> Pick randomly, play a test on reset, and have them power cycle if it's
> wrong.  It has to be random since Linux's allocation may be consistent
> for a good few goes in a row.  Sourcing randomness might be a problem.
> 
> Put the output of `sudo lsusb -v' into a file.  Copy it.  And cut each
> down so one of the adapters is in each.  Then compare, e.g. diff(1), to
> see if anything else might consistently be different.

I won't be able to get hold of the other two devices (one's a spare) until 
Monday, but I'll certainly have a look then.

It'll need extensive testing to be sure of the solution though.

Thanks for the ideas.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Things discussed and results:

2016-12-10 Thread Terry Coles
On Saturday, 10 December 2016 00:44:51 GMT Ralph Corderoy wrote:
> Terry has two USB audio adapters plugged in and wants to always play one
> track so it comes out of the "left" one and the other track to emit from
> the "right" regardless of the order they were enumerated by Linux.
> They're the same product from the same vendor.  Terry, there is a
> "serial number" field in the USB descriptor, but you may find it's not
> set to a unique value by the manufacturer.  `sudo lsusb -v' will show it
> as `iSerial'.

My cunning plan thereby comes crashing around my ears.  I only have one of the 
devices here at the moment, but it advertises iSerial as '0', so I've no doubt 
the others will also be called that.

The system will be run headless except when the code is being developed or 
debugged, so how can I find a foolproof way to identify which channel is which? 
 
The alternatives to using these devices work out at £30 - £40 per channel 
because they are aimed at the hi-fi market.  These devices are about £3 each.

I've already considered using the hdmi audio channel and putting one track on 
the left channel and one on the right, but that would require that the 
Wimborne Model Town Staff have a means to create the specially crafted mp3 
files.  I'd rather not go down that path.

Any other ideas?

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Identifying USB Audio Adaptors (Was) Things discussed and results:

2016-12-15 Thread Terry Coles
On Saturday, 10 December 2016 12:00:37 GMT Terry Coles wrote:
> On Saturday, 10 December 2016 11:45:03 GMT William R Sowerbutts wrote:
> > You can write a udev rule to name the device according to the USB port it
> > is plugged into (either on the host or a downstream hub). This should
> > allows you to give them persistent names.
> > 
> > Here's an example for serial ports, I assume the same can be done for
> > audio
> > devices:
> > 
> > http://askubuntu.com/questions/49910/how-to-distinguish-between-identical-> 
> > > us b-to-serial-adapters
> 
> Thanks.  From this and the link provided by Ralph, it looks like I should be
> able to do what I want, based on the physical USB socket that the device is
> plugged in to.
> 
> This is ideal, because if the device ever fails, we don't want to have to
> reprogram the code, just because someone substitutes the spare.  We just
> have to ensure that the User Manual makes it clear that it is important
> that the correct socket is used.

I spent quite a bit of time trying to get this to work, because although I 
could easily see 
the physical interfaces in /sys/bus/usb/devices/, I 
found it quite difficult to identify the corresponding interfaces in /dev so 
that I could write 
the udev rules.  Initially I was working with this machine (my Dell Optiplex), 
plugging three 
Adaptors into the USB ports on the front.  I persevered because I noticed 
pretty soon that 
the Card Numbers given by aplay -l were never the same twice, so it looked like 
I needed 
to use this technique.  I was beginning to think I was going to have to think 
again about 
how I guaranteed that the sound came out of the correct speaker.

Then I tried it on my Pi Zero, using one of these 'Naked' USB Hubs:

https://www.modmypi.com/raspberry-pi/accessories/usb-hubs/hackable-naked-7-port-usb-hub-uk-5v-2.5a/?search=USB%20Hub[1]
 

Surprise, surprise; the three devices always came up in the same order! 

Anyone know why that happens with the Pi setup and not on my PC?

-- 



Terry Coles


[1] 
https://www.modmypi.com/raspberry-pi/accessories/usb-hubs/hackable-naked-7-port-usb-hub-uk-5v-2.5a/?search=USB%20Hub
-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] Next Meeting - (Less than) One Week Tonight

2016-12-01 Thread Terry Coles
On Thursday, 1 December 2016 17:28:16 GMT Terry Coles wrote:
> All,
> 
> This last week has been just one damn thing after another so I forgot the
> usual reminder on Tuesday.  Hopefully, I'm over the bad patch, so:
> 
> The next meeting is now less than one week tonight at The Broadway,
> Bournemouth on Tuesday, 2016-11-06 at 20:00.  See:
 ^
 Should be 2016-12-06 of course
 
> http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway
> 
> Paul,
> 
> Are you going?


-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Next Meeting - (Less than) One Week Tonight

2016-12-01 Thread Terry Coles
All,

This last week has been just one damn thing after another so I forgot the 
usual reminder on Tuesday.  Hopefully, I'm over the bad patch, so:

The next meeting is now less than one week tonight at The Broadway, 
Bournemouth on Tuesday, 2016-11-06 at 20:00.  See:

http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway

Paul,

Are you going? 

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2016-12-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-06 Thread Terry Coles
On Thursday, 5 January 2017 14:10:38 GMT Terry Coles wrote:
> It looks as though I could fix this with a multi-TT hub, as suggested by
> William, but the cost may be prohibitive.  There is a hub that is specific
> to the Zero that is sold by the Pi Hut for £10.  I would need to ask them
> these questions to find out if they support at least one multi-TT channel.

It turns out that the Pi Hut device is not multi-TT, in fact they specifically 
warn about this in the User Manual and describe the penalty of using USB V1.1 
devices with it, so that's no go.

Having done an extensive search, it seems that the cheapest Multi-TT Hub on 
the market at the moment is the Pi 3!  It just happens to have a pretty 
capable micro-controller attached :-)

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-06 Thread Terry Coles
On Thursday, 5 January 2017 15:12:10 GMT Ralph Corderoy wrote:
> One last idea.  It used to be you'd build an MP3 player from an MCU and
> a $7 MP3-decoder chip.  The Pi Zero could replace the former and should
> be up to flinging SPI data to more than one of them.
> 
> http://www.vlsi.fi/en/products/:-).html
> http://fun4diy.com/CCS_MP3.htm
> https://www.sparkfun.com/products/8126

That would be a good way of doing it if we just wanted a standalone MP3 Player 
with a simpler UI.  RS Components even do an evaluation board which implements 
an MP3 Player, with LCD display and UI based on a menu and a toggle switch.  
The cost is £11 plus VAT, plus the cost of the VS1011 chip; probably about £20 
all told.

The problem is that we want the UI to be simple toggle switches on the front 
of the ammo-box case for the system and the two players need to be 
interactive, so that they don't try to fight each other and so that we can play 
a wedding sequence which consists of bells chiming in the Tower, a Wedding 
March and Widor's Toccata in the Chancel and then more bells in the Tower.  
Doing it in a single device makes that much easier.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-06 Thread Terry Coles
On Friday, 6 January 2017 11:17:48 GMT Stephen Wolff wrote:
> It might be a silly suggestion - but could you use multiple Pi Zeros,
> given that their cost is much less than the Pi 3?

That has been discussed and could be done using GPIO pins to achieve the 
interactive requirements (see my other post).

The main reason I've avoided it to date is that we would need another PSU 
brick as well as another Pi.  The equipment and case for the mains supplies 
has already been procured and only has room for two bricks, so the knock on 
effect is fairly expensive.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-03 Thread Terry Coles
Hi,

My previous request for a loan of a powered Hub took me a step closer to 
resolving my 
problem (thanks David).  The problem is that although I think I know now what 
is causing 
the problem, I don't know what it is doing to the machine.  

So when I plugged David's Hub in, instead of the 'Naked' Hub, I got exactly the 
same 
symptoms as I got with my own Hub.  So, the 'Naked' Hub isn't the cause and 
neither is 
the supplied PSU Brick.

After lots of testing, using different combinations of devices plugged into the 
Hub, I have 
arrived at the conclusion that the Audio Adaptors are the problem:

1. I have got an Edimax WiFi dongle, a mouse, a keyboard and three Audio 
Adaptor 
dongles plugged into a hub. Nine times out of 10, if I boot into a shell in 
Raspbian Pixel, 
the system is OK and I can see all three Audio Adaptors using lsusb or aplay -l.

2. On the tenth occasion, I get no response from the keyboard.

3. If I successfully boot into the shell and then type startx, the mouse 
invariably freezes.

4. If I only plug one adaptor into the hub, I can usually get into Pixel, but 
it occasionally 
freezes. 

I've looked in /var/log, but I'm uncertain what I'm looking for.  The file 
'messages' seems 
to contain a conglomeration of messages from the kernel and elsewhere, but I 
can't see 
anything that leaps out of the screen at me.

Does anyone know where I should be looking?

-- 



Terry Coles
-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] Next Meeting - Tonight

2017-01-03 Thread Terry Coles
Hi,

Don't forget the meeting tonight; 8 pm at the Broadway.

See:
http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway[1] 

Paul and I will be there.

-- 



Terry Coles


[1] http://dorset.lug.org.uk/wiki/doku.php?id=meetings:pub#the_broadway
-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-03 Thread Terry Coles
On Tuesday, 3 January 2017 16:39:02 GMT steampunkprofessor wrote:
> Looks like you got the power supply covered then. Beyond checking dmesg and
> going on forums I'm afraid I have little else to offer, I assume it's not
> overclocked. The flash symbol appears top right on my desktop. Had it when
> running my Pi off a battery bar, not that I had any operating issues. 

No it's not overclocked.

Also, I forgot to mention; I get the same behaviour with my Pi 2.

I'm waiting for responses on various forums.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-03 Thread Terry Coles
On Tuesday, 3 January 2017 16:56:50 GMT Ralph Corderoy wrote:
> I'm just passing by so haven't read back over the thread, but it sounds
> like a power issue to me.  Have you this page, and in particular the
> anchored section?
> http://elinux.org/RPi_Powered_USB_Hubs#USB_Hub_Power_Hookup

:-)  I just answered this off-list (I didn't notice that steampunkprofessor 
sent to me direct).

The answer is yes; that's exactly what I am doing.

-- 



    Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-01-03 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Terry Coles
On Tuesday, 3 January 2017 14:23:45 GMT Terry Coles wrote:
> My previous request for a loan of a powered Hub took me a step closer to
> resolving my problem (thanks David).  The problem is that although I think
> I know now what is causing the problem, I don't know what it is doing to
> the machine.
> 
> So when I plugged David's Hub in, instead of the 'Naked' Hub, I got exactly
> the same symptoms as I got with my own Hub.  So, the 'Naked' Hub isn't the
> cause and neither is the supplied PSU Brick.
> 
> After lots of testing, using different combinations of devices plugged into
> the Hub, I have arrived at the conclusion that the Audio Adaptors are the
> problem:

Not in fact the problem, see :

http://forum.modmypi.com/technical-support/usb-audio-adaptors-pi-locking-up-when-booting-t1041.html#p4482

It turns out that the problem seems to be that the Hub is connected via a USB 
port on the Pi (the only one in the case of the Zero).  It looks like that 
port cannot handle the conflicts when all the Audio Adaptors shout at once.

If I plug all the Adaptors directly into a Pi 2 or Pi 3 (even when I am using 
a hub for the other devices (mouse, keyboard, WiFI)), everything works.

That means that I cannot use a £4 Pi Zero and must use a £30 Pi 3 (the Pi 2 is 
now £32).

Unless   Someone knows how to resolve the issue.  (These devices are USB 
V1.1 and that means that the whole hub runs at V 1.1 speed).

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Terry Coles
On Wednesday, 4 January 2017 15:30:01 GMT Ralph Corderoy wrote:
> > > Have you this page, and in particular the anchored section?
> > > http://elinux.org/RPi_Powered_USB_Hubs#USB_Hub_Power_Hookup
> > 
> > The answer is yes; that's exactly what I am doing.
> 
> So you saw "This section describes two tests that will verify that a USB
> hub has the correct power circuitry"?

Yes.  Although I didn't run them because the problem occurs with more than one 
hub type, including David's with 3 A shared by all ports, and because I have 
now discovered that the problem is the single port that carries all of the USB 
traffic; see my other post.
  
> As mentioned last night, a USB device requests a current allowance.
> `sudo lsusb -v' will show lots of interesting information that's really
> worth reading through;  ignore what doesn't make any sense.  The sudo is
> required.

I added a line to config.txt; 'max_usb_current=1, which doubles the current 
available to each device (in this case the whole hub) to 1.2 A.  This was 
advised by Jake on the ModMyPi forum, but it didn't help.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-04 Thread Terry Coles
On Wednesday, 4 January 2017 15:50:00 GMT Ralph Corderoy wrote:
> > It turns out that the problem seems to be that the Hub is connected
> > via a USB port on the Pi (the only one in the case of the Zero).  It
> > looks like that port cannot handle the conflicts when all the Audio
> > Adaptors shout at once.
> 
> I don't see a strong indication that's the cause?  What conflicts?

Well OK.  I am surmising that there are conflicts when the three devices are 
all shouting.

> The different Pis have different USB hardware, and different Linux
> drivers to talk to them IIRC.  And those drivers change over time.  Try
> a distro with a dramatically different kernel version, like an old one.
> It will be another data point.

This problem occurs with a Zero, a Pi 2 and a Pi 3, so I'm discounting the 
hardware at the moment.  I am using the same SD card running Raspbian Jessie 
on all three.  The problem only occurs (and it occurs every time) if I try to 
connect the hub through one USB port.

I will have a look at using an old distro, but the fact that the Adaptors work 
OK when they are accessed through separate USB ports seems to preclude driver 
issues to me.  Maybe I'm wrong.

> Also, I think `journalctl -f' might be interesting to watch as you do
> things.  You can tap Enter to give you a bit of blank space now and
> again so you can see what's new.  You can try doing this over an SSH
> connection to the Pi for when you run `startx', but given networking is
> also over the Pi's USB port I'd really recommend you use the Pi's serial
> port and set the Linux console to use that.  Cables are available.
> 
> http://elinux.org/RPi_Serial_Connection
> http://amzn.to/2iAd006

I tried SSH.  As predicted the Pi is inaccessible.  I could pay for a third of 
a Pi 3 for the cost of one of those leads :-)

> Other thoughts: startx(1) will prod USB as well as creating CPU load
> causing the ARM to draw more power as its frequency increases.  Try and
> create a CPU load some other way;  this should make one core busy and
> you can run it in the background so you can kick off one per core if
> need be.

Wouldn't that also be a problem when the Adaptors are plugged directly into 
the Pi?

> gzip -9 /dev/null
> 
> Check `dmesg' output.  `dmesg -w' will wait for new output, similar to
> journalctl above.

Will need the £11 cable to do those things.

> Replace the audio USB adapters with other devices that will want
> significant current to see if it helps spot when it's the £3 Chinese
> audio USBs or a power issue.

Yes.  Paul says that he has some USB speaker-phone adaptors that I can borrow.  
Otherwise, I suppose I could scrape together some USB hard disks, but they 
tend to be self-powered, so not necessarily conclusive if they work.

I've now raised this on the Raspberry Pi Forum, so my next move is to see what 
they say.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-05 Thread Terry Coles
On Thursday, 5 January 2017 12:17:05 GMT Ralph Corderoy wrote:
> > I ran lsusb on the hub Terry tried and it does show up as single-TT,
> > although it does show up as 4 hubs.
> 
> I filtered out some of its more interesting lines to try and lessen the
> noise, giving http://pastebin.com/GSu1Cb8A
> That says "bDeviceProtocol 2 TT per port" a couple of times so I think
> it may be multi-TT?
> 
> Terry, how about using the Pi Zero's GPU to do audio on HDMI for one
> output, and putting a single USB audio adapter directly into its OTG
> port for the other?  No hub.  You've GPIO for the RTC IIRC.  And if you
> need networking then there's the UART and PPP?

I've been shopping; so haven't tried any of the suggestions made to date.  
However, I did post an update to my query on the Raspberry Pi Forums before I 
went out:

https://www.raspberrypi.org/forums/viewtopic.php?p=1092584#p1092584

This outlines a couple of theories that I have after reading your link to the 
Pi documentation.  I rather suspect that the RPi 2 and 3 hubs are not multi-
TT, so I'm leaning towards the multi-core effect as being the reason that the 
bigger Pis work.

Your suggestion to use a HDMI adaptor has merit and in fact was one solution 
that I looked at very early on in the design.  I will still need a hub though, 
because we said that we would put the MP3 files onto a USB stick, so that the 
WMT staff can change them without having to speak linux.  That would put the 
Audio Adaptor back in the hub (only one though) and I've definitely seen lock-
ups with only one Adaptor plugged in.

Also.  The HDMI Adaptor would increase the number of different devices which 
might need sparing, whereas we already have a Pi 3 + one spare for the 
webserver part of the development.  We would either live without the spare or 
bite the bullet and buy one more.

-- 



Terry Coles

-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

Re: [Dorset] How can I discover why my RPi freezes after it has frozen?

2017-01-05 Thread Terry Coles
On Thursday, 5 January 2017 12:17:05 GMT Ralph Corderoy wrote:
> > I ran lsusb on the hub Terry tried and it does show up as single-TT,
> > although it does show up as 4 hubs.
> 
> I filtered out some of its more interesting lines to try and lessen the
> noise, giving http://pastebin.com/GSu1Cb8A
> That says "bDeviceProtocol 2 TT per port" a couple of times so I think
> it may be multi-TT?

Here are the outputs of lsusb -v on the Pi Zero and the Pi 3:

http://hadrian-way.co.uk/Misc/Pi0_lsusb-v.txt[1] 

_http://hadrian-way.co.uk/Misc/Pi3_lsusb-v.txt_ 

If you look, you will see that the Pi 0 only has single-TT while the Pi 3 has 
one Multi-TT.

It looks as though I could fix this with a multi-TT hub, as suggested by 
William, but the cost 
may be prohibitive.  There is a hub that is specific to the Zero that is sold 
by the Pi Hut for 
£10.  I would need to ask them these questions to find out if they support at 
least one 
multi-TT channel.

-- 



Terry Coles


[1] http://hadrian-way.co.uk/Misc/Pi3_lsusb-v.txt
-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

[Dorset] That Pesky Documentation Again

2017-01-07 Thread Terry Coles
Hi,

Way back in September I asked for help to understand the documentation for 
apscheduler.  Help duly came and I got a program working to trigger functions 
to rung 
the bells every time an hour or a quarter hour arrived.  This is what I ended 
up with:

http://hadrian-way.co.uk/Misc/minsterbells_v04py[1] 

Unfortunately, since then, apscheduler has been updated and now my code doesn't 
work 
because the module no longer has a scheduler method.  Instead, there is now a 
choice of 
schedulers, see:

http://apscheduler.readthedocs.io/en/latest/userguide.html#choosing-the-right-scheduler-job-stores-and-executors[2]
 

and I think that BackgroundScheduler looks the most likely candidate to do what 
I want.  
Unfortunately, I am up against the same problem that I had in September; 
getting my 
head round the docs.

Can anyone help me to get the right syntax to replicate the old functionality, 
assuming 
that my choice of scheduler is the best one for us.  Those who have followed 
this saga will 
recall that I want to create and MP3 player to play organ music as well as ring 
the bells 
and I want the functions to be interactive.

-- 



Terry Coles


[1] http://hadrian-way.co.uk/Misc/minsterbells_v04py
[2] 
http://apscheduler.readthedocs.io/en/latest/userguide.html#choosing-the-right-scheduler-job-stores-and-executors
-- 
Next meeting:  Bournemouth, Tuesday, 2017-02-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

<    4   5   6   7   8   9   10   11   12   13   >