Re: [Dorset] Assistance debugging Python on Raspberry Pi.

2021-02-03 Thread PeterMerchant
On 29/01/2021 08:18, PeterMerchant wrote: I have a program on my Raspberry Pi  (subscriber) that gets MQTT messages from a broker (Mosquitto) also on the Pi, and lights LEDS depending on the content of the messages.  My final intention is to add my ultrasonic detector to this program. Note

Re: [Dorset] Assistance debugging Python on Raspberry Pi.

2021-01-29 Thread PeterMerchant
On 29/01/2021 10:36, PeterMerchant wrote: And I forgot to say, Thanks to Keith and Ralph for the help. -- Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00 Check to whom you are replying Meetings, mailing list, IRC, ... http://dorset.lug.org.uk New thread, don't hijack:

Re: [Dorset] Assistance debugging Python on Raspberry Pi.

2021-01-29 Thread PeterMerchant
I'm Getting somewhere. I changed the Logging.basic config to have a filename of /home/pi/mqtt/debug_log.txt  and took out the asctime and levelname formatting bits.   I added  the Logging. debug  lines in a couple of the functions. It worked in that the file is in that location, and one of

Re: [Dorset] Assistance debugging Python on Raspberry Pi.

2021-01-29 Thread PeterMerchant
You should find that file given your first debug() call as those lines work for me here. $ cat >peter.py import logging logging.basicConfig(filename='debug_log.txt', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') logging.debug('This is a log

Re: [Dorset] Assistance debugging Python on Raspberry Pi.

2021-01-29 Thread Ralph Corderoy
Hi Peter, > > Can you attach the output of > > > > diff -u working.py broken.py > > > > where you've done some simple change which breaks it, e.g... > > I can't do that because every time it fails I back it out to the > working code. I don't see why that means you can't have two files, one

Re: [Dorset] Assistance debugging Python on Raspberry Pi.

2021-01-29 Thread PeterMerchant
On 29/01/2021 09:22, Ralph Corderoy wrote: Hi Peter, BUT anytime I add anything to the program the subscriber stops firing the LEDs. ‘Anything’ is very vague. Can you attach the output of diff -u working.py broken.py where you've done some simple change which breaks it, e.g... I

Re: [Dorset] Assistance debugging Python on Raspberry Pi.

2021-01-29 Thread Ralph Corderoy
Hi Peter, > BUT anytime I add anything to the program the subscriber stops firing > the LEDs. ‘Anything’ is very vague. Can you attach the output of diff -u working.py broken.py where you've done some simple change which breaks it, e.g... > I tried to print to stdout in each function,

[Dorset] Assistance debugging Python on Raspberry Pi.

2021-01-29 Thread PeterMerchant
I have a program on my Raspberry Pi  (subscriber) that gets MQTT messages from a broker (Mosquitto) also on the Pi, and lights LEDS depending on the content of the messages.  My final intention is to add my ultrasonic detector to this program. Note that these LEDs are the test rig for my RC