Re: [Dorset] Python Problem in MQTT subscriber program

2021-08-27 Thread Patrick Wigmore
On Fri, 27 Aug 2021 14:02:19 +0100, PeterMerchant wrote: > Patrick, I am most grateful for your comments. You obviously know a > lot more about MQTT than I. I wouldn't say I know a lot about MQTT, and I did not mean to imply that I do. I have a fairly basic high-level understanding of it, but I'

Re: [Dorset] Python Problem in MQTT subscriber program

2021-08-27 Thread PeterMerchant
Patrick, I am most grateful for your comments. You obviously know a lot more about MQTT than I. I think that I'll have a little play with the software that I have working, and then start cleaning it up using some of your suggestions.  And perhaps read a bit more of the MQTT v5 spec. Much thank

Re: [Dorset] Python Problem in MQTT subscriber program

2021-08-27 Thread Patrick Wigmore
Hmm. I don't think I'm able to solve this. Referring to the full MQTT subscriber/car control program you sent me off-list, this is some of the context I was missing: It is using paho-mqtt, f.k.a. Mosquitto, and message is a MQTTMessage object, with message.payload being arbitrary bytes. It look

Re: [Dorset] Python Problem in MQTT subscriber program

2021-08-26 Thread PeterMerchant
On 26/08/2021 17:05, Patrick Wigmore wrote: On Thu, 26 Aug 2021 14:10:31 +0100, PeterMerchant wrote: Problem sorted, though I don't know why. I took out the hyphens in the Pot-Left & Right strings, and made them Pleft and Pright. and it does not crash. Peter. I don't know whether you are still

Re: [Dorset] Python Problem in MQTT subscriber program

2021-08-26 Thread Patrick Wigmore
On Thu, 26 Aug 2021 14:10:31 +0100, PeterMerchant wrote: > Problem sorted, though I don't know why. > I took out the hyphens in the Pot-Left & Right strings, and made > them Pleft and Pright. and it does not crash. > > Peter. I don't know whether you are still interested in getting to the bottom

Re: [Dorset] Python Problem in MQTT subscriber program

2021-08-26 Thread PeterMerchant
Problem sorted, though I don't know why. I took out the hyphens in the Pot-Left & Right strings, and made them Pleft and Pright. and it does not crash. Peter. On 23/08/2021 18:29, PeterMerchant wrote: I have three versions of this program, and two work, but the third with the differences put

[Dorset] Python Problem in MQTT subscriber program

2021-08-23 Thread PeterMerchant
I have three versions of this program, and two work, but the third with the differences put together crashes.   Can anybody advise me what is happening. Here are the relevant bits. 1. Working def on_message(client, userdata, message):    if message.payload  == b'forward':   up_15()    eli