Arduino Question - Home Brew Forums
Register Now For Free!

Home Brew Forums > Home Brewing Beer > Equipment/Sanitation > Arduino Question

Reply
 
Thread Tools
Old 12-12-2009, 06:04 PM   #1
rockytoptim
HBT_SUPPORTER.png
 
rockytoptim's Avatar
Recipes 
 
May 2009
Livonia, MI
Posts: 774
Liked 95 Times on 76 Posts



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

 
Reply With Quote
Old 12-12-2009, 07:39 PM   #2
jpc
HBT_LIFETIMESUPPORTER.png
Recipes 
 
Jan 2009
Santa Clara, CA
Posts: 1,914
Liked 68 Times on 51 Posts


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.

 
Reply With Quote
Old 12-13-2009, 02:44 AM   #3
rockytoptim
HBT_SUPPORTER.png
 
rockytoptim's Avatar
Recipes 
 
May 2009
Livonia, MI
Posts: 774
Liked 95 Times on 76 Posts


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

 
Reply With Quote
Old 01-03-2010, 05:12 PM   #4
erock2112
Recipes 
 
Jul 2009
Chapel Hill, NC
Posts: 312
Liked 4 Times on 4 Posts


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...

 
Reply With Quote
Old 01-03-2010, 05:53 PM   #5
rockytoptim
HBT_SUPPORTER.png
 
rockytoptim's Avatar
Recipes 
 
May 2009
Livonia, MI
Posts: 774
Liked 95 Times on 76 Posts


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

 
Reply With Quote
Old 01-03-2010, 05:58 PM   #6
Skins_Brew
 
Skins_Brew's Avatar
Recipes 
 
Dec 2007
Silver Spring, MD.
Posts: 1,203
Liked 5 Times on 5 Posts


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)

 
Reply With Quote
Old 01-03-2010, 06:12 PM   #7
Yuri_Rage
Gritty.
HBT_MODERATOR.png
 
Yuri_Rage's Avatar
Recipes 
 
Jul 2006
Southwest
Posts: 14,291
Liked 813 Times on 514 Posts


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

 
Reply With Quote
Old 01-03-2010, 06:29 PM   #8
rockytoptim
HBT_SUPPORTER.png
 
rockytoptim's Avatar
Recipes 
 
May 2009
Livonia, MI
Posts: 774
Liked 95 Times on 76 Posts


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

 
Reply With Quote
Old 01-03-2010, 06:43 PM   #9
erock2112
Recipes 
 
Jul 2009
Chapel Hill, NC
Posts: 312
Liked 4 Times on 4 Posts


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

 
Reply With Quote
Old 01-03-2010, 06:53 PM   #10
Yuri_Rage
Gritty.
HBT_MODERATOR.png
 
Yuri_Rage's Avatar
Recipes 
 
Jul 2006
Southwest
Posts: 14,291
Liked 813 Times on 514 Posts


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

 
Reply With Quote
Reply
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arduino Stir Plate (digital speed control) Yuri_Rage Chillers & Stir Plates 15 01-16-2016 12:08 PM
Arduino for kegerator temperature control. Orfy Kegerators & Keezers 19 04-21-2010 12:18 PM
Arduino with 2wire/SMBUS digital thermometer Spine Brew Stands 11 12-30-2009 04:01 PM
My arduino fridge control build. simpleton Fermenters 4 01-09-2009 05:40 PM
IDEA: Arduino controlled Wort Boiler dwmcqueen Brew Stands 1 10-25-2007 06:52 PM


Forum Jump