Electric Brewing Supply 30A BCS Giveaway!


Home Brew Forums > Home Brewing Beer > Equipment/Sanitation > Arduino Question
Reply
 
LinkBack Thread Tools
Old 12-12-2009, 05:04 PM   #1
rockytoptim
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
rockytoptim's Avatar
Recipes 
 
Join Date: May 2009
Location: Livonia, MI
Posts: 804
Liked 92 Times on 73 Posts
Likes Given: 3

Default Arduino Question

Anyone here have expeirence with the WiShield from AsyncLabs for arduino. It adds wifi 802.11b to the arduino. I have some coding questions if anyone is familiar with it.

Thanks

__________________

On Tap: Bee Cave Robust Porter
On Tap: Bee Cave OktoberFest
On Tap: Bee Cave Kolsch
Primary: None
Up next: ????

rockytoptim is offline
 
Reply With Quote Quick reply to this message
Old 12-12-2009, 06:39 PM   #2
jpc
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jan 2009
Location: Santa Clara, CA
Posts: 1,915
Liked 61 Times on 46 Posts

Default

Quote:
Originally Posted by rockytoptim View Post
Anyone here have expeirence with the WiShield from AsyncLabs for arduino. It adds wifi 802.11b to the arduino. I have some coding questions if anyone is familiar with it.

Thanks
Sorry, haven't played with it yet, but I am considering something like for when I get around to building my fermentation chamber.
__________________
jpc is offline
 
Reply With Quote Quick reply to this message
Old 12-13-2009, 01:44 AM   #3
rockytoptim
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
rockytoptim's Avatar
Recipes 
 
Join Date: May 2009
Location: Livonia, MI
Posts: 804
Liked 92 Times on 73 Posts
Likes Given: 3

Default

Well I got the code figured out. So now I can monitor my fermentation temps that are in my detached garage from the house. Its not pretty or near the quality of Yuri's stuff but it will have to do. Note screen dump is not of actual fermentation just testing having it sitting out in my gargare.

__________________

On Tap: Bee Cave Robust Porter
On Tap: Bee Cave OktoberFest
On Tap: Bee Cave Kolsch
Primary: None
Up next: ????

rockytoptim is offline
 
Reply With Quote Quick reply to this message
Old 01-03-2010, 04:12 PM   #4
erock2112
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jul 2009
Location: Chapel Hill, NC
Posts: 300
Liked 1 Times on 1 Posts

Default

I'm interested in the code details - I have an arduino being shipped to me, and I'm interested in monitoring multiple fermentations as well as mash temps. You're using the WiShield to make it talk to the computer? I'll have the USB arduino (Duamilanove) but would like to find a way to store the data on the arduino itself so that I don't have to have it connected to a computer at all times...

__________________
HomeBrew Blog
erock2112 is offline
 
Reply With Quote Quick reply to this message
Old 01-03-2010, 04:53 PM   #5
rockytoptim
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
rockytoptim's Avatar
Recipes 
 
Join Date: May 2009
Location: Livonia, MI
Posts: 804
Liked 92 Times on 73 Posts
Likes Given: 3

Default

The WiShield is for posting sensor data to a webpage. You could probably a PC run a script to read data from the webpage and store it but thats beyond my capability. You can store data on the arduino eeprom but your limited to 512 bytes which isn't much so your going to run out of memory really quick. They do make a SD Shield where you can add a SD card to the arduino and store data to that would be the way to go. Let me know if you have any questions about coding or the sensors. I am new to this coding and Arduino but I will help if I can.

__________________

On Tap: Bee Cave Robust Porter
On Tap: Bee Cave OktoberFest
On Tap: Bee Cave Kolsch
Primary: None
Up next: ????

rockytoptim is offline
 
Reply With Quote Quick reply to this message
Old 01-03-2010, 04:58 PM   #6
Skins_Brew
Feedback Score: 0 reviews
 
Skins_Brew's Avatar
Recipes 
 
Join Date: Dec 2007
Location: Silver Spring, MD.
Posts: 1,215
Liked 4 Times on 4 Posts
Likes Given: 1

Default

I just ordered an arduino and am interested in something like this aswell. My main question is how is the arduino publishing that info to the net? Do you have a script that is collecting data from the arduino?

__________________
Braves on the Warpath!
Fight for old D.C.!

I Support My LHBS!! (Maryland HB)
Skins_Brew is offline
 
Reply With Quote Quick reply to this message
Old 01-03-2010, 05:12 PM   #7
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,934
Liked 618 Times on 384 Posts
Likes Given: 56

Default

Rather than using the WiShield as a standalone web server, use it to provide a simple XML file to your network. Then use another computer on the network as a web server capable of doing more complex operations. The main page could be kept on the more powerful server and use Ajax to get the XML file. With a bit of scripting, the page could be dynamically updated without reloading.

Here's a JavaScript code snippet from my setup. Behind the scenes, the XML file is dumped to local storage from a serial port on the web server. The function containing this code is run about once per second using the setInterval() method.

Code:
    // get the xml document via Ajax/http
    httpRequest = new XMLHttpRequest();
    httpRequest.onreadystatechange=function() {
      if(httpRequest.readyState == 4) {
        steamPress = Number(httpRequest.responseText);
      }
    }
    httpRequest.open("GET","./xml/brewhut.xml",false);
    httpRequest.send(null);
    xmlDoc=httpRequest.responseXML;

    // update the global variables by parsing the xml document
    steamPress=Number(xmlDoc.getElementsByTagName("steamPress")[0].childNodes[0].nodeValue);
    steamTemp=Number(xmlDoc.getElementsByTagName("steamTemp")[0].childNodes[0].nodeValue);
    spargeTemp=Number(xmlDoc.getElementsByTagName("spargeTemp")[0].childNodes[0].nodeValue);
    mashTemp=Number(xmlDoc.getElementsByTagName("mashTemp")[0].childNodes[0].nodeValue);
    mashVol=Number(xmlDoc.getElementsByTagName("mashVol")[0].childNodes[0].nodeValue);
    boilVol=Number(xmlDoc.getElementsByTagName("boilVol")[0].childNodes[0].nodeValue);
    steamElement=Number(xmlDoc.getElementsByTagName("steamElement")[0].childNodes[0].nodeValue);
__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 01-03-2010, 05:29 PM   #8
rockytoptim
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
rockytoptim's Avatar
Recipes 
 
Join Date: May 2009
Location: Livonia, MI
Posts: 804
Liked 92 Times on 73 Posts
Likes Given: 3

Default

Thanks Yuri,
After playing with the WiShield I was looking into doing something like that but wasn't sure what my next step woulde be. WiShield definitely cannot server up a complex webpage and is better left to a better server. I will look into Ajax. Thanks for the response

To Skins Brew: Below is example sketch from the WiSever library.

Code:
/*
 * A simple sketch that uses WiServer to serve a web page
 */


#include <WiServer.h>

#define WIRELESS_MODE_INFRA	1
#define WIRELESS_MODE_ADHOC	2

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,2};	// IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1};	// router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0};	// subnet mask for the local network
const prog_char ssid[] PROGMEM = {"ASYNCLABS"};		// max 32 bytes

unsigned char security_type = 0;	// 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"12345678"};	// max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,	// Key 0
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	// Key 1
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	// Key 2
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	// Key 3
				};

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;

unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------


// This is our page serving function that generates web pages
boolean sendMyPage(char* URL) {
  
    // Check if the requested URL matches "/"
    if (strcmp(URL, "/") == 0) {
        // Use WiServer's print and println functions to write out the page content
        WiServer.print("<html>");
        WiServer.print("Hello World!");
        WiServer.print("</html>");
        
        // URL was recognized
        return true;
    }
    // URL not found
    return false;
}


void setup() {
  // Initialize WiServer and have it use the sendMyPage function to serve pages
  WiServer.init(sendMyPage);
  
  // Enable Serial output and ask WiServer to generate log messages (optional)
  Serial.begin(57600);
  WiServer.enableVerboseMode(true);
}

void loop(){

  // Run WiServer
  WiServer.server_task();


 //Run Your Temperature control stuff Here.


  delay(10);
}
__________________

On Tap: Bee Cave Robust Porter
On Tap: Bee Cave OktoberFest
On Tap: Bee Cave Kolsch
Primary: None
Up next: ????

rockytoptim is offline
 
Reply With Quote Quick reply to this message
Old 01-03-2010, 05:43 PM   #9
erock2112
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jul 2009
Location: Chapel Hill, NC
Posts: 300
Liked 1 Times on 1 Posts

Default

@Yuri -
So, you can have the arduino append an xml file, or just create a new one with the most recent data? Where does the file itself reside?

__________________
HomeBrew Blog
erock2112 is offline
 
Reply With Quote Quick reply to this message
Old 01-03-2010, 05:53 PM   #10
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,934
Liked 618 Times on 384 Posts
Likes Given: 56

Default

In my system, the Arduino spits out the text of a complete XML file every 250ms via serial communication. I connect the Arduino directly to the server computer and use a very crude Linux script to capture the serial data and dump it to /var/www/xml/ (a logical location when using Apache2 on Ubuntu). The file is overwritten each time the script runs.

In Tim's system, the entire webpage is stored on and served from the Arduino/WiShield.

__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage 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
Arduino Stir Plate (digital speed control) Yuri_Rage DIY Projects 14 10-16-2014 02:13 AM
Arduino for kegerator temperature control. Orfy DIY Projects 19 04-21-2010 12:18 PM
Arduino with 2wire/SMBUS digital thermometer Spine DIY Projects 11 12-30-2009 03:01 PM
My arduino fridge control build. simpleton DIY Projects 4 01-09-2009 04:40 PM
IDEA: Arduino controlled Wort Boiler dwmcqueen DIY Projects 1 10-25-2007 06:52 PM