Posts by mcastrigno
-
-
It appears that the program is sending no ArtNet messages of any kind as shown by wireshark.
-
There is no output on wireshark on my dev PC but I will capture what happens on the PC where the actual devices are connected and post that tomorrow.
I cannot write the code on the machine where the devices are but I can run the program on that machine.I believe the devices are responding to polls but I will confirm that and post tomorrow.
Thank you.
-
Hello Qasi,
Wireshark shows no traffic on port 6454 as I am not sucesful in send anything. Here is my test program. The first 60 lines just have to due with my development environment vs that actual environment where the devices are so just ignore those.
Code
Display Moreusing ArtNetSharp; using ArtNetSharp.Communication; using System.Net; using org.dmxc.wkdt.Light.ArtNet; using Microsoft.Extensions.Logging; using System.Net.NetworkInformation; string ledIP = "10.0.33.20"; string buttonIP = "10.0.33.22"; Console.WriteLine("Available Network Interfaces:"); int index = 0; foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) { if (nic.OperationalStatus == OperationalStatus.Up) // Only list active interfaces { Console.WriteLine($"[{index}] {nic.Name} - {nic.Description}"); Console.WriteLine($" Type: {nic.NetworkInterfaceType}"); Console.WriteLine($" Status: {nic.OperationalStatus}"); // Get the IP addresses associated with this interface foreach (UnicastIPAddressInformation ip in nic.GetIPProperties().UnicastAddresses) { Console.WriteLine($" IP Address: {ip.Address}"); } Console.WriteLine(); } index++; } Console.WriteLine("Welcome to the Idaho Rivers Display Program!"); while (true) { Console.WriteLine("Are you running on the actual kiosk? (Y/N)"); var keyTask = Task.Run(() => Console.ReadKey(true).Key); // Read key input bool isKeyPressed = keyTask.Wait(2000); // Wait for input up to 2 seconds Console.WriteLine(); // Move to next line if (isKeyPressed && keyTask.Result == ConsoleKey.N) { ledIP = "10.21.241.90"; buttonIP = "192.168.1.209"; } break; // Exit loop in either case } Console.WriteLine($"LED IP: {ledIP}, Button IP: {buttonIP}"); //Add Logging //ArtNet.AddLoggProvider((ILoggerProvider)logger); //Set Networkinterfaces //ArtNet.Instance.EnableNetworkClientDetection = true; //ArtNet.Instance.NetworkClientsUpdated += OnNetworkClientsUpdated; Console.WriteLine("Waiting for Art-Net nodes to be discovered..."); Thread.Sleep(5000); // Allow time for discovery // ✅ Get List of Discovered Clients var clients = ArtNet.Instance.NetworkClients.ToList(); Console.WriteLine($"🔍 Found {clients.Count} Art-Net devices."); var broadcastIp = new IPAddress(new byte[] { 10, 255, 255, 255 }); var dmxLEDIp = new IPAddress(new byte[] { 10, 0, 30, 20 }); var dmxInputIp = new IPAddress(new byte[] { 10, 0, 30, 22 }); ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress)); //ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = true); foreach (var client in ArtNet.Instance.NetworkClients) { Console.WriteLine($"Discovered Node: {client.LocalIpAddress}"); } var ledClient = ArtNet.Instance.NetworkClients .FirstOrDefault(nc => nc.LocalIpAddress.ToString() == ledIP); var buttonClient = ArtNet.Instance.NetworkClients .FirstOrDefault(nc => nc.LocalIpAddress.ToString() == buttonIP); if (ledClient == null) { Console.WriteLine("Error: LED Controller not found on the network."); } else { Console.WriteLine("Found the LED client."); ledClient.Enabled = true; }; if (buttonClient == null) { Console.WriteLine("Error: Button Client not found on the network."); } else { Console.WriteLine("Found the Button client."); buttonClient.Enabled = true; }; // Create Instance NodeInstance outputNodeInstance = new NodeInstance(ArtNet.Instance); outputNodeInstance.Name = outputNodeInstance.ShortName = "Output Node"; NodeInstance inputNodeInstance = new NodeInstance(ArtNet.Instance); inputNodeInstance.Name = inputNodeInstance.ShortName = "Input Node"; // Configure Output Ports for (byte i = 1; i <= 32; i++) { outputNodeInstance.AddPortConfig(new PortConfig(i, new PortAddress((ushort)(i - 1)), true, false) { PortNumber = (byte)i, Type = EPortType.OutputFromArtNet, GoodOutput = new GoodOutput(outputStyle: GoodOutput.EOutputStyle.Continuous, isBeingOutputAsDMX: true) }); } for (byte i = 1; i <= 32; i++) { inputNodeInstance.AddPortConfig(new PortConfig(i, new PortAddress((ushort)(i - 1)), false, true) { PortNumber = (byte)i, Type = EPortType.OutputFromArtNet, GoodOutput = new GoodOutput(outputStyle: GoodOutput.EOutputStyle.Continuous, isBeingOutputAsDMX: true) }); } ArtNet.Instance.AddInstance(outputNodeInstance); ArtNet.Instance.AddInstance(inputNodeInstance); byte[] data = new byte[128]; for (short k = 0; k < 128; k++) data[k]++; foreach (var port in outputNodeInstance.PortConfigs) outputNodeInstance.WriteDMXValues(port.PortAddress, data); foreach (var port in inputNodeInstance.PortConfigs) outputNodeInstance.WriteDMXValues(port.PortAddress, data); Console.WriteLine("Press any key to Exit!"); Console.ReadLine(); Console.WriteLine("Press any key to Exit!"); Console.ReadLine(); -
Hello! I am looking for some help with the ArtNetSharp library.
I am trying to figure out the types in this constructor for a portconfig. public PortConfig(in byte bindIndex, in Net net, in Address address, in bool output, in bool input) : this(bindIndex, new PortAddress(net, address.Subnet, address.Universe), output, input)
Spefically what Net and Address look like. Are these references to an IP address? How would they need to be formatted?
I want to make a port that communicate with IP address 10.0.33.20 on network 10.0.33.0/24 -
Hello JP
,Thank you for your reply!
This is a long message but hopefully with provide a fairly compete description of what I am trying to do and what I have been able to get to work. The display is dramatically over engineered, but my assigned task is to get it to work, not re-design it.
TLDR version:
I can discover clients, and they make into the list of clients of an ArtNet Instance and create a NodeInstance but cannot config the ports to get messages to be sent.
Complete version:
Yes, I am trying to understand the relationship between ArtNet.Instance, NetworkClients, PortConfig and Universes as the relate to my actual IP network.
As a first step before trying the ArtNetSharp library I created a virtual console in QLC+. This allowed me to determine and test some basic information about the devices in the display. Unfortunately. QLC+ has some limitations keeping me from creating a complete acceptable solution.
Under the translucent material you see in the display are 9 LED strips. There are only 7 rivers, but due to physical layout, 2 rivers require 2 LED strips. The basic operation here is the child presses a button and the associated “River” lights up. There is also a video that plays with each river.
These LED strips are connected to a “Ethernet-SPI/DMX Pixel light controller”. Using QLC+ I have determined and tested that that these strips can be reached at a private local IP address. The ArtNet devices are connected to a PC that has its ethernet adapter configure to a local network all with fixed IP addresses and no router/gateway/DNS. The Wi-Fi adapter of the PC is connected to our internal secure network and that is how I communicate with the PC. This PC is the one which I run QLC+ and hopefully a program written by me utilizing the ArtNetSharp library. I develop the program on my work PC and copy the executable to the display PC.
The nine LED strips are connected to the SPI outputs on the controller are reachable at the IP address of 10.0.33.20, Universes 1-9 respectively. Using QLC+ I can make them turn on blue.
Also connected to the “Ethernet-SPI/DMX Pixel light controller”. Is a 9 channel DMX512 Decoder via DMX512 output port 1 with a three-wire connection. Based on the configuration of the Ethernet-SPI/DMX Pixel light controller the DMX512 Decoder should be reachable on Universe 10 but I have been unsuccessful in connecting to it. (Suggestions? I think it may be failed hardware at the test functions controlled by dipswitches do not work.) The DMX512 Decoder drives LEDs in the buttons on the display.
The Buttons are connected to an Madrix Orion ArtNet input device. Using QLC+ I can detect button presses at the fixed IP address of the input device on/in Universe 20. The short comings of this device are such that it cannot be configured (as confirmed by many messages with support) to send exactly one message that has the value relating to a button press. This results in a random number of messages that a button has been pressed. Each message toggle the button function in QLC+ turning the function on and off each time. This inability to de bounce the button press with either the Madrix Orion or QLC+ is why I have to try to write my own program. (external de-bouncing will not work)
What I have accomplished with ArtNetSharp.
I wrote a test program that successfully discovers the two ArtNet devices on the local network. I have enabled those clients and given them names. I have instantiated new NodeInstances both with ArtNet.Instance as their argument. (not sure if I need two, I designated one out and one in.)
What I cannot do is successfully AddPortConfig with a new PortConfig in way that WriteDMXValues puts anything on the wire as determined by wirehsark.
I find the PortConfig object very confusing. How does a specific IP address get assigned? The constructors have types that I don’t understand of can find explanations of how they work.
Any assistance you can provide would be greatly appreciated.
Thank you!
-
Hello,
I work at a not-for-profit hospital as a software developer and have asked to fix an interactive display in the children's hospital used by children in the lobby. The original creator was an outside organization that is now out of business. The computer that operated the display had a fatal crash and the original program is gone. The display uses a couple of Artnet devices that I want to control using the ArtNetSharp library. I see that many of the followers of that repo are associated with this organization. DMX/ArtNet is not my domain so I am struggling with it a bit. Is there anyone her that may be able to answer a few questions about this repo and how to utilize it? Or know where I may be able to get some help? Thank you!