Feature request: MQTT for Webcore

Hi,
I was wondering if there are plans to port the excellent TMS MQTT client to a webcore compatible version..
Thanks,
Johann

Given our current client library is using threading, this isn't easy to port to web.
We recommend for now to use an existing & proven JavaScript library

This you can directly call from a TMS WEB Core application as you can use call JavaScript directly from an ASM block.

Is is possible to make a demo or example of using MQTT.js with Web Core? Been a pascal user sine the days of Turbo Pascal and Delphi 1 but am having a lot of trouble with this. Due to the increasing popularity of MQTT in a browser for IoT devices I am sure a lot of users would appreciate a sample or demo. Many thanks for your excellent components.

1 Like

We have not worked with MQTT.js from TMS WEB Core yet.
It is a good idea to give this a test. We've put it on the todolist to have a look at it when we can allocate time for this.

I need only to publish on MQTT from Web core.

Is better to declare and free the client in the asm block? How do I pass the pascal string variable to the asm block?

Is this the correct way? I get no error on compilation, but is not working.. :)

procedure Publish(txt: string);
begin
asm;
  const mqtt = require('../..')
  const client = mqtt.connect()

  client.publish('presence', txt)
  client.end()
end;
end;

Did you see:

2 Likes