diff --git a/README.md b/README.md index c662de2db..069f49c99 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,11 @@ * DMX Bridge / **Pixel Controller (WS28xx/SK6812/APA102/UCSx903/P9813)** {[zip](https://github.com/vanvught/h3dmx512-zip/blob/master/opi_emac_osc_dmx.zip?raw=true)} * **Client** with support for buttons {[zip](https://github.com/vanvught/h3dmx512-zip/blob/master/opi_emac_osc_client.zip?raw=true)} * **Real-time Monitor** 1 Universe {[zip](https://github.com/vanvught/h3dmx512-zip/blob/master/opi_emac_osc_monitor.zip?raw=true)} {*Orange Pi One - HDMI output*} + * **PixelPusher (PP)** + * Pixel Controller **WS28xx/SK6812/APA102/UCSx903/P9813** [Orange Pi Zero] + * 8x 680 RGB or 8x 512 RGBW {[zip](https://github.com/vanvught/h3dmx512-zip/blob/master/opi_emac_pp_pixel_multi.zip?raw=true)} + + * **Showfile** * **Player** {[zip](https://github.com/vanvught/h3dmx512-zip/blob/master/opi_emac_showfile.zip?raw=true)} * **RDM** @@ -77,10 +82,12 @@ U-Boot Orange Pi One: [uboot-orangpi_one.img.zip](https://github.com/vanvught/h3 > Special thanks to [@trebisky](https://github.com/trebisky/orangepi) (Thomas J. Trebisky), who helped me in understanding the H3 SoC. # Mac OS X / Linux [debugging purpose only] -## Art-Net 4 / sACN E1.31 / OSC -- **Art-Net 4** Real-time DMX Monitor +## Art-Net 4 / sACN E1.31 / OSC / DDP / PP +- **Art-Net 4** Real-time DMX Monitor +- **DDP** Real-time DMX Monitor {Distributed Display Protocol} - sACN **E.131** Real-time DMX Monitor -- **OSC** Real-time DMX Monitor +- **OSC** Real-time DMX Monitor +- **PP** Real-time DMX Monitor {PixelPusher} # Raspberry Pi Baremetal Open Source ## DMX512 / RDM / Art-Net 3 / sACN E1.31 / Pixel controller @@ -97,8 +104,6 @@ Raspberry Pi **Open Source** solutions: All implementations are fully according to the standards. And successfully used in live lighting shows. -Detailed information can be found here : [http://www.raspberrypi-dmx.org](http://www.raspberrypi-dmx.org) - The kernel7.img is running on both Raspberry Pi 2 and Raspberry Pi 3(B+). > Special thanks to [@rsta2](https://github.com/rsta2/circle) (Rene Stange), who helped me get the multi-core support working. diff --git a/linux_artnet_responder/.cproject b/linux_artnet_responder/.cproject deleted file mode 100755 index 3a1727aca..000000000 --- a/linux_artnet_responder/.cproject +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/linux_artnet_responder/.project b/linux_artnet_responder/.project deleted file mode 100755 index d5cc8fa7e..000000000 --- a/linux_artnet_responder/.project +++ /dev/null @@ -1,27 +0,0 @@ - - - linux_artnet_responder - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/linux_artnet_responder/.settings/language.settings.xml b/linux_artnet_responder/.settings/language.settings.xml deleted file mode 100755 index a01ed58d5..000000000 --- a/linux_artnet_responder/.settings/language.settings.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/linux_artnet_responder/Makefile b/linux_artnet_responder/Makefile deleted file mode 100755 index 723a3e9ff..000000000 --- a/linux_artnet_responder/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -DEFINES =NODE_ARTNET LIGHTSET_PORTS=4 -DEFINES+=RDM_RESPONDER - -DEFINES+=OUTPUT_DMX_MONITOR - -#DEFINES+=NDEBUG - -SRCDIR=src lib - -LIBS= - -include ../firmware-template-linux/Rules.mk - -prerequisites: - ./generate_sofware_version_id.sh diff --git a/linux_artnet_responder/README.md b/linux_artnet_responder/README.md deleted file mode 100755 index b2556277e..000000000 --- a/linux_artnet_responder/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Linux Open Source Art-Net 4 Node -## Real-time DMX Monitor / RDM Responder - -This is an example for testing the [lib-artnet](https://github.com/vanvught/rpidmx512/tree/master/lib-artnet) [lib-artnet4](https://github.com/vanvught/rpidmx512/tree/master/lib-artnet4) C++ libraries. - -Usage : - - ./linux_artnet interface_name|ip_address - -Sample output : - - ~/workspace/linux_artnet$ ./linux_artnet eno1 - cat: /sys/firmware/devicetree/base/model: No such file or directory - [V1.8] Linux #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 Compiled on Feb 25 2019 at 20:20:39 - Art-Net 4 Node - Real-time DMX Monitor {4 Universes} - Network configuration - Hostname : nuc-i5 - Interface : 192.168.2.120 - Netmask : 255.255.255.0 - MacAddress : f4:4d:30:64:d9:e5 - DHCP : No - Node 4 configuration - Firmware : 1.29 - Short name : AvV Art-Net Node - Long name : NUC6i5SYB Art-Net 4 www.orangepi-dmx.org - Net : 0 - Sub-Net : 0 - Port A Universe 1 [HTP] {Art-Net} - Port B Universe 2 [HTP] {Art-Net} - Port C Universe 3 [HTP] {sACN} - Port D Universe 4 [HTP] {sACN} - Bridge configuration - Firmware : 1.7 - Port C Universe 3 [HTP] - Port D Universe 4 [HTP] - 25-02-2019 20:27:12.388241 DMX:A 512:32:1 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 25-02-2019 20:27:12.388366 Start:A - 25-02-2019 20:27:15.424249 DMX:A 512:32:1 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 25-02-2019 20:27:18.466205 DMX:A 512:32:1 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 25-02-2019 20:27:18.596248 DMX:A 512:32:1 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 25-02-2019 20:27:18.628281 DMX:A 512:32:1 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 25-02-2019 20:27:18.632251 DMX:A 512:32:1 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 25-02-2019 20:27:21.042960 DMX:D 512:32:1 216 0 0 216 0 0 216 0 0 216 0 0 216 0 0 216 0 0 216 0 0 216 0 0 216 0 0 216 0 0 216 0 - 25-02-2019 20:27:21.043027 Start:D - 25-02-2019 20:27:21.068281 DMX:D 512:32:1 217 0 0 217 0 0 217 0 0 217 0 0 217 0 0 217 0 0 217 0 0 217 0 0 217 0 0 217 0 0 217 0 - 25-02-2019 20:27:21.104250 DMX:D 512:32:1 218 0 0 218 0 0 218 0 0 218 0 0 218 0 0 218 0 0 218 0 0 218 0 0 218 0 0 218 0 0 218 0 - 25-02-2019 20:27:21.140247 DMX:D 512:32:1 219 0 0 219 0 0 219 0 0 219 0 0 219 0 0 219 0 0 219 0 0 219 0 0 219 0 0 219 0 0 219 0 - 25-02-2019 20:27:21.168252 DMX:D 512:32:1 220 0 0 220 0 0 220 0 0 220 0 0 220 0 0 220 0 0 220 0 0 220 0 0 220 0 0 220 0 0 220 0 - 25-02-2019 20:27:21.196164 DMX:D 512:32:1 221 0 0 221 0 0 221 0 0 221 0 0 221 0 0 221 0 0 221 0 0 221 0 0 221 0 0 221 0 0 221 0 - 25-02-2019 20:27:21.228283 DMX:D 512:32:1 222 0 0 222 0 0 222 0 0 222 0 0 222 0 0 222 0 0 222 0 0 222 0 0 222 0 0 222 0 0 222 0 - 25-02-2019 20:27:21.264251 DMX:D 512:32:1 223 0 0 223 0 0 223 0 0 223 0 0 223 0 0 223 0 0 223 0 0 223 0 0 223 0 0 223 0 0 223 0 - 25-02-2019 20:27:21.292248 DMX:D 512:32:1 224 0 0 224 0 0 224 0 0 224 0 0 224 0 0 224 0 0 224 0 0 224 0 0 224 0 0 224 0 0 224 0 - 25-02-2019 20:27:21.328216 DMX:D 512:32:1 225 0 0 225 0 0 225 0 0 225 0 0 225 0 0 225 0 0 225 0 0 225 0 0 225 0 0 225 0 0 225 0 - 25-02-2019 20:27:21.356246 DMX:D 512:32:1 226 0 0 226 0 0 226 0 0 226 0 0 226 0 0 226 0 0 226 0 0 226 0 0 226 0 0 226 0 0 226 0 - 25-02-2019 20:27:21.384244 DMX:D 512:32:1 227 0 0 227 0 0 227 0 0 227 0 0 227 0 0 227 0 0 227 0 0 227 0 0 227 0 0 227 0 0 227 0 - 25-02-2019 20:27:21.420245 DMX:D 512:32:1 228 0 0 228 0 0 228 0 0 228 0 0 228 0 0 228 0 0 228 0 0 228 0 0 228 0 0 228 0 0 228 0 - 25-02-2019 20:27:21.448243 DMX:D 512:32:1 229 0 0 229 0 0 229 0 0 229 0 0 229 0 0 229 0 0 229 0 0 229 0 0 229 0 0 229 0 0 229 0 - 25-02-2019 20:27:23.952229 Stop:A - 25-02-2019 20:27:23.952286 Stop:D - 25-02-2019 20:27:24.549831 DMX:A 512:32:1 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 25-02-2019 20:27:27.593760 DMX:A 512:32:1 0 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - - -
- - -[http://www.orangepi-dmx.org/raspberry-pi-art-net-dmx-out](http://www.orangepi-dmx.org/raspberry-pi-art-net-dmx-out "http://www.orangepi-dmx.org/raspberry-pi-art-net-dmx-out") \ No newline at end of file diff --git a/linux_artnet_responder/generate_sofware_version_id.sh b/linux_artnet_responder/generate_sofware_version_id.sh deleted file mode 100755 index a2175bf6b..000000000 --- a/linux_artnet_responder/generate_sofware_version_id.sh +++ /dev/null @@ -1,4 +0,0 @@ -echo "// Generated "$(date) > ./include/sofware_version_id.h -var="$(date +%s)" -echo "static const uint32_t DEVICE_SOFTWARE_VERSION_ID="$var";" >> ./include/sofware_version_id.h - diff --git a/linux_artnet_responder/include/factorydefaults.h b/linux_artnet_responder/include/factorydefaults.h deleted file mode 100644 index c87bb41cc..000000000 --- a/linux_artnet_responder/include/factorydefaults.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file factorydefaults.h - * - */ -/* Copyright (C) 2021-2022 by Arjan van Vught mailto:info@orangepi-dmx.nl - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef FACTORYDEFAULTS_H_ -#define FACTORYDEFAULTS_H_ - -#include "remoteconfig.h" -#include "configstore.h" -#include "storenetwork.h" - -namespace rdm { -namespace device { -namespace responder { - -void factorydefaults() { - RemoteConfig::Get()->SetDisable(false); - ConfigStore::Get()->ResetSetList(configstore::Store::RDMDEVICE); - StoreNetwork::Get()->SaveDhcp(true); -} - -} // namespace responder -} // namespace device -} // namespace rdm - - -#endif /* FACTORYDEFAULTS_H_ */ diff --git a/linux_artnet_responder/include/software_version.h b/linux_artnet_responder/include/software_version.h deleted file mode 100644 index b7ac7a4d1..000000000 --- a/linux_artnet_responder/include/software_version.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @file software_version.h - * - */ -/* Copyright (C) 2017-2021 by Arjan van Vught mailto:info@raspberrypi-dmx.nl - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef SOFTWARE_VERSION_H_ -#define SOFTWARE_VERSION_H_ - -static const char SOFTWARE_VERSION[] = "2.2"; - -#endif /* SOFTWARE_VERSION_H_ */ diff --git a/linux_artnet_responder/lib/artnetdisplay.cpp b/linux_artnet_responder/lib/artnetdisplay.cpp deleted file mode 100644 index 3aa25e2f4..000000000 --- a/linux_artnet_responder/lib/artnetdisplay.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file artnetdisplay.cpp - * - */ -/* Copyright (C) 2022 by Arjan van Vught mailto:info@orangepi-dmx.nl - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "lightset.h" -#include "artnet.h" - -#include "debug.h" - -namespace artnet { -void display_shortname(__attribute__((unused)) const char *pShortName) { - DEBUG_ENTRY - DEBUG_EXIT -} - -void display_longname(__attribute__((unused)) const char *pLongName) { - DEBUG_ENTRY - DEBUG_EXIT -} - -void display_universe_switch(__attribute__((unused)) uint32_t nPortIndex, __attribute__((unused)) uint8_t nAddress) { - DEBUG_ENTRY - DEBUG_EXIT -} - -void display_net_switch(__attribute__((unused)) uint8_t nAddress) { - DEBUG_ENTRY - DEBUG_EXIT -} - -void display_subnet_switch(__attribute__((unused)) uint8_t nAddress) { - DEBUG_ENTRY - DEBUG_EXIT -} - -void display_merge_mode(__attribute__((unused)) uint32_t nPortIndex, __attribute__((unused)) lightset::MergeMode mergeMode) { - DEBUG_ENTRY - DEBUG_EXIT -} - -void display_port_protocol(__attribute__((unused)) uint32_t nPortIndex, __attribute__((unused)) artnet::PortProtocol tPortProtocol) { - DEBUG_ENTRY - DEBUG_EXIT -} - -void display_rdm_enabled(__attribute__((unused)) uint32_t nPortIndex, __attribute__((unused)) bool isEnabled) { - DEBUG_ENTRY - DEBUG_EXIT -} - -void display_failsafe(__attribute__((unused)) uint8_t nFailsafe) { - DEBUG_ENTRY - DEBUG_EXIT -} -} // namespace artnet diff --git a/linux_artnet_responder/lib/rdmsoftwareversion.cpp b/linux_artnet_responder/lib/rdmsoftwareversion.cpp deleted file mode 100644 index 6a690e798..000000000 --- a/linux_artnet_responder/lib/rdmsoftwareversion.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file rdmsoftwareversion.cpp - * - */ -/* Copyright (C) 2020 by Arjan van Vught mailto:info@orangepi-dmx.nl - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "rdmsoftwareversion.h" - -#include "software_version.h" -#include "sofware_version_id.h" - -const char *RDMSoftwareVersion::GetVersion() { - return SOFTWARE_VERSION; -} - -uint32_t RDMSoftwareVersion::GetVersionLength() { - return sizeof(SOFTWARE_VERSION) / sizeof(SOFTWARE_VERSION[0]) - 1; -} - -uint32_t RDMSoftwareVersion::GetVersionId() { - return DEVICE_SOFTWARE_VERSION_ID; -} diff --git a/linux_artnet_responder/linux_artnet b/linux_artnet_responder/linux_artnet deleted file mode 100755 index b20667f19..000000000 Binary files a/linux_artnet_responder/linux_artnet and /dev/null differ diff --git a/linux_artnet_responder/run.sh b/linux_artnet_responder/run.sh deleted file mode 100755 index f66b64465..000000000 --- a/linux_artnet_responder/run.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -rm -rf ../lib-artnet/build_linux/ -rm -rf ../lib-artnet/lib_linux/ - -#rm -rf ../lib-dmxmonitor/build_linux/ -#rm -rf ../lib-dmxmonitor/lib_linux/ - -rm -rf build_linux - -make -retVal=$? -if [ $retVal -ne 0 ]; then - echo "Error" - exit $retVal -fi - -sudo valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes -v ./linux_artnet_responder eno1 diff --git a/linux_artnet_responder/src/main.cpp b/linux_artnet_responder/src/main.cpp deleted file mode 100644 index 22e442968..000000000 --- a/linux_artnet_responder/src/main.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/** - * @file main.cpp - * - */ -/* Copyright (C) 2022 by Arjan van Vught mailto:info@orangepi-dmx.nl - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include -#include - -#include "hardware.h" -#include "network.h" -#include "ledblink.h" - -#include "display.h" - -#include "mdns.h" -#include "mdnsservices.h" - -#include "httpd/httpd.h" - -#include "artnet4node.h" -#include "artnetparams.h" -#include "storeartnet.h" -#include "artnetmsgconst.h" -#include "artnetrdmresponder.h" - -#include "rdmdeviceresponder.h" -#include "rdmpersonality.h" -#include "rdmdeviceparams.h" - -#include "dmxmonitor.h" -#include "dmxmonitorparams.h" - -#include "rdmdeviceparams.h" -//#include "rdmnetdevice.h" -//#include "rdmnetconst.h" -//#include "rdmpersonality.h" -//#include "rdm_e120.h" -//#include "factorydefaults.h" - -#include "configstore.h" - -#include "remoteconfig.h" -#include "remoteconfigparams.h" - -#include "storemonitor.h" -#include "storenetwork.h" -#include "storerdmdevice.h" -#include "storerdmsensors.h" -#include "storerdmsubdevices.h" -#include "storeremoteconfig.h" - -#include "firmwareversion.h" -#include "software_version.h" - -using namespace artnet; - -static constexpr uint32_t portIndexOffset = 0; - -int main(int argc, char **argv) { - Hardware hw; - Network nw; - LedBlink lb; - Display display; - FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__); - - if (argc < 2) { - printf("Usage: %s ip_address|interface_name\n", argv[0]); - return -1; - } - - hw.Print(); - fw.Print(); - - ConfigStore configStore; - - StoreNetwork storeNetwork; - - if (nw.Init(argv[1]) < 0) { - fprintf(stderr, "Not able to start the network\n"); - return -1; - } - - nw.Print(); - - StoreArtNet storeArtNet(portIndexOffset); - ArtNetParams artnetParams(&storeArtNet); - - ArtNet4Node node; - - if (artnetParams.Load()) { - artnetParams.Dump(); - artnetParams.Set(portIndexOffset); - } - - printf("Art-Net %d Node - Real-time DMX Monitor / RDM Responder {1 Universe}\n", node.GetVersion()); - - StoreMonitor storeMonitor; - DMXMonitorParams monitorParams(&storeMonitor); - - DMXMonitor monitor; - monitor.SetDmxMonitorStore(&storeMonitor); - - if (monitorParams.Load()) { - monitorParams.Dump(); - monitorParams.Set(&monitor); - } - - node.SetOutput(&monitor); - node.SetArtNetStore(&storeArtNet); - - RDMPersonality *pRDMPersonalities[1] = { new RDMPersonality("Real-time DMX Monitor", &monitor)}; - ArtNetRdmResponder RdmResponder(pRDMPersonalities, 1); - - node.SetRdmUID(RdmResponder.GetUID()); - RdmResponder.Init(); - - StoreRDMDevice storeRDMDevice; - RDMDeviceParams rdmDeviceParams(&storeRDMDevice); - - RdmResponder.SetRDMDeviceStore(&storeRDMDevice); - - if (rdmDeviceParams.Load()) { - rdmDeviceParams.Dump(); - rdmDeviceParams.Set(&RdmResponder); - } - - bool isSet; - node.SetUniverseSwitch(0, lightset::PortDir::OUTPUT, artnetParams.GetUniverse(0, isSet)); - - node.SetRmd(0, true); - - RdmResponder.Full(0); - - node.SetRdmHandler(&RdmResponder, true); - - RdmResponder.Print(); - - const auto nActivePorts = node.GetActiveOutputPorts(); - - char aDescription[rdm::personality::DESCRIPTION_MAX_LENGTH + 1]; - snprintf(aDescription, sizeof(aDescription) - 1, "Art-Net 4 %dx", nActivePorts); - -#if 0 - uint8_t nLength; - const auto *aLabel = hw.GetBoardName(nLength); - - RDMPersonality *pPersonalities[1] = { new RDMPersonality(aDescription, nullptr) }; - RDMNetDevice llrpOnlyDevice(pPersonalities, 1); - - llrpOnlyDevice.SetLabel(RDM_ROOT_DEVICE, aLabel, nLength); - llrpOnlyDevice.SetProductCategory(E120_PRODUCT_CATEGORY_DATA_DISTRIBUTION); - llrpOnlyDevice.SetProductDetail(E120_PRODUCT_DETAIL_ETHERNET_NODE); - llrpOnlyDevice.Init(); - - StoreRDMDevice storeRdmDevice; - RDMDeviceParams rdmDeviceParams(&storeRdmDevice); - - if (rdmDeviceParams.Load()) { - rdmDeviceParams.Set(&llrpOnlyDevice); - rdmDeviceParams.Dump(); - } - - llrpOnlyDevice.SetRDMDeviceStore(&storeRdmDevice); - llrpOnlyDevice.Print(); -#endif - - MDNS mDns; - mDns.Start(); - mDns.AddServiceRecord(nullptr, MDNS_SERVICE_CONFIG, 0x2905); -// mDns.AddServiceRecord(nullptr, MDNS_SERVICE_RDMNET_LLRP, LLRP_PORT, mdns::Protocol::UDP, "node=RDMNet LLRP Only"); - mDns.AddServiceRecord(nullptr, MDNS_SERVICE_HTTP, 80, mdns::Protocol::TCP, "node=Art-Net 4"); - mDns.Print(); - - node.Print(); - - HttpDaemon httpDaemon; - httpDaemon.Start(); - - RemoteConfig remoteConfig(remoteconfig::Node::ARTNET, remoteconfig::Output::MONITOR, nActivePorts); - - StoreRemoteConfig storeRemoteConfig; - RemoteConfigParams remoteConfigParams(&storeRemoteConfig); - - if(remoteConfigParams.Load()) { - remoteConfigParams.Dump(); - remoteConfigParams.Set(&remoteConfig); - } - - while (configStore.Flash()) - ; - -// llrpOnlyDevice.Start(); - node.Start(); - - for (;;) { - node.Run(); - mDns.Run(); - httpDaemon.Run(); - remoteConfig.Run(); -// llrpOnlyDevice.Run(); - configStore.Flash(); - } - - return 0; -}