Hilscher Community Forum
[SOLVED] Storing data on a (remote) database - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: General Infos (https://forum.hilscher.com/forum-28.html)
+--- Forum: Projects (https://forum.hilscher.com/forum-41.html)
+--- Thread: [SOLVED] Storing data on a (remote) database (/thread-444.html)

Pages: 1 2 3


[SOLVED] Storing data on a (remote) database - MGharat - May-28th-2019

Hi Armin,

One of our customer wants to read data from AB PLC ( Ethernet/IP ) & store/log in to netPI & then want to export the database to a server...How we can do this with netPI? Can we use SQLite node with netPI?

BR
Madhumati


RE: Database storage - Armin@netPI - May-28th-2019

Well Madhumati,

if I hear "data storage" under long term conditions I am always concerned about the durability of the default SD card memory we use in netPI. It is a NAND Flash based of type MLC and by its very nature of design it has limited program/erase write cycles (3000 p/e by the way per block).  So the question is how many data does this customer want to store on the SD card per day? Examinations about the SD cards durability were topic of another thread.

You say "to export the database to a server" ... of which type of server is this? Can the database server be defined/setup still or is it set already?

I am asking because I would not recommend SQlite but a time series database like InfluxDB instead. See here a comparison.

So the server should run InfluxDB and there is Node-RED influxdb node available to write to InfluxDB from local netPI to the remote database. So there is no need to store data locally which is good for the SD card.


RE: Database storage - MGharat - May-28th-2019

Is there any way to test this in office ? Can we have Influx DB server avilble on PC?
Also,Do you have any earlier experience on this?

I am trying to configure the flow, but it shows error for DB node, please check attached screenshot..

I have to demonstate this to one of our customer here. He wants to read data from AB PLC ( alarms, event etc) & log it into netPI

can you please help?


RE: Database storage - patrick - May-28th-2019

Hi Madhumati,

you can read the data from the PLC , process the data and can write the values into a InfluxDB with Node-RED.

For the communication to the InfluxDB i use the "node-red-contrib-influxdb" Node-RED node.
You can download the InfluxDB server for Windows, Linux, Mac OS .... under https://portal.influxdata.com/downloads/


Best Regards
Patrick


RE: Database storage - Armin@netPI - May-28th-2019

Hello Madhumati,

have you already installed InfluxDB on your Windows PC 192.168.0.5? In your screen shot of InfluxDB node I see you did not enter the name of your InfluxDB database. So the question is how did you name the InfluxDB after installation?


RE: Database storage - MGharat - May-28th-2019

Hi,

Ihave created a databse now Test  & also now added the dtaabase name in my flow.attached screnshot.

I could not see the data into logview...


RE: Database storage - Armin@netPI - May-28th-2019

Madhumati, your screen shots show InfluxDB installed as www on the influxcloud.net cloud as internet service and not installed on your local PC 192.168.0.5.

So you have not installed InfluxDB in your local PC. You need to install InfluxDB as Windows Version.


RE: Database storage - MGharat - May-28th-2019

(May-28th-2019, 11:33 AM)Armin@netPI Wrote: Madhumati, your screen shots show InfluxDB installed as www on the influxcloud.net cloud as internet service and not installed on your local PC 192.168.0.5.

So you have not installed InfluxDB in your local PC. You need to install InfluxDB as Windows Version.

I can see as attached  screenshot herewith --Is it correct application? How I can proceed in this case?

(May-28th-2019, 09:35 AM)Patrick@netPI Wrote: Hi Madhumati,

you can read the data from the PLC , process the data and can write the values into a InfluxDB with Node-RED.

For the communication to the InfluxDB i use the "node-red-contrib-influxdb" Node-RED node.
You can download the InfluxDB server for Windows, Linux, Mac OS .... under https://portal.influxdata.com/downloads/


Best Regards
Patrick

On this link I get as below attached -Is it the correct aplication to use ?


RE: Database storage - Armin@netPI - May-28th-2019

Hello Madhumati,

this screen shot looks good.

But after starting InfluxDB application on Windows you need to create a database first. You can name it "armin", "madhumati", "netpi" or anything else. You can have multiple databases running under InfluxDB at the same time, but all with different names. Here find explained https://docs.influxdata.com/influxdb/v1.7/query_language/data_download/ how to proceed to create a database with a windows console.

Later - without a database name- you cannot use InfluxDB Node-RED to write to a database since InfluxDB addressing scheme including Node-RED InfluxDB node needs next to the IP address also the name of the database where to write to.

Since running a time series data base like InfluxDB under windows or other systems is of interest for others we will be providing an example how to get a InfluxDB up and running today in another thread. We will be showing how to create a database without use of a console but within a simple Node-RED and then how to access it.

Thx


RE: Database storage - patrick - May-28th-2019

I have posted a very easy Node-RED flow.
This flow can create or delete a database, write values and can read values from the database.

Link: Node-RED flow