libartnet on iPad?

752 views
Skip to first unread message

p3k

unread,
Sep 6, 2010, 8:05:33 AM9/6/10
to open-lighting
Hello

First of all, I am an absolute newbie to the world of Art-Net as well
as Cocoa programming.

Nevertheless, I am desperately trying to find out if there is a chance
to include libartnet in an XCode project to be built for iPad/iPhone.

All we actually need is the iPad to be able to receive Art-Net data
and unpack it for further evaluation.

Could anyone tell me if that is feasible at all? And if so, how would
I tell a Cocoa programmer to get started?

Otherwise I would be thankful for an alternative approach how
controlling an iPad via Art-Net could be realized.

Generally a big thank you for your efforts on bringing Art-Net to Mac
and Linux.

Best regards,

Tobi Schäfer

Simon Newton

unread,
Sep 6, 2010, 11:57:39 AM9/6/10
to open-l...@googlegroups.com
On Mon, Sep 6, 2010 at 5:05 AM, p3k <inte...@p3k.org> wrote:
> Hello
>
> First of all, I am an absolute newbie to the world of Art-Net as well
> as Cocoa programming.
>
> Nevertheless, I am desperately trying to find out if there is a chance
> to include libartnet in an XCode project to be built for iPad/iPhone.
>
> All we actually need is the iPad to be able to receive Art-Net data
> and unpack it for further evaluation.
>
> Could anyone tell me if that is feasible at all? And if so, how would
> I tell a Cocoa programmer to get started?
>
> Otherwise I would be thankful for an alternative approach how
> controlling an iPad via Art-Net could be realized.

Apparently it can be done. I suspect you just need to build libartnet
for the ipad and then link against it from your project.

Searching for "build iphone library" shows a bunch of useful pages,
including http://pseudogreen.org/blog/build_autoconfed_libs_for_iphone.html

http://opendmx.net/index.php/Using_OLA_with_Xcode may help for the second part.

Do let us know how you get on. I'd like to get OLA running on the
iphone at some stage.

Simon


> Generally a big thank you for your efforts on bringing Art-Net to Mac
> and Linux.
>
> Best regards,
>
> Tobi Schäfer
>

> --
> open-l...@googlegroups.com  /  http://groups.google.com/group/open-lighting
> To unsubscribe email open-lightin...@googlegroups.com
>

p3k

unread,
Sep 7, 2010, 5:42:46 AM9/7/10
to open-lighting
Hi Simon

Thanks for your quick reply and the links.

In the meantime I did the following:

1. Download libartnet-1.1.0.tar.gz
2. ./configure CC="gcc -arch i386" # to avoid “unsupported file format
which is not the architecture being linked (i386)” error
3. make; make install
4. Drag&Drop /usr/local/lib/libartnet.dylib file on XCode Frameworks
folder
5. Drag&Drop ./libartnet-1.1.0/artnet/artnet.h file on XCode Classes
folder

Then, I tried the following code in main.m:

#import <UIKit/UIKit.h>
#import "artnet.h"

int main(int argc, char *argv[]) {
artnet_node *artnetNode = artnet_new("127.0.0.1", 9);
artnet_start(artnetNode);
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[artnetNode release]; // Returns a warning: invalid receiver type
‘artnet_node’
[pool release];
return retVal;
}

I assume it does not make sense to do this in main.m but I just wanted
to check if I can use some of the libartnet methods – and obviously it
works as I can build and run the project.

However, as stated before, I do not really have clue what I am doing
here. I am depending on your suggestions and will eagerly listen.

Best regards,
Tobi



On Sep 6, 5:57 pm, Simon Newton <nomi...@gmail.com> wrote:
> On Mon, Sep 6, 2010 at 5:05 AM, p3k <interf...@p3k.org> wrote:
> > Hello
>
> > First of all, I am an absolute newbie to the world of Art-Net as well
> > as Cocoa programming.
>
> > Nevertheless, I am desperately trying to find out if there is a chance
> > to include libartnet in an XCode project to be built for iPad/iPhone.
>
> > All we actually need is the iPad to be able to receive Art-Net data
> > and unpack it for further evaluation.
>
> > Could anyone tell me if that is feasible at all? And if so, how would
> > I tell a Cocoa programmer to get started?
>
> > Otherwise I would be thankful for an alternative approach how
> > controlling an iPad via Art-Net could be realized.
>
> Apparently it can be done. I suspect you just need to build libartnet
> for the ipad and then link against it from your project.
>
> Searching for "build iphone library" shows a bunch of useful pages,
> includinghttp://pseudogreen.org/blog/build_autoconfed_libs_for_iphone.html
>
> http://opendmx.net/index.php/Using_OLA_with_Xcodemay help for the second part.

Simon Newton

unread,
Sep 7, 2010, 10:59:05 AM9/7/10
to open-l...@googlegroups.com

Well neither do I really :). Does it run in the iphone simulator?

p3k

unread,
Sep 7, 2010, 11:13:01 AM9/7/10
to open-lighting
Yes, it does. I found the following output in the XCode console:

#### INTERFACES FOUND ####
IP: 192.168.0.101
bcast: 192.168.0.255
hwaddr: 00:00:00:00:00:00
#########################

But I am not sure if an Art-Net node is actually created:

artnet_node *artnetNode = artnet_new("127.0.0.1", 9);
NSLog(@"%@", artnetNode);

The NSLog() output returns “2010-09-07 17:07:16.735 ArtNet[97931:207]
(null)” – the null looks suspicious to me. Moreover I do not get any
output at all using the artnet_dump_config() method.

Any hints how I could progress from here? What could be the reason for
no node being created?

Cheers,
tobi

Simon Newton

unread,
Sep 7, 2010, 11:31:29 AM9/7/10
to open-l...@googlegroups.com
On Tue, Sep 7, 2010 at 8:13 AM, p3k <inte...@p3k.org> wrote:
> Yes, it does. I found the following output in the XCode console:
>
> #### INTERFACES FOUND ####
> IP: 192.168.0.101
>  bcast: 192.168.0.255
>  hwaddr: 00:00:00:00:00:00
> #########################
>
> But I am not sure if an Art-Net node is actually created:
>
>    artnet_node *artnetNode = artnet_new("127.0.0.1", 9);
>    NSLog(@"%@", artnetNode);
>
> The NSLog() output returns “2010-09-07 17:07:16.735 ArtNet[97931:207]
> (null)” – the null looks suspicious to me. Moreover I do not get any
> output at all using the artnet_dump_config() method.

Add something like this:

if (!node) {
printf("Error: %s\n", artnet_strerror);
}

I suspect the network code isn't completing.


> Any hints how I could progress from here? What could be the reason for
> no node being created?
>
> Cheers,
> tobi
>

Simon Newton

unread,
Sep 7, 2010, 11:32:54 AM9/7/10
to open-l...@googlegroups.com
On Tue, Sep 7, 2010 at 8:31 AM, Simon Newton <nom...@gmail.com> wrote:
> On Tue, Sep 7, 2010 at 8:13 AM, p3k <inte...@p3k.org> wrote:
>> Yes, it does. I found the following output in the XCode console:
>>
>> #### INTERFACES FOUND ####
>> IP: 192.168.0.101
>>  bcast: 192.168.0.255
>>  hwaddr: 00:00:00:00:00:00
>> #########################
>>
>> But I am not sure if an Art-Net node is actually created:
>>
>>    artnet_node *artnetNode = artnet_new("127.0.0.1", 9);

^^ That's your problem, you can't use the loopback address.

Leave it null for now and it'll pick the 192.168.0.101 interface.

p3k

unread,
Sep 7, 2010, 11:55:40 AM9/7/10
to open-lighting
Alright, thanks for the feedback – there is also a problem with the
NSLog() call as it actually crashes the app if a node is created and
assigned to the artnetNode variable.

I changed the code like so:

#import <UIKit/UIKit.h>
#import "artnet.h"

int main(int argc, char *argv[]) {
artnet_node *artnetNode = artnet_new(NULL, 1);
if (!artnetNode) {
printf("Error: %s\n", artnet_strerror());
}
artnet_start(artnetNode);
artnet_dump_config(artnetNode);
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
artnet_stop(artnetNode);
artnet_destroy(artnetNode); // I hope that is the correct way to
dealloc
[pool release];
return retVal;
}

Running it, I now get the config dump in the console:

Binding to 0.0.0.0
sending to 192.168.0.255
sending to 192.168.0.255
#### NODE CONFIG ####
Node Type: 0
Short Name:
Long Name:
Subnet: 0
Default Subnet: 0
Net Ctl: 0
#####################

(Not bad for a complete Objective-C fool, huh? :)

So what now? I want to read Art-Net data coming in using artnet_read()
– should that go into a loop or what? And is it the correct approach?
Or do I need to make some more configuration first?

Thanks already, I feel like making huge steps although that might
sound funny to you.
;)

Best,

Tobi

Simon Newton

unread,
Sep 7, 2010, 12:20:04 PM9/7/10
to open-l...@googlegroups.com

Looks good so far. Make sure you check the return values of calls like
artnet_start()

> So what now? I want to read Art-Net data coming in using artnet_read()
> – should that go into a loop or what? And is it the correct approach?
> Or do I need to make some more configuration first?

First of all you need to call artnet_set_dmx_handler(node,
function_ptr, NULL) passing a pointer to the function you want called
when data becomes available.

Then there are a least two different ways you can run the node:

i) Call artnet_get_sd(node) to get the underlying file descriptor.
Your code then needs to call artnet_read(node, 0) whenever there is
input on the descriptor and function_ptr will be called with the new
data.

ii) Run libartnet in a separate thread. You can launch a new thread
and then call artnet_read(node, 1). When data is available
function_ptr will be called in the artnet thread. You'll need to
handle synchronization with the main program thread.

Simon

> Thanks already, I feel like making huge steps although that might
> sound funny to you.
> ;)
>
> Best,
>
> Tobi
>

p3k

unread,
Sep 8, 2010, 4:55:57 AM9/8/10
to open-lighting
Alright, I now added the checks you suggested and defined a DMX
handler.

However, I do not get any sign of Art-Net/DMX data being received.
(That is: no log output saying ”Receiving DMX data!“.)

I am using PlayCap with a capture file (created with Wireshark) that
contains a simple Art-Net output from a machine running lightning
software.

Need to verify if the replay is really working but also want to be
sure that I did not make any further mistakes in the code.

Which IP should the data be sent through when the debug message says
”Binding to 0.0.0.0, sending to 192.168.0.255”?

Cheers,
tobi

--

int dmxHandler(artnet_node node, int port, void *d) {
NSLog(@"Receiving DMX data!");
return 0;
}

int main(int argc, char *argv[]) {

artnet_node *artnetNode = artnet_new(NULL, 1);

if (!artnetNode) {
printf("Error: %s\n", artnet_strerror());
exit(-1);
}

artnet_set_long_name(artnetNode, "Art-Net Test");
artnet_set_short_name(artnetNode, "ANT");
artnet_dump_config(artnetNode);

if (artnet_set_dmx_handler(artnetNode, dmxHandler, NULL) != 0) {
printf("Error: %s\n", artnet_strerror());
exit(-1);
}

if (artnet_start(artnetNode) != 0) {
printf("Error: %s\n", artnet_strerror());
exit(-1);
}

while (YES) {
printf("arnet_get_sd() => %i\n", artnet_get_sd(artnetNode));
printf("artnet_read() => %i\n", artnet_read(artnetNode, 1));
}

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);

artnet_stop(artnetNode);
artnet_destroy(artnetNode);

[pool release];
return retVal;
}

Rowan Maclachlan

unread,
Sep 8, 2010, 5:23:29 AM9/8/10
to open-l...@googlegroups.com
> Binding to 0.0.0.0, sending to 192.168.0.255”?

That should be right. You send artnet to the broadcast address of your
subnet .255 - You could get MagicQ PC as it sends artnet for free for
testing.

Sent from my iPhone

p3k

unread,
Sep 8, 2010, 8:45:42 AM9/8/10
to open-lighting
> That should be right. You send artnet to the broadcast address of your  
> subnet .255 - You could get MagicQ PC as it sends artnet for free for  
> testing.

Thanks for the hint, will try that.

Btw. In the docs of various manufacturers of Art-Net hard/software
(e.g. http://sites.google.com/a/samsc.com/catalyst/dmx-and-ethernet)
the network is set up in the 2.x.y.z IP range; does that mean I have
to configure the ethernet port of my machine as e.g.
2.0.0.1/255.0.0.0?

Is Art-Net generally “limited” to this network range?

Cheers,
tobi

Simon Newton

unread,
Sep 8, 2010, 11:35:01 AM9/8/10
to open-l...@googlegroups.com


You'll also want to do something like:

// this will listen on ArtNet universe 1
uint8_t subnet_addr = 0;
uint8_t port_addr = 1;

// set the upper 4 bits of the universe address
artnet_set_subnet_addr(node, subnet_addr) ;

// enable port 0
artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;
// bind port 0 to universe 1
artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, port_addr);

>        if (artnet_set_dmx_handler(artnetNode, dmxHandler, NULL) != 0) {
>                printf("Error: %s\n", artnet_strerror());
>                exit(-1);
>        }
>
>        if (artnet_start(artnetNode) != 0) {
>                printf("Error: %s\n", artnet_strerror());
>                exit(-1);
>        }
>
>        while (YES) {
>                printf("arnet_get_sd() => %i\n", artnet_get_sd(artnetNode));
>                printf("artnet_read() => %i\n", artnet_read(artnetNode, 1));
>        }
>
>        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
>        int retVal = UIApplicationMain(argc, argv, nil, nil);
>
>        artnet_stop(artnetNode);
>        artnet_destroy(artnetNode);
>
>        [pool release];
>    return retVal;
> }
>

Simon Newton

unread,
Sep 8, 2010, 11:39:58 AM9/8/10
to open-l...@googlegroups.com

Not really. There is nothing technically in the protocol that requires
2.0.0.0/8 or 10.0.0.0/8. That said Artistic License made the mistake
early on of specifying 2.0.0.0/8 as the subnet (no idea why!) and then
later added 10.0.0.0/8. I use it with other network ranges all the
time, the important thing is that all nodes use the same broadcast
address.


Simon

>
> Cheers,
> tobi

p3k

unread,
Sep 9, 2010, 5:42:17 AM9/9/10
to open-lighting
Thank you very much for all the help and information so far.

I need to test the code with our lightning production setup next week
to be sure that it is not the Art-Net capture file’s fault that I do
not get the log message for receiving data.

Will get back to you as soon as I have some new insights.

Best,

Tobi

Rowan Maclachlan

unread,
Sep 9, 2010, 5:46:18 AM9/9/10
to open-l...@googlegroups.com
Are you unable to run magicq pc or another free artnet software to
test??

p3k

unread,
Sep 9, 2010, 5:54:03 AM9/9/10
to open-lighting
> Are you unable to run magicq pc or another free artnet software to  
> test??

I downloaded and installed MagicQ PC for Mac but unfortunately got
completely lost in the interface.
:/

What do I have to do to quickly achieve sending some Art-Net data with
it?

What are the alternative free Art-Net software packages you mention?

Tobi

Rowan Maclachlan

unread,
Sep 9, 2010, 6:07:33 AM9/9/10
to open-l...@googlegroups.com
oh right, mac.... Sorry to hear that.

try D::Light

http://www.opendmx.net/index.php/D::Light

nico

unread,
Sep 9, 2010, 6:16:37 AM9/9/10
to open-l...@googlegroups.com, Rowan Maclachlan
hi,
just to mention here that DL use libartnet as artnet server.
as libartnet use a fix ip to send data, 2xlibartnet won't coexists in
the same place...
moreover DL uses 2.x.x.x/10.x.x.x network broad/uni/cast address

++
nico

Simon Newton

unread,
Sep 9, 2010, 12:54:58 PM9/9/10
to open-l...@googlegroups.com

Why not just use artnet_dmxconsole from another computer?

p3k

unread,
Sep 14, 2010, 6:07:12 AM9/14/10
to open-lighting
Hi again.

Thanks for the further hints regarding testing Art-Net reception. I
still have to set up a working testing environment. However, right now
I am trying to get the code working on the iPad – and I am stuck.
:(

But first things first.

Today I connected an iPad as development device to XCode and almost
drowned in error messages when trying to build and run the code above
on the device.

I quickly found out that I now need to compile libartnet for the ARM
processor. I achieved this with the help of a build script [1] setting
up the library’s autotools environment for the iPad architecture; just
modified the SDKVER variable to 3.2.

Then I was able to compile Art-Net library by issuing make and make
install and got a new directory /opt/iphone-3.2 containing a lib and
an include directory.

I added lib/libartnet.a to the Frameworks group and the path to the
include directory to the Header Search Path of the XCode project as
described in [2].

Unfortunately, I get an error when building the project:

Undefined symbols:
"_rpl_malloc", referenced from:
_artnet_new in libartnet.a(artnet.o)
_artnet_nl_update in libartnet.a(artnet.o)
_get_ifaces in libartnet.a(network.o)
_handle_firmware in libartnet.a(receive.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Any idea what I need to do to fix this issue?

Best regards,

Tobi

--
[1] http://stackoverflow.com/questions/1602182/cross-compile-autotools-based-libraries-for-official-iphone-sdk
[2] http://iphone.olipion.com/cross-compilation/include-library-in-xcode-project

Simon Newton

unread,
Sep 14, 2010, 12:32:52 PM9/14/10
to open-l...@googlegroups.com

p3k

unread,
Sep 15, 2010, 5:02:58 AM9/15/10
to open-lighting
Thanks, Simon – that worked!

Actually, I tried that before already, but only with a universal
library (using that lipo binary).

When I use the libartnet.a file only I am now able to send Art-Net
polls from the iPad. Way to go!

Now I will get back to compiling OLA for Ubuntu and making the iPad
receive data...

Cheers,
Tobi

On Sep 14, 6:32 pm, Simon Newton <nomi...@gmail.com> wrote:
> Try this:
>
> http://changetheworldwithyourpassion.blogspot.com/2009/09/fix-undefin...

Simon Newton

unread,
Sep 15, 2010, 11:31:38 AM9/15/10
to open-l...@googlegroups.com
On Wed, Sep 15, 2010 at 2:02 AM, p3k <inte...@p3k.org> wrote:
> Thanks, Simon – that worked!
>
> Actually, I tried that before already, but only with a universal
> library (using that lipo binary).

Excellent. Do you mind writing down everything you did (including some
screenshots in Xcode) and adding it here
http://opendmx.net/index.php/OpenDMX.net

That way when the next person wants to do it we don't have to start
from scratch.

Thanks,

Simon


>
> When I use the libartnet.a file only I am now able to send Art-Net
> polls from the iPad. Way to go!
>
> Now I will get back to compiling OLA for Ubuntu and making the iPad
> receive data...
>
> Cheers,
> Tobi
>
> On Sep 14, 6:32 pm, Simon Newton <nomi...@gmail.com> wrote:
>> Try this:
>>
>> http://changetheworldwithyourpassion.blogspot.com/2009/09/fix-undefin...
>

p3k

unread,
Sep 15, 2010, 11:44:25 AM9/15/10
to open-lighting
> Excellent. Do you mind writing down everything you did (including some
> screenshots in Xcode) and adding it here

Will do! This is the least I can do to give something back to you and
the OpenDMX community.

You probably cannot imagine how much you helped me.
:)

Tobi

p3k

unread,
Sep 16, 2010, 8:26:44 AM9/16/10
to open-lighting
Hi there

I started a wiki page here:

http://www.opendmx.net/index.php/IPad_ArtNet_Node

Not finished, yet. There are some more things to come.

One more question: Is there an elaborate example how to extract data
from an Art-Net package?

Cheers,
tobi

Simon Newton

unread,
Sep 16, 2010, 12:01:56 PM9/16/10
to open-l...@googlegroups.com
On Thu, Sep 16, 2010 at 5:26 AM, p3k <inte...@p3k.org> wrote:
> Hi there
>
> I started a wiki page here:
>
> http://www.opendmx.net/index.php/IPad_ArtNet_Node
>
> Not finished, yet. There are some more things to come.

That's excellent, thanks. I've added it to the news section on the front page.


> One more question: Is there an elaborate example how to extract data
> from an Art-Net package?

I'm not sure what you mean by this. Can you explain what you're trying to do?

Simon


> Cheers,
> tobi

jeff .

unread,
Feb 12, 2013, 12:39:12 PM2/12/13
to open-l...@googlegroups.com
I'm learning Objective-C but i'm light technician and i juste need a code example to send a simple value (or a slider value) on a dmx channel on a selected Univers and subnet

thank's


Le mardi 12 février 2013 06:08:22 UTC+1, jeff . a écrit :
Hi,

I follow your tuto and all work's fine in the Ipad simulator
The node is started and receive dmx messages from and external program(Luminair)
could you please give an example to send a dmx value on a dmx channel

ex channel 1 @ dmx 120, i would like to make something like this : http://www.lightfactory.net/page.php?mPath=2_56_57&x=303&y=ArtNet_remote
 
by advance thx

Jeff

Simon Newton

unread,
Feb 12, 2013, 9:53:02 PM2/12/13
to open-l...@googlegroups.com
On Tue, Feb 12, 2013 at 9:39 AM, jeff . <jeff.f...@gmail.com> wrote:
> I'm learning Objective-C but i'm light technician and i juste need a code
> example to send a simple value (or a slider value) on a dmx channel on a
> selected Univers and subnet

Use:

artnet_send_dmx(artnet_node n, int port_id, int16_t length, const
uint8_t *data);

you'll need to call

artnet_set_port_addr( ) and maybe artnet_set_subnet_addr( ) first.

Simon

>
> thank's
>
>
> Le mardi 12 février 2013 06:08:22 UTC+1, jeff . a écrit :
>>>
>>> Hi,
>>
>>
>> I follow your tuto and all work's fine in the Ipad simulator
>> The node is started and receive dmx messages from and external
>> program(Luminair)
>> could you please give an example to send a dmx value on a dmx channel
>>
>> ex channel 1 @ dmx 120, i would like to make something like this :
>> http://www.lightfactory.net/page.php?mPath=2_56_57&x=303&y=ArtNet_remote
>>
>> by advance thx
>>
>> Jeff
>
> --
> You received this message because you are subscribed to the Google Groups
> "open-lighting" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to open-lightin...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

jeff .

unread,
Feb 13, 2013, 9:49:15 AM2/13/13
to open-l...@googlegroups.com
For the subnet and the port adress i do that  and i think it's ok :

uint8_t subnet_addr = 0;

uint8_t port_addr = 1;



but for this : artnet_send_dmx(artnet_node n, int port_id,  int16_t length, const uint8_t *data); 

i'm not shure..i don't know who is who for the channel and the value of this channel


juste for help me could you please Simon give me the good code to send :


Subnet  : 0

Port    : 1

Channel : 10

Value of channel 10 at : 127


thank you for your help Simon

Simon Newton

unread,
Feb 13, 2013, 11:04:57 AM2/13/13
to open-l...@googlegroups.com
On Wed, Feb 13, 2013 at 6:49 AM, jeff . <jeff.f...@gmail.com> wrote:
> For the subnet and the port adress i do that and i think it's ok :
>
> uint8_t subnet_addr = 0;
>
> uint8_t port_addr = 1;
>
>
>
> but for this : artnet_send_dmx(artnet_node n, int port_id, int16_t length,
> const uint8_t *data);
>
> i'm not shure..i don't know who is who for the channel and the value of this
> channel
>
>
> juste for help me could you please Simon give me the good code to send :
>
>
> Subnet : 0
>
> Port : 1
>
> Channel : 10
>
> Value of channel 10 at : 127

uint8_t dmx[512] = {0};
dmx[9] = 127;
artnet_send_dmx(node, 1, sizeof(dmx), dmx);

jeff .

unread,
Feb 13, 2013, 5:56:47 PM2/13/13
to open-l...@googlegroups.com
Simon,

Work's fine in the simulator but crash after 20s on the Ipad
i think it's because all the code is in the main.m

to start my freeware, have you a working copy of your code implanted in the ViewController.h & .m?
i tryed to do it by myself but i have lot of reds error in xcode

I think after this I'll be in familiar territory and to implement independent the sliders

 thank's again Simon

Simon Newton

unread,
Feb 13, 2013, 9:16:51 PM2/13/13
to open-lighting, Tobi Schäfer
On Wed, Feb 13, 2013 at 2:56 PM, jeff . <jeff.f...@gmail.com> wrote:
> Simon,
>
> Work's fine in the simulator but crash after 20s on the Ipad
> i think it's because all the code is in the main.m
>
> to start my freeware, have you a working copy of your code implanted in the
> ViewController.h & .m?
> i tryed to do it by myself but i have lot of reds error in xcode

I don't I'm afraid . I've never programmed in Objective C nor used the
XCode GUI.

Tobi did the iOS work.

Simon

jeff .

unread,
Feb 14, 2013, 7:21:18 AM2/14/13
to open-l...@googlegroups.com
thank's Simon,
It's ok for me, the code is now outside the main.m file but always crash after 20s on my Ipad.
I will check with Toby for my crash problem

Jeff

Jeff FreeMan

unread,
Feb 20, 2013, 5:58:13 PM2/20/13
to open-l...@googlegroups.com

I have a problem with the libartnet code...
i have created 3 sliders to have differents dmx values / 1 DMX start button / 1 DMX stop button
but after 255 dmx sent, my code stop to send dmx but the app don't crash
perhaps a buffer saturated?


this is my code :

-(IBAction)onartnet :(id) sender

{

    timer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(sendartnet:) userInfo:nil repeats:YES];

}



-(IBAction)sendartnet :(id) sender

{

    artnet_node *artnetNode = artnet_new(ip_addr, 1);

    artnet_set_long_name(artnetNode, "ArtPAD");

    artnet_set_short_name(artnetNode, "AP");

    artnet_start(artnetNode);

    artnet_set_subnet_addr(artnetNode, subnet_addr) ;

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;

    artnet_set_port_addr(artnetNode, 0, ARTNET_OUTPUT_PORT, port_addr);

    artnet_dump_config(artnetNode);

    artnet_set_handler(artnetNode, ARTNET_RECV_HANDLER, artnetReceiver, NULL);

    

        printf("arnet_get_sd() => %i\n", artnet_get_sd(artnetNode));

        printf("artnet_read() => %i\n", artnet_read(artnetNode, 1));

    

    int sl0 = 0;

    int slvalue0 = slider0.value;

    int sl1 = 1;

    int slvalue1 = slider1.value;

    int sl2 = 2;

    int slvalue2 = slider2.value;  

    uint8_t dmx[512] = {0};

    dmx[sl0] = slvalue0;

    dmx[sl1] = slvalue1;

    dmx[sl2] = slvalue2;

    artnet_send_dmx(artnetNode, 1sizeof(dmx), dmx);

    artnet_stop(artnetNode);

    artnet_destroy(artnetNode);   

}


-(IBAction)offartnet    :(id) sender

{

    artnet_node *artnetNode = artnet_new(ip_addr, 1);

    artnet_stop(artnetNode);

    artnet_destroy(artnetNode);

    [timer invalidate];

    timer = nil;

}


this is my log file :
......
.......
........

#########################

Binding to 0.0.0.0 

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

#### NODE CONFIG ####

Node Type: 0

Short Name: AP

Long Name: ArtPAD

Subnet: 0

Default Subnet: 0

Net Ctl: 0

#####################

arnet_get_sd() => 254

artnet_read() => 0

sending to 192.168.0.255

#### INTERFACES FOUND ####

IP: 192.168.0.33

  bcast: 192.168.0.255

  hwaddr: 00:00:00:00:00:00

#########################

Binding to 0.0.0.0 

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

#### NODE CONFIG ####

Node Type: 0

Short Name: AP

Long Name: ArtPAD

Subnet: 0

Default Subnet: 0

Net Ctl: 0

#####################

arnet_get_sd() => 255

artnet_read() => 0

sending to 192.168.0.255

#### INTERFACES FOUND ####

IP: 192.168.0.33

  bcast: 192.168.0.255

  hwaddr: 00:00:00:00:00:00

#########################

#### NODE CONFIG ####

Node Type: 0

Short Name: AP

Long Name: ArtPAD

Subnet: 0

Default Subnet: 0

Net Ctl: 0

#####################  -- DMX STOP HERE

arnet_get_sd() => -5

artnet_read() => -5

arnet_get_sd() => -3

artnet_read() => -3

arnet_get_sd() => -3

artnet_read() => -3

arnet_get_sd() => -3

artnet_read() => -3

...
...
...
...
...

artnet_read() => -3

arnet_get_sd() => -3

artnet_read() => -3

...

...

...

Simon Newton

unread,
Feb 20, 2013, 6:14:57 PM2/20/13
to open-l...@googlegroups.com
On Wed, Feb 20, 2013 at 2:58 PM, Jeff FreeMan <jeff.f...@gmail.com> wrote:
>
>
> I have a problem with the libartnet code...
> i have created 3 sliders to have differents dmx values / 1 DMX start button / 1 DMX stop button
> but after 255 dmx sent, my code stop to send dmx but the app don't crash
> perhaps a buffer saturated?
>

There are two problems here.

It looks like you're creating a new node for every frame. Instead you
need to create a single node once at startup and then call
artnet_send_dmx for each frame.

This has exposed a bug in libartnet where we don't close the socket
used to fetch the interface configuration. I'll fix that tonight.

I suspect IOS limits a process to 256 descriptors, which is why it
stops working.


Simon

Jeff FreeMan

unread,
Feb 20, 2013, 6:57:22 PM2/20/13
to open-l...@googlegroups.com
Could you please suggest me a modification for my first code?i'm a beginner in C
i hade tryed this but without success :

-(IBAction)onartnet :(id) sender

{

   

    timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(sendartnet:) userInfo:nil repeats:YES];

 

}



-(IBAction)sendartnet :(id) sender

{

    artnet_node *artnetNode = artnet_new(ip_addr1);

    

    

  

    int sl0 = 0;

Simon Newton

unread,
Feb 20, 2013, 8:54:22 PM2/20/13
to open-l...@googlegroups.com
On Wed, Feb 20, 2013 at 3:57 PM, Jeff FreeMan <jeff.f...@gmail.com> wrote:
> Could you please suggest me a modification for my first code?i'm a beginner
> in C
> i hade tryed this but without success :

I don't know Objective-C so I'm afraid I can't help.

I've fixed the bug in libartnet and released a new version:
http://code.google.com/p/open-lighting/downloads/detail?name=libartnet-1.1.1.tar.gz

Simon

> -(IBAction)onartnet :(id) sender
>
> {
>
>
>
> timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self
> selector:@selector(sendartnet:) userInfo:nil repeats:YES];
>
>
>
> }
>
>
>
> -(IBAction)sendartnet :(id) sender
>
> {
>
> artnet_node *artnetNode = artnet_new(ip_addr, 1);
>
>
>
>
>
>
>
> int sl0 = 0;
>
> int slvalue0 = slider0.value;
>
> int sl1 = 1;
>
> int slvalue1 = slider1.value;
>
> int sl2 = 2;
>
> int slvalue2 = slider2.value;
>
>
>
>
>
> uint8_t dmx[512] = {0};
>
> dmx[sl0] = slvalue0;
>
> dmx[sl1] = slvalue1;
>
> dmx[sl2] = slvalue2;
>
> artnet_send_dmx(artnetNode, 1, sizeof(dmx), dmx);
>
>
>
> }
>
>

Jeff FreeMan

unread,
Feb 20, 2013, 9:41:24 PM2/20/13
to open-l...@googlegroups.com
I think you have made a good job Simon
i corrected my code and put your new library and now all work's perfectly

 Thank YOU Simon

Simon Newton

unread,
Feb 20, 2013, 10:02:44 PM2/20/13
to open-lighting


On Feb 20, 2013 6:41 PM, "Jeff FreeMan" <jeff.f...@gmail.com> wrote:
>>
>> I think you have made a good job Simon
>
> i corrected my code and put your new library and now all work's perfectly

You still have a problem in that you're creating a node each time you send a frame. I've just fixed the socket leak which is what caused it to crash.

Simon
>
>  Thank YOU Simon

Jeff FreeMan

unread,
Feb 21, 2013, 12:16:58 PM2/21/13
to open-l...@googlegroups.com
Simon
 

What is the sentence for receiving and displaying the value of a specific channel dmx on a specific universe

ex : display the dmx value of the channel 3 of the univer 5
 
i want to change the RGB color of my screen with 3 specified dmx channels 


thank's for your help Simon

Simon Newton

unread,
Feb 21, 2013, 12:24:39 PM2/21/13
to open-l...@googlegroups.com
On Thu, Feb 21, 2013 at 9:16 AM, Jeff FreeMan <jeff.f...@gmail.com> wrote:
> Simon
>
>>
>> What is the sentence for receiving and displaying the value of a specific
>> channel dmx on a specific universe
>
> ex : display the dmx value of the channel 3 of the univer 5

You need to call artnet_set_dmx_handler() and pass a function pointer
in the form:

int dmx_handler(artnet_node n, int port, void *d)

within that function you can call

int len;
uint8_t *data = artnet_read_dmx(n, prt, &len);

data then points to the dmx frame and the length of the frame is in len.

Simon


>
> i want to change the RGB color of my screen with 3 specified dmx channels
>
>
> thank's for your help Simon
>

Jeff FreeMan

unread,
Feb 21, 2013, 1:34:40 PM2/21/13
to open-l...@googlegroups.com
have you an exemple even in c language even as you gave me for sendig data :
 
uint8_t dmx[512] = {0}; 
dmx[9] = 127; 
artnet_send_dmx(node, 1,  sizeof(dmx), dmx);
 

an exemple to display channels 1/2/3 of univer 5

it is better for me to understand, I can adapt C to objective-c

thx

Simon Newton

unread,
Feb 22, 2013, 10:30:55 AM2/22/13
to open-l...@googlegroups.com

Jeff FreeMan

unread,
Feb 22, 2013, 2:35:36 PM2/22/13
to open-l...@googlegroups.com
ooops :) 

404. That’s an error.

The requested URL /p/open-lighting/source/browse/src/artnet-dmxmonitor.c was not found on this server. That’s all we know.

Simon Newton

unread,
Feb 22, 2013, 2:39:35 PM2/22/13
to open-l...@googlegroups.com

Jeff FreeMan

unread,
Feb 22, 2013, 3:08:09 PM2/22/13
to open-l...@googlegroups.com
yes i can now receive dmx message

Two other issues :

i use this to change subnet adress :

uint8_t subnet_addr = 0;

uint8_t port_addr = 0;


if i put :


uint8_t subnet_addr = 1;

uint8_t port_addr = 0;


the output Univers is 16, if i put :


uint8_t port_addr = 2;

uint8_t port_addr = 0;

the output Univers is 32


to have output univers to 2, i tryed this :

uint8_t port_addr = 0x02;

uint8_t port_addr = 0;

but i have always my output univers to 32....

i don't understand how it work's???


2

I now receive dmx input with :


int artnetReceiver(artnet_node node, void *pp, void *d) {

    NSLog(@"Receiving Art-Net data!");

    artnet_packet pack = (artnet_packet) pp;

    printf("Received packet data %s\n", pack->data.admx.data);

    return 0;



when i send to the node dmx data (0 to 255), my output node is in ascii, have you a way to have it in Hexa or Decimal?



thank you 


Jeff

Jeff FreeMan

unread,
Feb 23, 2013, 10:44:20 PM2/23/13
to open-l...@googlegroups.com
part 2 is solved :-)
  part 1 stay :

i use this to change subnet adress :

uint8_t subnet_addr = 0;

uint8_t port_addr = 0;


if i put :

uint8_t subnet_addr = 1;

uint8_t port_addr = 0;

the output Univers is 16

if i put :

uint8_t port_addr = 2;

uint8_t port_addr = 0;

the output Univers is 32


to have output univers to 2, i tryed this :

uint8_t port_addr = 0x02;

uint8_t port_addr = 0;

but i have always my output univers to 32....

i don't understand how it work's???

could you please explan to me


thx Simon

Simon Newton

unread,
Feb 24, 2013, 12:26:43 PM2/24/13
to open-l...@googlegroups.com
The sub-net address is the high 4 bits, the port address is the low 4 bits.

So to use universe 2 you need:

> uint8_t subnet_addr = 0;
> uint8_t port_addr = 2;

Simon

Jeff FreeMan

unread,
Feb 24, 2013, 1:21:50 PM2/24/13
to open-l...@googlegroups.com
change nothing for me
uint8_t subnet_addr = 0; 
uint8_t port_addr = 2; 
give me univers 0

uint8_t subnet_addr = 1; 
uint8_t port_addr = 0; 
give me univers 16

uint8_t subnet_addr = 2; 
uint8_t port_addr = 0; 
give me univers 32

uint8_t subnet_addr = 2; 
uint8_t port_addr = 2; 
give me univers 32

uint8_t subnet_addr = 8; 
uint8_t port_addr = 8; 
give me univers 128

uint8_t subnet_addr = 8; 
uint8_t port_addr = 0; 
give me univers 128

so 
when inchange the value uint8_t port_addr : no output change
when inchange the value uint8_t subnet_add : 0= univer 0  /  1= univer16   /  2= univer 32  /  3= univer48 ...... 7 = 112  /  8 = 128

subnet_addr +1 = univer +16

strange....

my code is:

    artnet_node *artnetNode = artnet_new(ip_addr, 1);

    artnet_set_long_name(artnetNode, "ArtPAD");

    artnet_set_short_name(artnetNode, "AP");

    artnet_start(artnetNode);

    artnet_set_subnet_addr(artnetNode, subnet_addr) ;

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;

    artnet_set_port_addr(artnetNode, 0, ARTNET_OUTPUT_PORT, port_addr);



an other issue
my app is universal iphone/iphad work's fine but the same app : 
transmitt and receive dmx on ipad simulator and real ipad
transmitt and receive dmx on iphone simulator 
receive dmx on real iphone but no transmitt dmx... (i test it with differents iphone / app don't crash, receive but no dmx output)
i test to compile for iOS 4,3 / 5,0 / 5,1 / 6,0 change nothing


thank's Simon

Jeff
 

Simon Newton

unread,
Feb 24, 2013, 2:19:29 PM2/24/13
to open-l...@googlegroups.com
Try adding a call to

artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT)

and see what that returns.

I don't know what the problem is the following code works fine for me:



artnet_node *artnetNode = artnet_new(ip_addr, 1);
artnet_set_long_name(artnetNode, "ArtPAD");
artnet_set_short_name(artnetNode, "AP");
artnet_start(artnetNode);

uint8_t subnet_addr = 0;
uint8_t port_addr = 2;
artnet_set_subnet_addr(artnetNode, subnet_addr) ;
artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;
artnet_set_port_addr(artnetNode, 0, ARTNET_OUTPUT_PORT, port_addr);
printf("Port address is 0x%02hx\n",
artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT));


prints:

Port address is 0x02

BTW, you should call artnet_start() after making the port changes so
you minimize the number of polls sent.

Simon


>
>
>
>> an other issue
>
> my app is universal iphone/iphad work's fine but the same app :
> transmitt and receive dmx on ipad simulator and real ipad
> transmitt and receive dmx on iphone simulator
> receive dmx on real iphone but no transmitt dmx... (i test it with
> differents iphone / app don't crash, receive but no dmx output)
> i test to compile for iOS 4,3 / 5,0 / 5,1 / 6,0 change nothing
>
>
> thank's Simon
>
> Jeff
>
>

Jeff FreeMan

unread,
Feb 24, 2013, 3:02:35 PM2/24/13
to open-l...@googlegroups.com
i tryed...no change
 

artnet_node *artnetNode = artnet_new(ip_addr, 1);

    artnet_set_long_name(artnetNode, "ArtPAD");

    artnet_set_short_name(artnetNode, "AP");

    uint8_t subnet_addr = 0;

    uint8_t port_addr = 2;

    artnet_start(artnetNode);

    artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT);

    artnet_set_subnet_addr(artnetNode, subnet_addr) ;

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;

    artnet_set_port_addr(artnetNode, 0, ARTNET_OUTPUT_PORT, port_addr);

    artnet_dump_config(artnetNode);

    artnet_set_handler(artnetNode, ARTNET_RECV_HANDLER, artnetReceiver, NULL);

      printf("Port address is 0x%02x\n",

           artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT));

      NSLog(@"ffffffdddddd"); 


this is my log file :

#### INTERFACES FOUND ####

IP: 192.168.0.33

  bcast: 192.168.0.255

  hwaddr: 00:00:00:00:00:00

#########################

Binding to 0.0.0.0 

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

#### NODE CONFIG ####

Node Type: 0

Short Name: AP

Long Name: ArtPAD

Subnet: 00

Default Subnet: 00

Net Ctl: 0

#####################

Port address is 0x02

2013-02-24 21:00:11.957 ArtPADremote[767:f803] ffffffdddddd

sending to 192.168.0.255

#### INTERFACES FOUND ####

IP: 192.168.0.33

  bcast: 192.168.0.255

  hwaddr: 00:00:00:00:00:00

#########################





PS : an idea for the iphone problem? (no data output)

Simon Newton

unread,
Feb 24, 2013, 3:06:00 PM2/24/13
to open-l...@googlegroups.com
That looks fine. What's the exact problem that you see?

Simon
 





PS : an idea for the iphone problem? (no data output)

--

Jeff FreeMan

unread,
Feb 24, 2013, 3:42:09 PM2/24/13
to open-l...@googlegroups.com
for :

 uint8_t subnet_addr = 2;

 uint8_t port_addr = 5;


my log is :
 

#### INTERFACES FOUND ####

IP: 192.168.0.33

  bcast: 192.168.0.255

  hwaddr: 00:00:00:00:00:00

#########################

Binding to 0.0.0.0 

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

#### NODE CONFIG ####

Node Type: 0

Short Name: AP

Long Name: ArtPAD

Subnet: 0x2

Default Subnet: 0x2

Net Ctl: 0

#####################

Port address is 0x25  not thrue

2013-02-24 21:35:46.024 ArtPADremote[938:f803] ffffffdddddd

sending to 192.168.0.255

#### INTERFACES FOUND ####

IP: 192.168.0.33

  bcast: 192.168.0.255

  hwaddr: 00:00:00:00:00:00

#########################


but my real dmx output is :
active univers (in hexa) : 2:0 and i want 2:5
i check this with 2 differents externals software 


Simon Newton

unread,
Feb 24, 2013, 4:01:43 PM2/24/13
to open-l...@googlegroups.com

Are you sure you have the ports around the right way?

To send ArtNet, use the OUTPUT_PORT
To receive ArtNet, use the INPUT_PORT

Simon


Jeff FreeMan

unread,
Feb 24, 2013, 4:27:21 PM2/24/13
to open-l...@googlegroups.com
Yes sure in red output port code and to check, i use 2 artnet monitor software (eliosoft and GrandMA2 from MaLigting) and it say the same thing, my used dmx is 2:0

 

    artnet_node *artnetNode = artnet_new(ip_addr, 1);

    artnet_set_long_name(artnetNode, "ArtPAD");

    artnet_set_short_name(artnetNode, "AP");

    uint8_t subnet_addr = 2; thrue

    uint8_t port_addr = 5;  wrong

    artnet_start(artnetNode);

    artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT);

    artnet_set_subnet_addr(artnetNode, subnet_addr) ;

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;

    artnet_set_port_addr(artnetNode, 0, ARTNET_OUTPUT_PORT, port_addr);

    artnet_dump_config(artnetNode);

    artnet_set_handler(artnetNode, ARTNET_RECV_HANDLER, artnetReceiver, NULL);

      printf("Port address is 0x%02x\n",

           artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT));

      NSLog(@"ffffffdddddd");

#### INTERFACES FOUND ####

IP: 192.168.0.33

  bcast: 192.168.0.255

  hwaddr: 00:00:00:00:00:00

#########################

Binding to 0.0.0.0 

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

#### NODE CONFIG ####

Node Type: 0

Short Name: AP

Long Name: ArtPAD

Subnet: 0x2

Default Subnet: 0x2

Net Ctl: 0

#####################

Port address is 0x25 not thrue

2013-02-24 22:18:33.215 ArtPADremote[988:f803] ffffffdddddd

Simon Newton

unread,
Feb 24, 2013, 4:32:55 PM2/24/13
to open-l...@googlegroups.com
On Sun, Feb 24, 2013 at 1:01 PM, Simon Newton <nom...@gmail.com> wrote:

Are you sure you have the ports around the right way?

To send ArtNet, use the OUTPUT_PORT
To receive ArtNet, use the INPUT_PORT

Sorry, that was also round the wrong way.

To send ArtNet, use the INPUT_PORT
To receive ArtNet, use the OUTPUT_PORT

Jeff FreeMan

unread,
Feb 24, 2013, 4:57:27 PM2/24/13
to open-l...@googlegroups.com
i try this code but same error for 2:5 in the code i have 2:0 in the life 
i have checked with differents code values 2:0/2:1/2:8  allways have 2:0 in the life
it's strange because i can change the subnet ( 3:5 retourne 3:0) but not the port

artnet_node *artnetNode = artnet_new(ip_addr, 1);

    artnet_set_long_name(artnetNode, "ArtPAD");

    artnet_set_short_name(artnetNode, "AP");

    uint8_t subnet_addr = 2;

    uint8_t port_addr = 5;

    artnet_start(artnetNode);

    artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT);

    artnet_get_universe_addr(artnetNode, 0, ARTNET_INPUT_PORT);

    // set the upper 4 bits of the universe address subnet_addr

    artnet_set_subnet_addr(artnetNode, subnet_addr) ;

    // enable port 0

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ;

    // bind port 0 to universe 1

    artnet_set_port_addr(artnetNode, 0, ARTNET_OUTPUT_PORT, port_addr);

    artnet_set_port_addr(artnetNode, 0, ARTNET_INPUT_PORT, port_addr);

    artnet_dump_config(artnetNode);

    artnet_set_handler(artnetNode, ARTNET_RECV_HANDLER, artnetReceiver, NULL);

    printf("Port address is 0x%02x\n",

           artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT));

    NSLog(@"InPUT PORT");

    printf("Port address is 0x%02x\n",

           artnet_get_universe_addr(artnetNode, 0, ARTNET_INPUT_PORT));

    NSLog(@"OuPUT PORT");

 the log :

#### INTERFACES FOUND ####

IP: 192.168.0.33

  bcast: 192.168.0.255

  hwaddr: 00:00:00:00:00:00

#########################

Binding to 0.0.0.0 

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

sending to 192.168.0.255

#### NODE CONFIG ####

Node Type: 0

Short Name: AP

Long Name: ArtPAD

Subnet: 0x2

Default Subnet: 0x2

Net Ctl: 0

#####################

Port address is 0x25

2013-02-24 22:51:04.596 ArtPADremote[1236:f803] InPUT PORT

Port address is 0x25

2013-02-24 22:51:04.600 ArtPADremote[1236:f803] OuPUT PORT

sending to 192.168.0.255

sending to 192.168.0.255

#### INTERFACES FOUND ####

Simon Newton

unread,
Feb 24, 2013, 5:05:34 PM2/24/13
to open-l...@googlegroups.com
On Sun, Feb 24, 2013 at 1:57 PM, Jeff FreeMan <jeff.f...@gmail.com> wrote:
i try this code but same error for 2:5 in the code i have 2:0 in the life 
i have checked with differents code values 2:0/2:1/2:8  allways have 2:0 in the life
it's strange because i can change the subnet ( 3:5 retourne 3:0) but not the port

artnet_node *artnetNode = artnet_new(ip_addr, 1);

    artnet_set_long_name(artnetNode, "ArtPAD");

    artnet_set_short_name(artnetNode, "AP");

    uint8_t subnet_addr = 2;

    uint8_t port_addr = 5;

    artnet_start(artnetNode);

    artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORT);

    artnet_get_universe_addr(artnetNode, 0, ARTNET_INPUT_PORT);

    // set the upper 4 bits of the universe address subnet_addr

    artnet_set_subnet_addr(artnetNode, subnet_addr) ;

    // enable port 0

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ;

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ;'


^^ This won't work because the second one resets the port type to INPUT. You need to use ARTNET_ENABLE_OUTPUT & ARTNET_ENABLE_INPUT in a single call.


 
--

Jeff FreeMan

unread,
Feb 24, 2013, 5:29:09 PM2/24/13
to open-l...@googlegroups.com
i try this but the problem stay in the code 4:7 in the life 4:0
 

artnet_node *artnetNode = artnet_new(ip_addr, 1);

    artnet_set_long_name(artnetNode, "ArtPAD");

    artnet_set_short_name(artnetNode, "AP");

    uint8_t subnet_addr = 4;

    uint8_t port_addr = 8;

    artnet_start(artnetNode);

 

    artnet_get_universe_addr(artnetNode, 0, ARTNET_OUTPUT_PORTARTNET_INPUT_PORT);

   

    artnet_set_subnet_addr(artnetNode, subnet_addr) ;

   

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_OUTPUT & ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ;

    

   

    artnet_set_port_addr(artnetNode, 0, ARTNET_OUTPUT_PORTARTNET_INPUT_PORT, port_addr);

Jeff FreeMan

unread,
Feb 25, 2013, 1:00:16 AM2/25/13
to open-l...@googlegroups.com
I'm really sorry, but I just  understand from where my mistake comes, you will understand with more of my code
the code of all my function is named 'send artnet' :
in this function i declare artnet_node with : artnet_node *artnetNodeartnet_new(ip_addr1);
so i start a new mode, BUT each time a call this function i start a new node
and when i call in the middle of my code : i call artnet_set_port_addr(artnetNode0ARTNET_OUTPUT_PORT &  ARTNET_INPUT_PORT, port_addr); and call again artnetNode so i star again a new node and "ARTNET_OUTPUT_PORT &  ARTNET_INPUT_PORT" take de default value : 0
i can try to modify it, it will take is défaut value each time so 0
at the end of my code kill the mode with  artnet_stop(artnetNode); and artnet_destroy(artnetNode);
i have created a timer in an other function (a button named 'start artnet' ) to call all the function blow each 0,1s
and an other function to stop this timer and kill definitively the node (a button named 'stop artnet' )
i juste have to :
change the code of my start button by integrating artnet_node *artnetNode = artnet_new(ip_addr1); inside (i know how to do this)
creat the code of my stop button i know how to do this ;-) )
in the function named 'send artnet' i have to change in all the code the VAR  *artnetNode by an other name ex :MyNode
and declare it like this artnet_node *MytNode = ???????; (I do not know what to put in the place of ????? and need your help for this part)

original with error function

    artnet_send_poll(artnetNode, NULL, ARTNET_TTM_DEFAULT);

    uint8_t dmx[512] = {0};

    dmx[9] = 127;

    artnet_send_dmx(artnetNode, 1sizeof(dmx), dmx);

    artnet_stop(artnetNode);

    artnet_destroy(artnetNode);




the final and desired version will be

button named 'start artnet'
    timer who call send arnet function

    char *ip_addr = NULL;

    artnet_node *artnetNode = artnet_new(ip_addr1);

fonction named 'send artnet'

    artnet_node *MyNode = ????????;             ------- help me ;-)

    artnet_set_long_name(MyNode, "ArtPAD");

    artnet_set_short_name(MyNode, "AP");

    uint8_t subnet_addr = 4;

    uint8_t port_addr = 8; 

    artnet_start(MyNode);

    artnet_get_universe_addr(MyNode, 0, ARTNET_OUTPUT_PORT &  ARTNET_INPUT_PORT);

    artnet_set_subnet_addr(MyNode, subnet_addr);

    artnet_set_port_type(MyNode, 0, ARTNET_ENABLE_OUTPUT & ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ;

    artnet_set_port_addr(MyNode, 0, ARTNET_OUTPUT_PORT &  ARTNET_INPUT_PORT, port_addr);    

    artnet_dump_config(MyNode);    

    artnet_set_handler(MyNode, ARTNET_RECV_HANDLER, artnetReceiver, NULL);

    artnet_send_poll(MyNode, NULL, ARTNET_TTM_DEFAULT);

    uint8_t dmx[512] = {0};

    dmx[9] = 127;

    artnet_send_dmx(MyNode, 1,  sizeof(dmx), dmx);


button named 'stop artnet'

    stop the timer

    artnet_stop(artnetNode);

    artnet_destroy(artnetNode);

Jeff FreeMan

unread,
Feb 26, 2013, 11:15:43 AM2/26/13
to open-l...@googlegroups.com
All is resolved!!!!!


Jeff FreeMan

unread,
Feb 26, 2013, 11:32:44 AM2/26/13
to open-l...@googlegroups.com

an other issue
my app is universal iphone/iphad work's fine but the same app : 
transmitt and receive dmx on ipad simulator and real ipad
transmitt and receive dmx on iphone simulator 
receive dmx on real iphone but no transmitt dmx... (i test it with differents iphone / app don't crash, receive but no dmx output)
i test to compile for iOS 4,3 / 5,0 / 5,1 / 6,0 change nothing
have you ever tested libarnet on iphone?

thank's Simon

Jeff

Pascal Johann

unread,
Oct 8, 2013, 8:04:16 AM10/8/13
to open-l...@googlegroups.com
is there any sample project available for download?

z...@thelucidproject.ca

unread,
Mar 19, 2019, 12:44:08 PM3/19/19
to open-lighting
Hello there,

Although this thread has been inactive for quite some time, I thought I'd try my luck.
I'm trying to use this program to send DMX data to some lights [see code below].

The issue that I'm having is that the program is detecting an IP address, which isn't even connected to the same network as the phone is, BUT the DMX converter which IS connected to the same network isn't being detected. I've tried setting the ip_addr parameter to the IP address of the device I'm trying to send data to, and no luck. The program isn't finding it.

Here's the output in the console :

#### INTERFACES FOUND ####

IP: 10.227.165.208

  bcast: 0.0.0.0

  hwaddr: 00:00:00:00:00:00

#########################

#### NODE CONFIG ####

Node Type: 0

Short Name: ANT

Long Name: Art-Net Test

Subnet: 00

Default Subnet: 00

Net Ctl: 0

#####################

Binding to 0.0.0.0 

Binding to 0.0.0.0 

sending to 0.0.0.0

sending to 0.0.0.0

sending to 0.0.0.0

arnet_get_sd() => 3




Do any of you have any ideas about what might be happening ? Why would the program be detecting IP addresses that aren't on my network, and why isn't my device which is on the network being seen ? I've used NMU to confirm that the device is on the network and can receive DMX data. 

Thanks so much,
Zoe






CODE : 


    char *ip_addr = NULL;

    

    uint8_t subnet_addr = 0;

    uint8_t port_addr = 1;

    

    artnet_node *artnetNode = artnet_new(ip_addr, 1);

    

    if (!artnetNode) {

        printf("inside !artnetNode \n");

        printf("Error: %s\n", artnet_strerror());

        exit(-1);

    }

    

    artnet_set_long_name(artnetNode, "Art-Net Test");

    artnet_set_short_name(artnetNode, "ANT");

    

    // set the upper 4 bits of the universe address

    artnet_set_subnet_addr(artnetNode, subnet_addr) ;

    

    // enable port 0

    artnet_set_port_type(artnetNode, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ;

    

    // bind port 0 to universe 1

    artnet_set_port_addr(artnetNode, 0, ARTNET_INPUT_PORT, port_addr);

    

    artnet_dump_config(artnetNode);

    

    artnet_set_handler(artnetNode, ARTNET_RECV_HANDLER, artnetReceiver, NULL);

    

    if (artnet_start(artnetNode) != 0) {

        

        printf("inside artnet_start");

        

        printf("Error: %s\n", artnet_strerror());

        exit(-1);

    }

    

    while (YES) {

        artnet_send_poll(artnetNode, NULL, ARTNET_TTM_DEFAULT);

        printf("arnet_get_sd() => %i\n", artnet_get_sd(artnetNode));

        printf("artnet_read() => %i\n", artnet_read(artnetNode, 1));

        

        uint8_t dmx[512] = {0};

        

// sample DMX data for R, G channels of first light

        dmx[1] = 254;

        dmx[2] = 254;

 

        artnet_send_dmx(artnetNode, 1,  sizeof(dmx), dmx);

        printf("arnet_get_sd() => %i\n", artnet_get_sd(artnetNode));

        for(int i=1; i<100000; i++) {

        // wait


    } 

Jim Ruxton

unread,
Mar 20, 2019, 2:05:50 AM3/20/19
to open-l...@googlegroups.com

Not sure if this is helpful to you in your case however I am using an Ethernet network for my lighting system.  However unless I turn off my wifi , that is the interface olad finds. Turning off my wifi and plugging in my my network to my Ethernet port results in olad finding the correct interface for me.

Jim

--
The Open Lighting Project: open-l...@googlegroups.com, #openlighting (irc.freenode.org)
To unsubscribe from this group, send email to open-lightin...@googlegroups.com
For more options, visit https://groups.google.com/groups/opt_out?hl=en

Peter Newman

unread,
Apr 14, 2019, 4:53:35 PM4/14/19
to open-lighting
Jim, you can configure which interface each plugin uses, see the ip field here:

On Wednesday, 20 March 2019 06:05:50 UTC, Jim Ruxton wrote:

Not sure if this is helpful to you in your case however I am using an Ethernet network for my lighting system.  However unless I turn off my wifi , that is the interface olad finds. Turning off my wifi and plugging in my my network to my Ethernet port results in olad finding the correct interface for me.

Jim

To unsubscribe from this group, send email to open-lighting+unsubscribe@googlegroups.com
Reply all
Reply to author
Forward
0 new messages