Mobile App to Mosquitto Server communication

Hi team, sorry if this is a doom question but I wasn’t able to answer it myself by reading the forum.
I’m trying to find out if Streamsheets could be the platform of choice to achieve the following:

  • I develop mobile Apps (iOS and Android) using a high level programming platform named Livecode (www.livecode.com) by which I can send Post request to any given URL
  • My App should interact (send commands and read responses) with a Mosquitto server running on Linux

Would it be possible? If answer is yes what kind of environment should I have available, is there any tutorial I can follow?

Hope I was able to make myself clear enough.

Many thanks in advance.

Regards from Brazil

Hi oldNerd,

Sorry for the long wait, we had a DNS change and this took us sometime. :slight_smile:

This is totally possible.
Streamsheets comes with the Mosquitto broker preinstalled, so you can use it locally.
We use docker as the environment to run everything in.

If I understand you correctly, you will need an HTTP Server to interact with.Streamsheets can be a HTTP Server, but this is a premium feature. If you already have a Server to send your commands to, Streamsheet could interact with this server and build the bridge between HTTP/REST data and MQTT data.

Here we show how to use HTTP/REST:

Here we show how to connect to an MQTT Stream:

And here how to work with Inbox messages:

If you connect all these 3 together you should be able to manage your Use Case :slight_smile:

Have fun and let me know if you have any further questions.

Cheers

Tizian

Hi Tizian, many thanks for your answer. I guess I didn’t make myself clear. Instead of an HTTP Server I would need and HTTP client (could be a browser) to send requests to a Mosquitto server and read back the responses. I was thinking about using Streamsheets as the middle man between the two environments…
Hope is more clear now.

Best!

Hi oldNerd,

I’m not quite sure what you mean. Mosquitto has very very basic webserver capability through the websockets library, but it only supports static pages. I don’t think that’s what you mean. The only useful thing you can to talk to Mosquitto with is MQTT, either over straight TCP or over websockets (which originates as an HTTP connection, but is quickly upgraded).

Could you give us a few more details on what the use case looks like?

Regards,

Roger

Hi Roger, many thanks for you answer and sorry for not being clear (english is not my native tongue) . I’ll try again…

I develop mobile Apps (iOS and Android) using this high level development tool called Livecode (www.livecode.com) which doesn’t have native support to communicate with a Mosquitto server.

Since on the other hand I can post to a given URL and/or have a browser running on my own App I though maybe Streamsheet could be used as a bridge between my App and the Mosquitto server I’m trying to reach.

Hope is clearer now and hopefully doable

Regards

Hi oldNerd,

Thank you, that’s clear now. So you want to know if this is possible:

livecode —(http / rest)—> streamsheets —(mqtt)—> mosquitto

In other words, your app communicates with streamsheets using http/rest. You then have a streamsheet that converts your message into the right format (if needed) and then publishes it to the mqtt broker. Responses from the broker work in the same way, you have a streamsheet that subscribes to the broker and then sends messages back over http/rest in the correct format.

Does that sound correct?

Regards,

Roger

That’s exactly what I’m looking for. Many thanks your for putting it in plain english…

Is it possible? If answer is yes, how can I get started?

Cheers

Perfect,
Yes this is possible. The OpenSource version supports webhooks. There is a webhook connector and consumer in your administration.

If you add the consumer to an inbox, you will receive HTTP calls from specified URLs. This way you can post information to Streamsheets and map them into MQTT.

I have added a simple StreamMachine to explain.

The base URL is:
http://localhost:8083/request/

The further URL parts will be defined through the Connector:
image
and Consumer:
image

so the combined URL is:
http://localhost:8083/request/cedalo/streamsheet

Since you need this to be available online, Streamsheets needs to be installed in the cloud under a domain name.

Download example:
Webhook to MQTT example.json (17.4 KB)

@Tizian and @Roger, many thanks for your answers and guidelines. I’ll explore it further in the near future.

I really appreciate your time to help

Regards

1 Like