OSC DMX

Right I hope someone can help as I am a bit stumped.
I have been following the tutorial from here Freelance Winnipeg PHP Developer | Nick Verwymeren and can't seem to get it quit working.
The code is

// OSCClass iOSC(iPhone App) test sketch
// OSCClass version 1.0.1 (Arduino ver0014)
// Copyright (c) recotana(http://recotana.com). All right reserved.
// Modified by Nick Verwymeren (http://makesomecode.com) December 30, 2009

/*
iOSC is OSCsend Application for iPhone
iOSC

iOSC setting
OSCMessage type value on off
slider1 /dmx/ledblu float 1 0
slider2 /dmx/ledgrn float 1 0
slider3 /dmx/ledred float 1 0

host setting IP address 192.168.100.206 , port 10000

*/

#include "Ethernet.h"
#include "OSCClass.h"
#include <DmxSimple.h>

OSCMessage recMes;

OSCClass osc(&recMes);

byte serverMac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte serverIp[] = { 192, 168, 100, 206 };
int serverPort = 10000;

// byte gateway[] = { 192, 168, 0, 1 };
// byte subnet[] = { 255, 255, 255, 0 };

char *topAddress="dmx";
//Currently ledpwm is not implemented
char *subAddress[4]={ "ledred" , "ledgrn" , "ledblu" , "ledpwm"};

void setup() {

//Serial.begin(19200); //Uncomment for serial debugging

//If your LED light is set to DMX channel 1 it will use the 1 for red, 2 for green, 3 for blue, and 4 for brightness.

//Use digital pin 3 for DMX output
DmxSimple.usePin(3);
DmxSimple.maxChannel(4);

//Set DMX channel 4 to full brightness
DmxSimple.write(4, 255);
Ethernet.begin(serverMac ,serverIp);

//setting osc recieve server
osc.begin(serverPort);

//osc message buffer clear
osc.flush();

}

void loop() {

//Do we have an OSC message?
if ( osc.available() ) {

//Uncomment below line for debugging through serial port
//logMessage(&recMes);

//toplevel address matching
if( !strcmp( recMes.getAddress(0) , topAddress ) ){

//Get our variables from the message
char *channel = recMes.getAddress(1);
float value = (float)recMes.getArgFloat(0);

//Convert our float value to integer
int intvalue = int(255.0*value);

//Send out the DMX values
DmxSimple.write(atoi(channel), intvalue);
}

}

}

// ********* utility ***********************************

void logMessage(OSCMessage *mes){

uint8_t *ip=mes->getIp();

//disp ip & port
Serial.print("from IP:");
Serial.print(ip[0],DEC);
Serial.print(".");
Serial.print(ip[1],DEC);
Serial.print(".");
Serial.print(ip[2],DEC);
Serial.print(".");
Serial.print(ip[3],DEC);
Serial.print(" port:");
Serial.print(mes->getPort(),DEC);
Serial.print(" ");

//disp adr
for(int i = 0 ; i < mes->getAddressNum() ; i++){

Serial.print(mes->getAddress(i));

}

//disp type tags
Serial.print(" ,");
for(int i = 0 ; i < mes->getArgNum() ; i++){

Serial.print(mes->getTypeTag(i));

}
Serial.print(" ");

//disp args
for(int i = 0 ; i < mes->getArgNum() ; i++){

switch( mes->getTypeTag(i) ){

case 'i': {

Serial.print( mes->getArgInt(i) );
}
break;

case 'f': {

Serial.print( mes->getArgFloat(i) );
}
break;

}

Serial.print(" ");

}

Serial.println("");

}

I have everything in place, I can send DMX I can read in the OSC message but there seems to be a problem converting the second adress string to a value. I can debug it and get the correct string but

DmxSimple.write(atoi(channel), intvalue);

seems to only return a zero for the dmx channel which is no go as I want a number between 1-3.

Anyway if anyone can point me in the right direction that would be great.
Cheers
Steve

Hey Steve,
Thanks for bringing this to my attention. In the comment section on the top where it says which values to fill out in iOSC (or whatever osc sending client you use):

slider1 /dmx/ledblu float 1 0
slider2 /dmx/ledgrn float 1 0
slider3 /dmx/ledred float 1 0

They need to be changed to this (in your OSC client on your iphone):

slider1 /dmx/1 float 1 0
slider2 /dmx/2 float 1 0
slider3 /dmx/3 float 1 0

I changed this because it allowed an easy way for users to set their DMX channel in the OSC client and made it scalable. So basically the DMX channel is being derived from the OSC message itself. If for example you had an RGB par can set to DMX channel 60 then your address in your OSC client would be:

slider1 /dmx/60 float 1 0
slider2 /dmx/61 float 1 0
slider3 /dmx/62 float 1 0

Hope that makes a bit of sense. If not let me know. I'll try to get around to updating the code. It's a little sloppy with some unnecessary bits in it.

And one other thing.
Make sure you set the alpha channel in the arduino code.

     //Set DMX channel 4 to full brightness
     DmxSimple.write(4, 255);
     Ethernet.begin(serverMac ,serverIp);

Just add three more channels to your starting channel to get the alpha. In my previous example this would be 63.