How do you send the data to hex in MQTT?

I have an MQTT gateway for Modbus that needs to receive in hexadecimal. How can I do this?

No-one seems to have an answer for this. Have you made any progress ?

Maybe you could encode it to base64 and then decode it at other end. I have done it in my tutorial, I encoded and decoded the image to base64 and sent it through MQTT.

<!DOCTYPE html>
         How to convert image into base64 string using JavaScript ?

     <input type = "file" name = "" id = "fileId" onchange = "imageUploaded()" >
     <button onclick = "displayString()" >
         Display String

         let base64String = "";

         function imageUploaded() {
             let file = document.querySelector(
             let reader = new FileReader();
             reader.onload = function () {
                 base64String = reader.result.replace("data:", "")
                     .replace(/^.+,/, "");
                 imageBase64Stringsep = base64String;
                 // alert(imageBase64Stringsep);

         function displayString() {
             console.log("Base64String about to be printed");


Please do you have a video that explain How can I send and receive data from MQTT machine to my app inventor?