Show Posts
Pages: [1]
1  Topics / Home Automation and Networked Objects / Re: Pachube Enc28j60 on: January 21, 2013, 10:46:52 am
would the cosm libraries be compatible with my ethernet card enc28j60?
2  Topics / Home Automation and Networked Objects / Pachube Enc28j60 on: January 21, 2013, 05:13:38 am
I have the following code:
Code:
// Simple demo for feeding some random data to Pachube.
// 2011-07-08 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php

#include <EtherCard.h>

// change these settings to match your own setup
#define FEED    "98772"
#define APIKEY  " " // empty due too online post

// ethernet interface mac address, must be unique on the LAN
byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
// Static IP configuration to use if no DHCP found
// Change these to match your site setup
static byte static_ip[] = { 192,168,1,110};
static byte static_gw[] = { 192,168,1,1};

char website[] PROGMEM = "api.cosm.com";

byte Ethernet::buffer[700];
uint32_t timer;
Stash stash;

void setup () {
  Serial.begin(115200);
  Serial.println("\n[webClient]");

if (ether.begin(sizeof Ethernet::buffer, mymac,10) == 0)
    printf_P(PSTR( "Failed to access Ethernet controller\n\r"));
  if (!ether.dhcpSetup())
  {
    printf_P(PSTR("DHCP failed, using static configuration\n\r"));
    ether.staticSetup(static_ip, static_gw);
   
  }
 
  ether.printIp("IP:  ", ether.myip);
  ether.printIp("GW:  ", ether.gwip); 
  ether.printIp("DNS: ", ether.dnsip); 
 
  if (!ether.dnsLookup(website))
    printf_P(PSTR("DNS failed\n\r"));
   


  ether.printIp("SRV: ", ether.hisip);
   

}

void loop () {
  ether.packetLoop(ether.packetReceive());
 
  if (millis() > timer) {
    timer = millis() + 10000;

    byte sd = stash.create();
    stash.print("0,");   // 5 est le numero du datastream
    stash.println(30);
    stash.save();
   
    // generate the header with payload - note that the stash size is used,
    // and that a "stash descriptor" is passed in as argument using "$H"
    Stash::prepare(PSTR("PUT http://api.cosm.com/v2/feeds/98772.csv HTTP/1.0" "\r\n"
                        "Host: $F" "\r\n"
                        "X-PachubeApiKey: $F" "\r\n"
                        "Content-Length: $D" "\r\n"
                        "\r\n"
                        "$H"),
            website, PSTR(FEED), website, PSTR(APIKEY), stash.size(), sd);
    Serial.println("SEND");
    // send the packet - this also releases all stash buffers once done
    ether.tcpSend();
   

  }
}

It prints out the following on my serialmonitor:
Quote
[webClient]
IP:  192.168.1.105
GW:  192.168.1.1
DNS: 192.168.1.1
SRV: 216.52.233.121
SEND
SEND
SEND
SEND
SEND
Yet there is no update on my feed from cosm. https://cosm.com/feeds/98772
 What am I doing wrong? Please if anyone can assist.
3  Using Arduino / Motors, Mechanics, and Power / Powering multiple components and UNO on: January 17, 2013, 05:23:55 am
Hi,
I would like to know how could I power my UNO, Ethernet Shield, LCD. The Ethernet use 3.3V and LCD 5V.
Can the UNO receive multiple power inputs, thinking dc 5.7V via usb and usb to power adapter and then extra 12V DC from outlet to run the components?
How would I achieve this if possible?

Thanks!
4  Topics / Home Automation and Networked Objects / Re: Relay RF Control on: January 13, 2013, 04:11:04 am
thanks for the response.
I take from your reply that it would be possible for me to control the relay using the RF linkkit.

So i can control my relay without wiring directly to the UNO using this method?
5  Topics / Home Automation and Networked Objects / Relay RF Control on: January 13, 2013, 03:22:08 am
Hi all,
I am working on a project for basic home automation. I currently have a relay setup into a outlet box and can control whatever is plugged into the outlet via my pc.
My general concern now is that how can I move this wireless.(the connection between the relay and the arduino) Or would I have to have an Arduino unit for each outlet box. This could get expensive.
I currently have:
Arduino UNO
SPDT Relay and circuitry inside the outlet box. (220V power)

I have though of doing the following:
Control the outlet box with RF : http://www.hobbytronics.co.za/p/28/433mhz-rf-link-kit

Would this be possible and If so , how would I proceed?
Any alternatives?



Pages: [1]