Ss Brewing Technologies Giveaway!

Home Brew Forums > Home Brewing Beer > Automated Brewing Forum > Looking For Software Developer Input...
Reply
 
LinkBack Thread Tools
Old 08-05-2012, 04:56 PM   #1
jpalarchio
Feedback Score: 1 reviews
Recipes 
 
Join Date: Jan 2009
Location: Holly, MI
Posts: 544
Liked 48 Times on 39 Posts
Likes Given: 10

Default Looking For Software Developer Input...

I'm hoping a software developer or two (I know you guys are out there) can chime in on whether this makes sense or not.

As part of my brewing setup, I want to use an Arduino Mega with Ethernet to handle the gather of data (temperatures, volumes, etc) and then send that data to a server for processing and storage into a SQL database. The Arduino would probably also be running a PID routine on it for controlling my RIMS tube.

I would then like to run some type of web-enabled interface on the server that will allow me to both view the data and send commands back to the Arduino (i.e. change target temp). Ideally I would like the web interface to be multi-platform so that it works on both Internet Explorer and the iPad.

Technology Selection
My skills are really in the Microsoft space but more on the infrastructure side than development. I can work my way through small programming tasks and copy and paste with the best of them.

I would like to stick with the Arduino Mega as I have a decent grasp of working with it and there's a great amount of example code out there (including the BrewTroller code); I also own it already. I can see where the Raspberry Pi might make more sense in the future but the Arduino seems like it could be sufficient for now.

Here's where I was hoping for a developer's views:

  • I was looking on running node.js (on an IIS server which is probably blasphemy) for the server-side and then using the websockets package on the Arduino to communicate to/from node.
  • For client communication from IE and the iPad, I assumed this would also be websockets which I know is only supported in IE10 but I'm okay with that.
  • For connectivity between node and the database, is JSON the appropriate technology?

If anyone has comments I would appreciate it.

Thanks!

Joe
__________________
jpalarchio is offline
 
Reply With Quote Quick reply to this message
Old 08-05-2012, 08:28 PM   #2
MalFet
/bɪər nərd/
HBT_LIFETIMESUPPORTER.png
Feedback Score: 1 reviews
 
MalFet's Avatar
Recipes 
 
Join Date: May 2010
Location: NYC / Kathmandu
Posts: 8,206
Liked 1231 Times on 818 Posts
Likes Given: 561

Default

What's the motivation for a separate server? If you're just looking for data presentation and a way to feed commands, it would be quite a bit simpler to just serve the HTML directly from the Arduino. I'm certainly not trying to convince you out of anything, but I want to make sure I understand why you're going this route before I make any suggestions.

__________________

"Be excellent to each other." -Benjamin Franklin

MalFet is offline
 
Reply With Quote Quick reply to this message
Old 08-05-2012, 09:57 PM   #3
jpalarchio
Feedback Score: 1 reviews
Recipes 
 
Join Date: Jan 2009
Location: Holly, MI
Posts: 544
Liked 48 Times on 39 Posts
Likes Given: 10

Default

Quote:
Originally Posted by MalFet View Post
What's the motivation for a separate server? If you're just looking for data presentation and a way to feed commands, it would be quite a bit simpler to just serve the HTML directly from the Arduino. I'm certainly not trying to convince you out of anything, but I want to make sure I understand why you're going this route before I make any suggestions.
I suppose I just assumed that a separate server would provide me more flexibility in creating a "pretty" interface and I wanted to store the data externally in a database anyhow for analysis. I figured I would eventually work towards a more robust interface that would include something like upload of a BeerXML file for inputs that would be used for parameters on the Arduino. Also, I didn't see any capabilities to provide asynchronous communication from the Arduino itself.

My thought was that the Arduino would be humming along doing it's data stuff and I could have client devices that talk to a web page consuming the data and sending back commands if necessary. Temperature updates on the web page would be fairly realtime whereas data would only be submitted to the database on set intervals.

One other piece I was looking at was something like Flot for graphing the data and providing realtime feedback.

I'm certainly open to suggestions...
__________________

Last edited by jpalarchio; 08-05-2012 at 10:14 PM. Reason: Added more detail...
jpalarchio is offline
 
Reply With Quote Quick reply to this message
Old 08-06-2012, 12:28 PM   #4
MalFet
/bɪər nərd/
HBT_LIFETIMESUPPORTER.png
Feedback Score: 1 reviews
 
MalFet's Avatar
Recipes 
 
Join Date: May 2010
Location: NYC / Kathmandu
Posts: 8,206
Liked 1231 Times on 818 Posts
Likes Given: 561

Default

Quote:
Originally Posted by jpalarchio View Post
I suppose I just assumed that a separate server would provide me more flexibility in creating a "pretty" interface and I wanted to store the data externally in a database anyhow for analysis. I figured I would eventually work towards a more robust interface that would include something like upload of a BeerXML file for inputs that would be used for parameters on the Arduino. Also, I didn't see any capabilities to provide asynchronous communication from the Arduino itself.

My thought was that the Arduino would be humming along doing it's data stuff and I could have client devices that talk to a web page consuming the data and sending back commands if necessary. Temperature updates on the web page would be fairly realtime whereas data would only be submitted to the database on set intervals.

One other piece I was looking at was something like Flot for graphing the data and providing realtime feedback.

I'm certainly open to suggestions...
Arduino programs are single threaded, so there's no true asynchronous communication. That said, if you throw in a line in your main loop to sniff for a waiting client connection it will functionally behave that way.
__________________

"Be excellent to each other." -Benjamin Franklin

MalFet is offline
 
Reply With Quote Quick reply to this message
Old 08-08-2012, 04:08 PM   #5
stockmaster
Feedback Score: 0 reviews
Recipes 
 
Join Date: Nov 2010
Location: New York, NY
Posts: 6
Default

I know this is an old thread, but I figured I might chime in. I think saving to SQL might be an over complication. Writing the file as a text (CSV file) seems like a simple solution, you can then parse that data into an excel, sql, or xml file on your PC. As far as getting the info form the Arduino you have a few options. You add a local storage device, then physically remove it and copy it to your PC, or you can use processing and some sort of serial communication to send the data to your PC (or mac) and save the data there.

__________________
stockmaster is offline
 
Reply With Quote Quick reply to this message
Old 08-10-2012, 02:10 AM   #6
jbrewkeggin
Feedback Score: 0 reviews
Recipes 
 
Join Date: Mar 2012
Location: Baltimore, MD
Posts: 29
Liked 1 Times on 1 Posts

Default

Quote:
Originally Posted by jpalarchio View Post
I'm hoping a software developer or two (I know you guys are out there) can chime in on whether this makes sense or not.

As part of my brewing setup, I want to use an Arduino Mega with Ethernet to handle the gather of data (temperatures, volumes, etc) and then send that data to a server for processing and storage into a SQL database. The Arduino would probably also be running a PID routine on it for controlling my RIMS tube.

I would then like to run some type of web-enabled interface on the server that will allow me to both view the data and send commands back to the Arduino (i.e. change target temp). Ideally I would like the web interface to be multi-platform so that it works on both Internet Explorer and the iPad.

Technology Selection
My skills are really in the Microsoft space but more on the infrastructure side than development. I can work my way through small programming tasks and copy and paste with the best of them.

I would like to stick with the Arduino Mega as I have a decent grasp of working with it and there's a great amount of example code out there (including the BrewTroller code); I also own it already. I can see where the Raspberry Pi might make more sense in the future but the Arduino seems like it could be sufficient for now.

Here's where I was hoping for a developer's views:
  • I was looking on running node.js (on an IIS server which is probably blasphemy) for the server-side and then using the websockets package on the Arduino to communicate to/from node.
  • For client communication from IE and the iPad, I assumed this would also be websockets which I know is only supported in IE10 but I'm okay with that.
  • For connectivity between node and the database, is JSON the appropriate technology?

If anyone has comments I would appreciate it.

Thanks!

Joe
I like the idea of sending the data to a SQL database (most likely mysql) residing on a server, which can just be a computer on your local net running Apache. I would recommend using AJAX so that your browser is being updated with the most recent data without a refresh; however, I'm not sure that this works with Apple's browser, Safari. This will only be near real-time since you have to wait for the Arduino to update the database, but it's still cool.
__________________
jbrewkeggin is offline
 
Reply With Quote Quick reply to this message
Old 08-10-2012, 02:45 AM   #7
mdgagne
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jun 2011
Location: South China, Maine
Posts: 282
Liked 17 Times on 15 Posts

Default

I would just use the arduino for control of your rims and build in a mechanism to read/write current process variables via TCP. Then you could write an app running on a PC to get the data from the Arduino in some configurable interval (say every 20 seconds). The app could log this data to your DB of choice. From there the possibilities of presenting the data are infinite.

__________________
http://www.malthomebrewclub.org
mdgagne is offline
 
Reply With Quote Quick reply to this message
Old 08-10-2012, 03:14 AM   #8
jpalarchio
Feedback Score: 1 reviews
Recipes 
 
Join Date: Jan 2009
Location: Holly, MI
Posts: 544
Liked 48 Times on 39 Posts
Likes Given: 10

Default

Quote:
Originally Posted by mdgagne View Post
I would just use the arduino for control of your rims and build in a mechanism to read/write current process variables via TCP. Then you could write an app running on a PC to get the data from the Arduino in some configurable interval (say every 20 seconds). The app could log this data to your DB of choice. From there the possibilities of presenting the data are infinite.
This is along the lines of what I'm thinking. The PID algorithm running on the Arduino is going to need more timely updates from the temperature sensors than I need logged. I don't need 5 billion data points logged during a brew session.

I was trying to avoid writing any type of client/server application and instead leverage existing technologies to make it sort of a web app; still doing a lot of reading there.

The single-threaded nature of the Arduino seems like it might squash some of my initial thoughts.

What I need to do on the Arduino is:

Listen For Action Command From Server (via sockets?) -> Get Current Temperatures -> Execute PID -> Upload Data To Server (via sockets?) -> REPEAT

What's not clear to me within this loop is when I'm waiting for actions from the server, how long do I wait and what does the server do as far as sending when I'm at a point where the Arduino is not listening.
__________________
jpalarchio is offline
 
Reply With Quote Quick reply to this message
Old 08-10-2012, 10:10 AM   #9
mdgagne
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jun 2011
Location: South China, Maine
Posts: 282
Liked 17 Times on 15 Posts

Default

Quote:
Originally Posted by jpalarchio

This is along the lines of what I'm thinking. The PID algorithm running on the Arduino is going to need more timely updates from the temperature sensors than I need logged. I don't need 5 billion data points logged during a brew session.

I was trying to avoid writing any type of client/server application and instead leverage existing technologies to make it sort of a web app; still doing a lot of reading there.

The single-threaded nature of the Arduino seems like it might squash some of my initial thoughts.

What I need to do on the Arduino is:

Listen For Action Command From Server (via sockets?) -> Get Current Temperatures -> Execute PID -> Upload Data To Server (via sockets?) -> REPEAT

What's not clear to me within this loop is when I'm waiting for actions from the server, how long do I wait and what does the server do as far as sending when I'm at a point where the Arduino is not listening.
I have not done much work with Arduinos boards, but I have done some development with Atmel AVRs which are the microprocessors used on all the Arduinos. The rs-232 port works with an interrupt service routine so you shouldn't have to worry about waiting for requests if the Ethernet stuff works the same. Even though you're dealing with a single threaded application, interrupts work great for dealing with I/O in a seemingly asynchronous fashion, just remember that anytime the Arduino has to service an interrupt it is not executing the main process loop.
__________________
http://www.malthomebrewclub.org
mdgagne is offline
 
Reply With Quote Quick reply to this message
Old 08-10-2012, 10:45 AM   #10
MalFet
/bɪər nərd/
HBT_LIFETIMESUPPORTER.png
Feedback Score: 1 reviews
 
MalFet's Avatar
Recipes 
 
Join Date: May 2010
Location: NYC / Kathmandu
Posts: 8,206
Liked 1231 Times on 818 Posts
Likes Given: 561

Default

Quote:
Originally Posted by jpalarchio View Post
This is along the lines of what I'm thinking. The PID algorithm running on the Arduino is going to need more timely updates from the temperature sensors than I need logged. I don't need 5 billion data points logged during a brew session.

I was trying to avoid writing any type of client/server application and instead leverage existing technologies to make it sort of a web app; still doing a lot of reading there.

The single-threaded nature of the Arduino seems like it might squash some of my initial thoughts.

What I need to do on the Arduino is:

Listen For Action Command From Server (via sockets?) -> Get Current Temperatures -> Execute PID -> Upload Data To Server (via sockets?) -> REPEAT

What's not clear to me within this loop is when I'm waiting for actions from the server, how long do I wait and what does the server do as far as sending when I'm at a point where the Arduino is not listening.
Like I said before, far and away the easiest way to do this is to simply poll for client requests each time through your main loop. This isn't true asynchronous operation, but it would be essentially indistinguishable from it for your purposes.

Otherwise, you can use hardware interrupts like mdgagne mentioned, though that gets a bit more complex on the arduino.
__________________

"Be excellent to each other." -Benjamin Franklin

MalFet is offline
 
Reply With Quote Quick reply to this message
Reply



Quick Reply
Message:
Options
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Software to control brewing process btbonser Automated Brewing Forum 18 07-08-2012 05:42 AM