My first thought is something really simple. Can i not send mqtt commands as payload on an AT command to ESP01? Exactly as per the simple Thingspeak example (see my recent posting). Easy on a picaxe.
Possibly. Getting data to the MQTT broker is pretty much the same as publishing to ThingSpeak; "This is my topic, this is its data". Simple as that.
But I don't know enough about MQTT to be able to say "and that's it". I imagine it might be for something which is just a publisher, but there may be some other house-keeping it has to do, there may be interactions required beyond just 'opening a URL'.
Most of the low-level stuff is hidden inside libraries so, for a computer, it's just -
result = mqtt.Publish( "My Beer Keg", ds18b20.ReadTemperature() )
But for a microcontroller one would need to implement what's in that library, what's in the libraries that uses. Basically unfurl the whole lot, then implement everything needed.
Hence why it's almost certainly better to have had someone else provide all that library code, write the program which does the above on an ESP or Pi, interfacing to a PICAXE which only has to issue SEROUT ( "My Beer Keg=", #w0, CR ).
For subscriptions and receiving data I really don't know, not even whether that data is pulled or pushed. It's the less likely use case for a PICAXE but I doubt one can simply ignore it. I'm sure it's easy with a library, something as simple as -
if mqtt.DataAvailable( "My Beer Keg" ): beerTemp = mqtt.ReadData( "My Beer Keg" )
But there will be a whole lot of stuff hidden within those libraries, all of which has to be implemented within a PICAXE for an AT type solution.
The latest MQTT 5.0 specification can be found here -
https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html
My suggestion would be to implement such an picaxe-mqtt interface device using MicroPython,
That's my inclination as well. A Pi or Linux PC is probably the best choice for implementing a local MQTT broker. Either can be used to get PC-based MQTT working locally, and both support Python and even MicroPython, both can interface to UART or AXE027.
So, get it working on a PC, and it should be easy to swap the PC for an ESP, PyBoard or other module running MicroPython using already proven code. Or just keep using the PC.
The advantage is that others can participate even without dedicated hardware. Problems can be more easily debugged on a PC.
But the big advantage is that others have done it all themselves. So there are plenty of examples and one only needs to worry about a few library calls and how they should be handled, not have to worry about how any of it works behind the scenes.
The smart peripheral approach means one can tell a PICAXE programmer, this is what you need, connect it like this, SEROUT ( "topic=", #dataValue, CR ) will send data, job done.
With the PICAXE sending AT Commands it's a whole lot more complicated, even the experienced will struggle and be battling PICAXE limited resources.
Two weeks ago I set up a simple mqtt-network in my house using an old Raspberry Pi as a mqtt-broker, and am currently investigating options to show/visualize data ... on a phone or PC
Which is the path I am going to walk. We'll see how it goes.