• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Data logger
#1
Dear Support Team,

I 'm working with a netPi (NIOT-E-NPI3-51-EN-RE) and I want to know, if it's possible to use that Device as Data logger?

The device had 4x USB Slots and I want to connect one of it with a hard disk.
It would be great, if it's possible to program it in NodeRed.

I hope you can help me.
Best regards,
Jan
  Reply
#2
Hi there.

my first question is about the data loggin function. Where do you want to write the logged data to? Onto netPI's SD card or onto the hard disk? Or are these data just stored in memory and then shifted over the ethernet port to a server for example?

Then a word to the hard disk. How much power is this hardware consuming? I have personally used USB sticks as hard drives so far which consume for sure less power than a hard drive. Will it be of type SSD or HDD? If this disk drives maps to a /dev/ttyusb alike device then you can use it on netPI as this thread describes https://forum.hilscher.com/thread-439.html. You have to map this drive when the Node-RED container is started and then you have to mount the drive to "look" into the drives folder structure.

I do not understand the question about Node-RED. The file you want to write to for data logging ... will it be a database like a time series data influxdb is providing or an SQL database or is it you very own privat format and a kind of simple text file? As far as I know default Node-RED does not support writing and reading from a file directly ... you need to modify the Node-RED settings file and include the fs (file system) library with a command like let fs = global.get('fs'). And then you can use the function node to program read/write file accesses. I have never done this before to be honest.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
Hi Armin,
thank you for your answer.

Here some more Information about my project. Now I’m using the NetPi as a “translator”, it receives MQTT messages and translate it to Profinet. I’m working on a communication to both sides (from MQTT to Profinet and from Profinet to MQTT).

In the next step, I want to implement a data logger on the NetPi. I want to save the messages on a hard disk, I prefer SSD. I would like to use one of the NetPi’s USB Slots to connect it with the SSD. The highest consuming Power is 3 Watt, maybe less.
In the easiest case, the messages get a time stamp and are saved on the hard disk. But there is lot of traffic on the bus, so it would be better (when it is possible) to use a database.
In the best case, it is possible to get data from the database over Profinet or Ethernet. I have no idea if that is possible. But if you have a good idea for me, I’m very thankful.

Best wishes,
Jan
  Reply
#4
Well Jan,

you say a lot traffic? What does that mean? netPI cannot listen just to PROFINET telegrams like Ethernet Wireshark ... it is just a PROFINET device the PROFINET chip inside writes the data received from the master in a buffer where an application on Linux side can get a copy from. The same for the other direction.

So what is your expected update rate of this buffer exchange with the netPI PROFINET chip and Linux?

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#5
Hi Armin,

I mean with a lot of traffic only 300kByte/s. I think, that is no problem for the Profinet chip.
Anyway, what do you think about the Data logger function? Would you say it is possible to realize it on the netPi?

Thank you for your help.
Best regards,
Jan
  Reply
#6
Sure it is possible.

Here is how I would do it:

1. I would use the netX-programming example container from here https://registry.hub.docker.com/r/hilsch...-examples/
2. I would run the PROFINET example directly to check if it is running
3. I would change the default input/output data size of the PN example from 4 bytes inputs and 10 bytes output to 256bytes input and output to have more data
4. I would modfiy the the example to send the data instead of printing it on the screen to the local Docker internal IP network in InfluxDB (database) API based TCP/IP format and to a second container hosting the InfluxDB database.
5. I would start a second container InfluxDB (time series database) with the SSD USB drive mounted into this container and a mount point. The influxDB is configured to write its database data to this mount point and hence the SSD drive finally
6. Since InfluxDB container has a web server, you can watch the data also in historical order or you can call it from anywhere in the world if your netPI has internet contact.

The best thing is, if you do not want to let run the InfluxDB database on the netPI you could host it on a Windows Machine for example. In your example you have just to change the destination IP where the TCP/IP telegrams are sent to.


Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#7
Thank you very much Armin for your answer.
  Reply
#8
Hey Armin,
I have a question for my project. Can you tell me, how I mount a USB-Stick?
I tried it with the normal commands, but under /dev/, I can’t find anything. Then I read in your Forum, that we have no permissions.
I hope you can help me.
Regards,
Jan
  Reply
#9
Well you need to know to which /dev/ your USB stick is mounted. This can be detected

a.) watching the system log file of netPI that you can find in netPI's web UI control panel which usually is logging any system relevant information or if this does not help
b.) plugging the USB stick into a normal Raspberry Pi and reading the /dev/ folder to see to which /dev/ the stick is mounted

once you have noticed to which device it was mounted then you have to map this /dev/... to the container within the netPI environment, then it is done. Later in the container runtime you have to mount the drive finally.

There are other posts who have successfully mapped USB device like

https://forum.hilscher.com/thread-231.html or
https://forum.hilscher.com/thread-207.html
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#10
Good day Armin,
thank you for your answer. Now it is possible for me to mount my USB-Stick.
But there is the next problem: How can I change the path without an editor?
If I understand it right, the default path is: “etc/init.d/influxdb:DEFAULT=/etc/default/influxdb”
This is the location were the Data from my influx Database are saved.

But I want to save the Data on my USB-Stick. How can I change the address in the config file without an editor?
Thank you for your help.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  5 x NL 50-Mpi and Node Red like colector data? Jotarod 4 219 September-14th-2020, 01:59 PM
Last Post: Armin@netPI
  Receive at startup additional data through the Fieldbus Port Schranz 1 174 September-10th-2020, 10:55 AM
Last Post: Armin@netPI
  how to pick up PROFINET data and store them to OPC UA server on Node-RED/netPI. tad 7 482 March-16th-2020, 10:21 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)