How to send csv file from micropython (on ESP32) to node-red as excel file

As a beginner in node-red usage, I wish to know how to send a csv file that I generated in python (and which is automatically stored in the ESP32) to node-red dashboard and keep it there in an Excel file format. I also wish the Excel file to be downloadable from node-red. Any help please?

Welcome to the forum @Donatus

The first thing to consider is how to send the data to node red. What hardware/os is node red running on and how do plan to connect that to the device? For example via Wifi if on the same network, or serial connection or what?

How large is the file?

Do you need it as a csv file or have you suggested that because you can't think of an alternative?

What exactly do you mean by the 'node red dashboard`?

First, that you @Colin for reaching out to help.
Secondly, to respond to your questions, node-red is being run on Windows 10. The connection is over a wi-fi connection on the same network. The csv file was generated per my python code, and it is automatically stored in the ESP32 which I am using. However, I wish that the file be sent to the *node-red dashboard and from which the user can connect to using a search engine ( chrome) by typing the ip address of the server on which node-red and the mosquitto broker are installed and entering :1880/ui. Adding :1880/ui sends the user directly to the *node-red dashboard of the server.
The file is about 47348 bytes.
If the file is displayed in Excel format, I would greatly appreciate it. I have succeeded in converting the csv file to Excel format but again, I only know how to place it on the desktop of the computer but not to node-red (but the problem here is, the user won't have access to the desktop, only node-red user interface).
The data concerned are the vibration values of a drop Tour that I measured using a 3-axis digital accelerometer. So the objective here is, anytime the user(operator) performs a test on the machine, he should be able to download the data(preferably in Excel format) from node-red using his personal phone or laptop.

By node-red dashboard, I'm referring to the node-red graphical interface that displays, visibly, the data captured by the sensor just like in the attached photo.

I hope this elaboration is clearer enough to win your assistance. Thank you.

You can't send it from the ESP device to the dashboard, but what you can do is to send it to the node red server and then display it on the dashboard.

I would start by getting the transfer going. There are several ways you can do that. You could define an http endpoint in node-red and POST the data to node red, or you could use MQTT. Personally I would use MQTT but that is because I am familiar with MQTT. If you already understand http endpoints that that might be a better way. If you don't know about MQTT then have a look at MQTT Essentials - All Core Concepts explained which will explain what it is all about. There should be an MQTT library available for the ESP device.

As a beginner I also recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot in about 1 hour. A small investment for a lot of gain.

@Colin, thank you for the links. I use MQTT protocol too and specifically, the mosquitto broker. With esptool library, I am able to connect to the ESP device successfully. I'll give a glimpse at the link you sent on node-red essentials, and grasp the best out of it. Once more, thanks for your help.

Since it is only 45kB you should be able to send it as a string to an MQTT topic. Then in node-red you can use the CSV node to convert it into a javascript array.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.