I think you will need to do something like this:
msg$ = Str$ TestTag@
MQTT “publish”, “ewons/test/messages”, msg$, 0, 0
But, if you want to send me your code I can take a look at it and give you some suggestions.
P.S. Just a reminder to look in the BASIC IDE, in the Run tab at the top, to find the Auto Run option.