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

Hello ,

I’m trying to accessing data from a sensor.

The data file could be accessed to this address :

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 flowbotics ?

Thanks for your answers

François

Hi,

The main primitive to be used for such a project is HTTP Post. This will allow you to connect to an web page, upload data through post (if wanted, it is optional) and then receive the result page.

You can then use other primitives, Ruby modules or a combination of both to process this output into something meaningful for you.

Please find attached a copy of the sample “input” used and the test application (full source in the FBS Project format).

We hope this helps!

Sincerely,
Working with data in a text file by HTTP.zip (11.3 KB)

Hello ,

many thanks for you help .
I’ve used a part of you script.

Finaly , i work with the file from a folder.
I make a vbscipt wich download each 1 sec the file to a folder, then i can directly open the file in my Schematics

http://astronomie-astrophotographie.fr/Flowbotics/Capture1.JPG

François

We are glad to know you were able to make it work like this. We recommend that you share your schematic (fsp file) and VB solution (zipped) with the RobotShop community. We are certain this would be useful for other users who are having similar questions / issues. You can do so in the forum (see attached image) or at our project-oriented web site, Let’s Make Robots.

Sincerely,