Converting MQTT Wificlient code to TinyGsmClient with HC-SR04

I have this code (attached) based on Mqtt using ESP8266 wifi and i want to convert it to GPRS (using sim800L). Trying to use TinyGsmClient since my project required mobility but i dont know much on how to adjust the same . Anyone can assist in guiding me with this since iam new with Mqtt. Thanks

wastemqtt-1.ino (2.6 KB)

Trying to use TinyGsmClient since my project required mobility but i dont know much on how to adjust the same . Anyone can assist in guiding me with this since iam new with Mqtt.

Forget to adjust that code. You have to write your own MQTT library, the PubSubClient library expects a Client subclass as the interface to the communication device and I'm not aware of an implementation of that for an AT command controlled device.

Noted and thank for the feedback. I think it may be possible with the TinyGSM library. I will explore more on this and should i be successful i will post what i did here.