Send Text-Data to Sheet

Hey!

I’m useing Version 1.3.0 on a Rasperry Pi and want to send the contents of a text file (located on Rasperry) to a stream machine. The file has eg the content “1234”.

  1. Unfortunately my attempts with “File Connector” / “File Provider” did not work because I did not find a functional description.

  2. Also with the command line program “mosqitto_pub” I did not get any further: Via the command line topic / payload are sent without error message, but unfortunately they do not arrive in the stream machine. But I can send the same topc / payload to an MQTTfx that is running on another machine.

  3. Another question has arisen: Why can the MQTT connector only be used with the default username / password combination (cedalo / fc3fd1db-274e-4eec-b952-7ff4e1270e12)? After a change or deletion of this access data, the connector stops working.

Are there any approaches to solve my problem?

Bernd

1 Like

Hi Bernd,

Thank you for your question :slight_smile:

1. File Provider

The File Provider is mounted to a specific folder. (can be changed in the .yml)

/tmp/examples/filefeeder

Put your file in this folder and add a Connector and Consumer like this:


In the Consumer it is theoretically possible to define sub folders. In this scenario the file is in the “filefeeder” folder (root folder) so no further folders have to be set.

A connected Consumer now pulls the files from the folder in the specified update interval. (2 seconds)
Every processed file will be put in a new folder within the folder called “out”. This way data is not processed twice and data is not lost.

Create a machine with the created Consumer and start it. Every new file within the update interval will now be processed by the Consumer and pushed to a Stream Machine.

I will be uploading a more detailed explanation soon.

2. MQTT

The problem here may be, that the Connector is using the base topic “cedalo” as default. So your Consumer maybe listening to "cedalo/<your_topic>

3. Broker
Until now, it is not possible to adjust the broker settings we are working on this and will make this available in a future release.

I hope this helps,

Cheers Tizian

Hi Tizian,

thank you for your quickly posted answers!

1.) File Provider
It works :blush:
In your screenshoot, I see the “Insert Drawing Shape” Button. I saw it in Christians Blog [https://streamsheets.blog/2019/08/12/connecting-the-iphone-to-streamsheets-via-mqtt/] too, but not in my maschine. Is it a bug or do I use an other version?

2.) MQTT
Sorry, I did not say it clearly: I want to send data from a shell script to a stream machine. I tried that on the Raspberry with the call “mosquitto_pub -d -u cedalo -P fc3fd1db-274e-4eec-b952-7ff4e1270e12 -t Mati/time -m 22:19:32” and expect in the inbox of my machine under the topic “Mati/time” to find the payload “22:19:32”. Unfortunately that does not work. The message is issued without an error message, but does not arrive in the stream machine. Do you have an idea for debuging and/or get it work?

Have a nice day and
MfG Bernd

Hey Bernd,

You are welcome :slight_smile:

1. Shapes
This is still in Beta :wink: to check it out, check the “Experimental Features” in the Info Menu. (click the avatar on the top right and then on “Info”)
image

2. MQTT
Can you check your Streamsheet please? Somewhere, there has to be a wrong input. :thinking:
Check out my settings:


I’m using the “MQTT Box” for the message simulation. As you can see, I´m connected to the “raspberrypi:1883” Broker and I’m sending messages to the topic “Mati/time”.
The Inbox is set to:

With the Consumer Settings:

And the Connector Settings:

It is important to check what kind of “Data Format” is checked in the Consumer.
If eg. JSON is set, you would get an Error Message: “Invalid data for mimeType application/json”
Setting it on Auto is usually the best solution.

I hope this solves your problem :slight_smile:

Cheers

Tizian

Hi Tizian,

thank you very much for the explanations.

1.) Shapes:
The note that it is a beta function is important :slight_smile: Nevertheless, quite a lot works already. Great!

2.) MQTT
I misunderstood this, but I see more clearly after your explanation. Actually I wanted to send ONE message, which transmits several data points. That was not clear to me before your explanation :roll_eyes:. I have solved this now:
mosquitto_pub -d -u cedalo -P fc3fd1db-274e-4eec-b952-7ff4e1270e12 -t Mati -m “{” dummy": 1, “epoch”: 1571259196, “time”: “20:53:16”}"

My next task will be sending back data from the sheet to a Raspberry script. I think I’ll play around with the file provider and MQTT provider- let’s see which one I like better. But first is a week’s break …

Thanks again for the good help

Bye
Bernd

PS: Just a cosmetic problem: Can I change the owner of an existing machine, connector, consumer or provider?

Glad to hear.

Unfortunately we do not have a feature yet, which supports changing the owner of an entity.
Thus, this makes sense. We will add this feature in a later release.

Cheers,

Tizian