episode #12 Building a Home automation controller sketch

Discussion of the online video show SuperHouseTV, where Freetronics co-founder Jonathan Oxer hacks on his house using various Open Source hardware and software. [SuperHouseTV site]
Post Reply
Joined:Tue Oct 13, 2015 8:01 pm
episode #12 Building a Home automation controller sketch

Post by Fred57 » Tue Oct 13, 2015 8:07 pm

I have a couple of ether ten R3 boards but they don't have the MAC address chip on them and I am having trouble getting the sketch to work by applying a MAC address manually. Does someone have a version of the sketch configured for manual MAC address that works that i can copy and run.


Joined:Thu Apr 14, 2016 2:30 am

Re: episode #12 Building a Home automation controller sketch

Post by bigd003 » Sun Apr 17, 2016 5:56 pm

I got this from superhouse.tv I think. It came from a link by Jon Oxer somewhere...

* Retrieve the MAC address from a Microchip 24AA125E48 I2C ROM, and report it
* to the serial console at 57600bps. The I2C address of the ROM is set to 0x50,
* which assumes both the address pins are tied to 0V.

#define I2C_ADDRESS 0x50
#include <Wire.h>

static uint8_t mac[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

void setup()
Wire.begin(); // Join i2c bus (I2C address is optional for the master)
for(int i = 0; i < 30; i++)
Serial.println(" ");
Serial.println("Starting test for MAC address ROM");
Serial.print("Getting MAC: ");

mac[0] = readRegister(0xFA);
mac[1] = readRegister(0xFB);
mac[2] = readRegister(0xFC);
mac[3] = readRegister(0xFD);
mac[4] = readRegister(0xFE);
mac[5] = readRegister(0xFF);

char tmpBuf[17];
sprintf(tmpBuf, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
Serial.println(" TEST OK");

void loop()
// Do nothing

byte readRegister(byte r)
unsigned char v;
Wire.write(r); // Register to read

Wire.requestFrom(I2C_ADDRESS, 1); // Read a byte
// Wait
v = Wire.read();
return v;

Freetronics Staff
Freetronics Staff
Joined:Tue Apr 09, 2013 11:19 pm
Location:Melbourne, Australia

Re: episode #12 Building a Home automation controller sketch

Post by angusgr » Tue May 03, 2016 6:12 am

Hi Darren,

If you don't have the MAC chip then you can just leave all this code out. Your code will still work, only you can't preset the MAC address to a known value.


Post Reply