Automatically downloading temp data into a database?

Describe your system and processes, and post your config file.
Post Reply
IvoryTowerBrewer
Posts: 4
Joined: Wed Oct 19, 2011 9:02 am
Bot?: No

Automatically downloading temp data into a database?

Post by IvoryTowerBrewer »

I am working with a group of students for the Ivory Tower Brewery at Appalachian State University to set up a database to record the temperature in there two fermenters using the BCS. I need to set this system up so the temp data from the fermenters is downloaded directly into a database. This will need to happen in real time instead of having to click on the Generate File button. we just got the BCS-462 hook up on my home network and do not have the temperature sensors yet to start recording data.

We have several questions so far:
1) WE have noticed that many javascript functions are called in the code of this program, how do you access these files?
The file we are interested in is javascript:dynSave(); the java function that is called when the generate file button is click
I can access many java files like common.js by typing myip/common.js
2) Is the a way to browse the files on the BCS besides just the source code?
3) How do you upload Java files to the BCS?
4) Any advice on storing the data in a database would be great to

Within this group of students we have experience in coding in java and xhtml, and homebrewing but there is still going to be a lot of learning required and any advice would help greatly.
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Automatically downloading temp data into a database?

Post by JonW »

If you want to do continuous logging to a database, you should just read the data structure directly and not mess with the generate file option.

The wiki contains all the info for the data structures. The one you would want to monitor is ultemp.dat. See here: http://www.embeddedcontrolconcepts.com/ ... Ultemp.dat

To do db logging, you'll need an app running somewhere, so just make that app poll the BCS (e.g. http://192.168.0.20/ultemp.dat) and then parse it and log to the database.
User avatar
ECC
Posts: 676
Joined: Fri Sep 12, 2008 12:29 pm
Bot?: No
Contact:

Re: Automatically downloading temp data into a database?

Post by ECC »

Agreed, you don't want the BCS running your code (or actually the browser if its a javascript file).

Use the Open Interface API. Write a program that can make simple HTTP get calls. Then you will run your program on a 'always on' computer/server that can read the BCS data, and store it in a database.

This may also interest you, it is a few simple functions written in perl to access the BCS.
http://www.embeddedcc.com/wiki/index.ph ... rl_Library

As far as databases, google is your friend. I googled "perl database" and it looks like DBI is a great interface API that hides the complexities of mysql, etc. I'm sure that Java, Javascript, C/C++, python, ruby, or whatever language that you choose will have a similar database interface, with online documentation and examples!
User avatar
Baron Ken
Posts: 99
Joined: Fri Jan 15, 2010 2:50 pm
Bot?: No

Re: Automatically downloading temp data into a database?

Post by Baron Ken »

Use the Open Interface API. Write a program that can make simple HTTP get calls. Then you will run your program on a 'always on' computer/server that can read the BCS data, and store it in a database.
Doesn't the computer making the http get calls have to be on the same network as the BCS if you use XmlHttpRequest?
IvoryTowerBrewer
Posts: 4
Joined: Wed Oct 19, 2011 9:02 am
Bot?: No

Re: Automatically downloading temp data into a database?

Post by IvoryTowerBrewer »

This is all great information and advice. Thank you every much. This advice has pointed our group in the right direction, and as well continue to develop this project I will keep this thread update as I am sure new questions will arise.

Cheers,
Rusty
IvoryTowerBrewer
Posts: 4
Joined: Wed Oct 19, 2011 9:02 am
Bot?: No

Re: Automatically downloading temp data into a database?

Post by IvoryTowerBrewer »

oesn't the computer making the http get calls have to be on the same network as the BCS if you use XmlHttpRequest?
Either way the server and BCS are going to run on the same Appalachian State University network. That is a good point to bring up though and it is something to considered.
IvoryTowerBrewer
Posts: 4
Joined: Wed Oct 19, 2011 9:02 am
Bot?: No

Re: Automatically downloading temp data into a database?

Post by IvoryTowerBrewer »

Ok...we are having some trouble. We have taking all that you guys have said and looked into it but I guess we are really bad at understanding programming, we need some more specific assistance on this issue of logging data into a database across a local network.

We are using HTML of course for the webpage design and php to actually do the insert query into the database. I have a test database thats up and running but we only have the programming skills to manually feed the variables into the php code so we could use some assistance with automating this as well. Will the variables to be entered into the php code to go into the database come from another page source that uses javascript to somehow parse the ultemp.dat file across the network (i.e. we will put 192.168.13.50/ultemp.dat somewhere in the Java page so it knows to go to that source to find the data stream from the BCS)?

WE NEED HELP!!!!

We looked into the httpgetrequest but all the http stuff uses POST and GET. The ultemp.dat file does not come from a php post function does it? Do we need to somehow use Javascript (or Java) to create an object from the data stream (by data stream I mean the contents that show up from going to the 192.168.13.50/ultemp.dat network address)?

DETAILS AND EXAMPLES PLEASE!
Post Reply