Working with data in a text file accessing by http:\\....

Post any examples or modules that you want to share here
Post Reply
astroghost
Posts: 1
Joined: Tue Dec 08, 2015 11:50 pm

Working with data in a text file accessing by http:\\....

Post by astroghost »

Hello ,

i'm trying to accessing data from a sensor.

The data file could be accessed to this address :

http://127.0.0.1:4444/bySerial/LIGHTMK2 ... Sensor.txt

Data are like this in the text file :

*** lightSensor
logicalName: ""
advertisedValue: "17.5"
unit: "lx"
currentValue: 17.6
lowestValue: 3.5
highestValue: 82.6
currentRawValue: 17.617
logFrequency: 1/s
reportFrequency: OFF
calibrationParam: 0,
resolution: 0.1
measureType: HUMAN_EYE


So i would like to make a module that can read this text file each minute then get the datas on line 6,7,8 line ( lowestValue
highestValue
currentRawValue )

How can i make this module in flowstone.

Thanks for your answers

François
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Working with data in a text file accessing by http:\\...

Post by Tronic »

Can you give more information on what kind of hardware are you using?
User avatar
JB_AU
Posts: 171
Joined: Tue May 21, 2013 11:01 pm

Re: Working with data in a text file accessing by http:\\...

Post by JB_AU »

So you have a file of sensor data on your local server, you could treat this as a normal file/folder & build a path to it, import the data into a string array, index 5,6 & 7 holds the required information, lucky for you there is a ':' delimiter, so you only require float data from index 5 after ':' delimiter.

All the information you require is in the user example subsection :)
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

Albert Einstein
frontfitters123
Posts: 1
Joined: Wed Mar 30, 2016 10:17 am

Re: Working with data in a text file accessing by http:\\...

Post by frontfitters123 »

If you know a little bit how to work with php and Html then you can easily make a program that will read this text file after a giver time will update your database. All you need and ISR system, ISR 2.3.0 will work.
We are the best Shop front fitters in London. Contact us and give your customers a better first impression.
Post Reply