From b819ea56ef6f23b440c6d027abee6e51248cb632 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sun, 20 Feb 2022 22:23:58 +0000 Subject: [PATCH 1/9] Add example sender --- ESPAsyncE131.cpp | 159 ++++++++++++++++++ ESPAsyncE131.h | 73 ++++++++ .../E131_Test-Sender/E131_Test-Sender.ino | 82 +++++++++ 3 files changed, 314 insertions(+) create mode 100644 examples/E131_Test-Sender/E131_Test-Sender.ino diff --git a/ESPAsyncE131.cpp b/ESPAsyncE131.cpp index d5655f8..faf3211 100644 --- a/ESPAsyncE131.cpp +++ b/ESPAsyncE131.cpp @@ -34,8 +34,27 @@ ESPAsyncE131::ESPAsyncE131(uint8_t buffers) { stats.num_packets = 0; stats.packet_errors = 0; + + memset(pbuff3.raw, 0, sizeof(pbuff3.raw)); + memset(pbuff4.raw, 0, sizeof(pbuff4.raw)); + packetTX = &pbuff3; + pwbuffTX = &pbuff4; +} + +uint16_t ESPAsyncE131::swapf_uint16(uint16_t x) { + // return ( ( (x) <<8) | (( (x) >>8)&0xFF ) ); + return ( htons(x) ); } +uint32_t ESPAsyncE131::swapf_uint32(uint32_t x) { + return ( htonl(x) ); +} + +#define swap_uint16(x) ( ( (x) <<8) | (( (x) >>8)&0xFF ) ) // surprisingly this does not work with printf +// ( ( 0x89<<8) | (( 0x1289 >>8)&0xFF ) ) + + + ///////////////////////////////////////////////////////// // // Public begin() members @@ -61,6 +80,146 @@ bool ESPAsyncE131::begin (e131_listen_t type, ESPAsyncE131PortId UdpPortId, uint return success; } +///////////////////////////////////////////////////////// +// +// Public send related members +// +///////////////////////////////////////////////////////// + +void ESPAsyncE131::sendPacket(uint16_t universe) { + IPAddress ipMultiE131 = IPAddress(239, 255, ((universe >> 8) & 0xff), ((universe >> 0) & 0xff)); + setPacketHeader(universe,512); + // ipMultiE131, + udp.broadcastTo(pwbuffTX->raw, sizeof(pwbuffTX->raw), E131_DEFAULT_PORT); // , WiFi.localIP()); + // udp.broadcastTo(pwbuffTX->raw, sizeof(pwbuffTX->raw), E131_DEFAULT_PORT); + // udp.write(pwbuffTX->raw, sizeof(pwbuffTX->raw)); +} + + +void ESPAsyncE131::setRGB(const uint8_t channel,const uint8_t dRed,const uint8_t dGreen,const uint8_t dBlue) { + // first channel on [1]; [0] has to be 0 + pwbuffTX->dmp.prop_val[channel+1] = dRed; + pwbuffTX->dmp.prop_val[channel+2] = dGreen; + pwbuffTX->dmp.prop_val[channel+3] = dBlue; +} + +void ESPAsyncE131::clearSendBuffer() { + memset(&pwbuffTX->dmp.prop_val[0], 0, sizeof(pwbuffTX->dmp.prop_val)); +} + +void ESPAsyncE131::fillSendBuffer(const uint8_t fillData) { + memset(&pwbuffTX->dmp.prop_val[1],fillData,sizeof(pwbuffTX->dmp.prop_val)-1); +} + +void ESPAsyncE131::setSourceName(const char *source_name) { + memcpy(pwbuffTX->frame.source_name, source_name, strlen(source_name) ); +} + +void ESPAsyncE131::setSequenceNumber(const int seq_number) { + pwbuffTX->frame.seq_number = seq_number; +} + +void ESPAsyncE131::setData(const int channel, const int dmxVal ) { + pwbuffTX->dmp.prop_val[channel] = dmxVal; +} + +/* Initialize an E1.31 packet using a universe and a number of slots */ +int ESPAsyncE131::setPacketHeader(const uint16_t universe, const uint16_t num_channels) { + if (pwbuffTX == NULL || universe < 1 || universe > 63999 || num_channels < 1 || num_channels > 512) { + // errno = EINVAL; + return -1; + } + + // compute packet layer lengths + uint16_t prop_val_cnt = num_channels + 1; + uint16_t dmp_length = prop_val_cnt + + sizeof pwbuffTX->dmp - sizeof pwbuffTX->dmp.prop_val; + uint16_t frame_length = sizeof pwbuffTX->frame + dmp_length; + uint16_t root_length = sizeof pwbuffTX->root.flength + + sizeof pwbuffTX->root.vector + sizeof pwbuffTX->root.cid + frame_length; + + // clear packet + // TODO: memset(packet, 0, sizeof *packet); + + // set Root Layer values + pwbuffTX->root.preamble_size = swapf_uint16(_E131_PREAMBLE_SIZE); + pwbuffTX->root.postamble_size = swapf_uint16(_E131_POSTAMBLE_SIZE); + memcpy(pwbuffTX->root.acn_pid, _E131_ACN_PID, sizeof pwbuffTX->root.acn_pid); + pwbuffTX->root.flength = swapf_uint16(0x7000 | root_length); + pwbuffTX->root.vector = swapf_uint32(_E131_ROOT_VECTOR); + + // set Framing Layer values + pwbuffTX->frame.flength = swapf_uint16(0x7000 | frame_length); + pwbuffTX->frame.vector = swapf_uint32(_E131_FRAME_VECTOR); + pwbuffTX->frame.priority = E131_DEFAULT_PRIORITY; + pwbuffTX->frame.options = _E131_FRAME_OPTIONS; + pwbuffTX->frame.universe = swapf_uint16(universe); + + // set Device Management Protocol (DMP) Layer values + pwbuffTX->dmp.flength = swapf_uint16(0x7000 | dmp_length); + pwbuffTX->dmp.vector = _E131_DMP_VECTOR; + pwbuffTX->dmp.type = _E131_DMP_TYPE; + pwbuffTX->dmp.first_addr = swapf_uint16(_E131_DMP_FIRST_ADDR); + pwbuffTX->dmp.addr_inc = swapf_uint16(_E131_DMP_ADDR_INC); + pwbuffTX->dmp.prop_val_cnt = swapf_uint16(prop_val_cnt); + + return 0; +} + + +// void ESPAsyncE131::dumpPacket(int packetNo) { + +// e131_packet_t *dmpbuff; + +// if (packetNo==0) { +// dmpbuff = packet; +// Serial.print("\n --------------------------------- packet \n"); +// } +// else { +// dmpbuff = pwbuff; +// Serial.print("\n --------------------------------- pwbuff \n"); +// } + + +// Serial.print("E1.31 Root Layer\n"); +// printf(" Preamble Size .......... %04x\n" , swapf_uint16(dmpbuff->preamble_size) ); // SWAP // uint16_t = 2 bytes = [0-65535] or [0x0000-0xFFFF] = unsigned int +// printf(" Post-amble Size ........ %04x\n" , swapf_uint16(dmpbuff->postamble_size) ); // uint16_t = 2 bytes = [0-65535] or [0x0000-0xFFFF] = unsigned int +// printf(" ACN Packet Identifier .. %s\n" , dmpbuff->acn_id); // uint8_t = 1 bytes = [0-255] or [0x00-0xFF] = unsigned char +// printf(" Flags & Length ......... %04x\n" , swapf_uint16(dmpbuff->root_flength) ); // uint16_t = 2 bytes = [0-65535] or [0x0000-0xFFFF] = unsigned int +// printf(" Layer Vector ........... %08x\n" , swapf_uint32(dmpbuff->root_vector) ); // uint32_t = 4 bytes = unsigned long +// printf(" Component Identifier ... "); +// for (size_t pos=0, total=sizeof dmpbuff->cid; poscid[pos]); +// printf("\n"); + +// Serial.print("E1.31 Framing Layer\n"); +// printf(" Flags & Length ......... %04x\n" , swapf_uint16(dmpbuff->frame_flength)); // uint16_t +// printf(" Layer Vector ........... %08x\n" , swapf_uint32(dmpbuff->frame_vector)); // uint32_t +// printf(" Source Name ............ %s\n" , dmpbuff->source_name); // uint8_t +// printf(" Packet Priority ........ %02x = %u\n" , dmpbuff->priority,dmpbuff->priority); // ok // uint8_t +// printf(" Reserved ............... %04x\n" , swapf_uint16(dmpbuff->reserved)); // uint16_t +// printf(" Sequence Number ........ %02x\n" , dmpbuff->sequence_number); // ok // uint8_t +// printf(" Options Flags .......... %02x\n" , dmpbuff->options); // uint8_t +// printf(" DMX Universe Number .... %04x = %u\n" , swapf_uint16(dmpbuff->universe),swapf_uint16(dmpbuff->universe));// SWAP // uint16_t + +// Serial.print("E1.31 Device Management Protocol (DMP) Layer\n"); +// printf(" Flags & Length ......... %04x\n" , swapf_uint16(dmpbuff->dmp_flength)); // uint16_t = 2 bytes = [0-65535] or [0x0000-0xFFFF] = unsigned int +// printf(" Layer Vector ........... %02x\n" , dmpbuff->dmp_vector); // uint8_t = 1 bytes = [0-255] or [0x00-0xFF] = unsigned char +// printf(" Address & Data Type .... %02x\n" , dmpbuff->type); // uint8_t = 1 bytes = [0-255] or [0x00-0xFF] = unsigned char +// printf(" First Address .......... %04x\n" , swapf_uint16(dmpbuff->first_address)); // uint16_t = 2 bytes = [0-65535] or [0x0000-0xFFFF] = unsigned int +// printf(" Address Increment ...... %04x\n" , swapf_uint16(dmpbuff->address_increment)); // uint16_t = 2 bytes = [0-65535] or [0x0000-0xFFFF] = unsigned int +// printf(" Property Value Count ... %04x\n" , swapf_uint16(dmpbuff->property_value_count)); // uint16_t = 2 bytes = [0-65535] or [0x0000-0xFFFF] = unsigned int + +// Serial.print("E1.31 DMP Property Values\n "); +// for (size_t pos=0, total=(dmpbuff->property_value_count); posproperty_values[pos]); + +// Serial.print("\n"); + +// } + + + ///////////////////////////////////////////////////////// // // Private init() members diff --git a/ESPAsyncE131.h b/ESPAsyncE131.h index 8353a63..8e42b19 100644 --- a/ESPAsyncE131.h +++ b/ESPAsyncE131.h @@ -68,6 +68,22 @@ typedef struct ip_addr ip4_addr_t; #define E131_DMP_COUNT 123 #define E131_DMP_DATA 125 +/* E1.31 Private Constants */ +const uint16_t _E131_PREAMBLE_SIZE = 0x0010; +const uint16_t _E131_POSTAMBLE_SIZE = 0x0000; +const uint8_t _E131_ACN_PID[] = {0x41, 0x53, 0x43, 0x2d, 0x45, 0x31, 0x2e, 0x31, 0x37, 0x00, 0x00, 0x00}; +const uint32_t _E131_ROOT_VECTOR = 0x00000004; +const uint32_t _E131_FRAME_VECTOR = 0x00000002; +const uint8_t _E131_FRAME_OPTIONS = 0x40; +const uint8_t _E131_DMP_VECTOR = 0x02; +const uint8_t _E131_DMP_TYPE = 0xa1; +const uint16_t _E131_DMP_FIRST_ADDR = 0x0000; +const uint16_t _E131_DMP_ADDR_INC = 0x0001; + +/* E1.31 Public Constants */ +const uint16_t E131_DEFAULT_PORT_srv = 5568; +const uint8_t E131_DEFAULT_PRIORITY = 0x64; + // E1.31 Packet Structure typedef union { struct { @@ -102,6 +118,44 @@ typedef union { uint8_t raw[638]; } e131_packet_t; +/* E1.31 Packet Type */ +/* All packet contents shall be transmitted in network byte order (big endian) */ +typedef union { + struct { + struct { /* ACN Root Layer: 38 bytes */ + uint16_t preamble_size; /* Preamble Size */ + uint16_t postamble_size; /* Post-amble Size */ + uint8_t acn_pid[12]; /* ACN Packet Identifier */ + uint16_t flength; /* Flags (high 4 bits) & Length (low 12 bits) */ + uint32_t vector; /* Layer Vector */ + uint8_t cid[16]; /* Component Identifier (UUID) */ + } __attribute__((packed)) root; + + struct { /* Framing Layer: 77 bytes */ + uint16_t flength; /* Flags (high 4 bits) & Length (low 12 bits) */ + uint32_t vector; /* Layer Vector */ + uint8_t source_name[64]; /* User Assigned Name of Source (UTF-8) */ + uint8_t priority; /* Packet Priority (0-200, default 100) */ + uint16_t reserved; /* Reserved (should be always 0) */ + uint8_t seq_number; /* Sequence Number (detect duplicates or out of order packets) */ + uint8_t options; /* Options Flags (bit 7: preview data, bit 6: stream terminated) */ + uint16_t universe; /* DMX Universe Number */ + } __attribute__((packed)) frame; + + struct { /* Device Management Protocol (DMP) Layer: 523 bytes */ + uint16_t flength; /* Flags (high 4 bits) / Length (low 12 bits) */ + uint8_t vector; /* Layer Vector */ + uint8_t type; /* Address Type & Data Type */ + uint16_t first_addr; /* First Property Address */ + uint16_t addr_inc; /* Address Increment */ + uint16_t prop_val_cnt; /* Property Value Count (1 + number of slots) */ + uint8_t prop_val[513]; /* Property Values (DMX start code + slots data) */ + } __attribute__((packed)) dmp; + } __attribute__((packed)); + + uint8_t raw[638]; /* raw buffer view: 638 bytes */ +} e131_packet_tx_t; + // Error Types typedef enum { ERROR_NONE, @@ -141,6 +195,9 @@ class ESPAsyncE131 { e131_packet_t *sbuff; // Pointer to scratch packet buffer AsyncUDP udp; // AsyncUDP RingBuf *pbuff; // Ring Buffer of universe packet buffers + e131_packet_tx_t pbuff3; /* Packet buffer */ + e131_packet_tx_t pbuff4; /* Double buffer */ + e131_packet_tx_t *pwbuffTX; /* Pointer to working packet TX buffer */ void * UserInfo = nullptr; // Internal Initializers @@ -153,8 +210,12 @@ class ESPAsyncE131 { void (*PacketCallback)(e131_packet_t* ReceivedData, void* UserInfo) = nullptr; ESPAsyncE131PortId E131_ListenPort = E131_DEFAULT_PORT; + uint16_t swapf_uint16(uint16_t x); + uint32_t swapf_uint32(uint32_t x); + public: e131_stats_t stats; // Statistics tracker + e131_packet_tx_t *packetTX; /* Pointer to last valid TX packet */ ESPAsyncE131(uint8_t buffers = 1); // Generic UDP listener, no physical or IP configuration @@ -170,6 +231,18 @@ class ESPAsyncE131 { // Diag functions void dumpError(e131_error_t error); + + // void stopUdp(void); + // void connectMulticast(uint16_t universe); + // void dumpPacket(int packetNo); + void setRGB(const uint8_t channel,const uint8_t dRed,const uint8_t dGreen,const uint8_t dBlue); + void setSourceName(const char *source_name); // + void setSequenceNumber(const int seq_number); + void setData(const int channel, const int dmxVal ); + int setPacketHeader(const uint16_t universe, const uint16_t num_channels); + void fillSendBuffer(uint8_t fillData); + void clearSendBuffer(void ); + void sendPacket(uint16_t universe); }; #endif // ESPASYNCE131_H_ diff --git a/examples/E131_Test-Sender/E131_Test-Sender.ino b/examples/E131_Test-Sender/E131_Test-Sender.ino new file mode 100644 index 0000000..4c1a78e --- /dev/null +++ b/examples/E131_Test-Sender/E131_Test-Sender.ino @@ -0,0 +1,82 @@ +/* +* E131_Test.ino - Simple sketch to listen for E1.31 data on an ESP32 +* and print some statistics. +* +* Project: ESPAsyncE131 - Asynchronous E.131 (sACN) library for Arduino ESP8266 and ESP32 +* Copyright (c) 2019 Shelby Merrick +* http://www.forkineye.com +* +* This program is provided free for you to use in any way that you wish, +* subject to the laws and regulations where you are using it. Due diligence +* is strongly suggested before using this code. Please give credit where due. +* +* The Author makes no warranty of any kind, express or implied, with regard +* to this program or the documentation contained in this document. The +* Author shall not be liable in any event for incidental or consequential +* damages in connection with, or arising out of, the furnishing, performance +* or use of these programs. +* +*/ + +#include + +#define UNIVERSE 1 // First DMX Universe to listen for +#define UNIVERSE_COUNT 2 // Total number of Universes to listen for, starting at UNIVERSE + +#include "wifi.h" +// Create file with the following +// ************************************************************************* +// #define SECRET_SSID ""; /* Replace with your SSID */ +// #define SECRET_PSK ""; /* Replace with your WPA2 passphrase */ +// ************************************************************************* + +const char ssid[] = SECRET_SSID; /* Replace with your SSID */ +const char passphrase[] = SECRET_PSK; /* Replace with your WPA2 passphrase */ + + +// ESPAsyncE131 instance with UNIVERSE_COUNT buffer slots +ESPAsyncE131 e131(UNIVERSE_COUNT); + +void setup() { + Serial.begin(115200); + delay(10); + + // Make sure you're in station mode + WiFi.mode(WIFI_STA); + + Serial.println(""); + Serial.print(F("Connecting to ")); + Serial.print(ssid); + + if (passphrase != NULL) + WiFi.begin(ssid, passphrase); + else + WiFi.begin(ssid); + + while (WiFi.status() != WL_CONNECTED) { + delay(500); + Serial.print("."); + } + + Serial.println(""); + Serial.print(F("Connected with IP: ")); + Serial.println(WiFi.localIP()); + + // Choose one to begin listening for E1.31 data + //if (e131.begin(E131_UNICAST)) // Listen via Unicast + if (e131.begin(E131_MULTICAST, UNIVERSE, UNIVERSE_COUNT)) // Listen via Multicast + Serial.println(F("Listening for data...")); + else + Serial.println(F("*** e131.begin failed ***")); +} + +void loop() { + delay(100); + for(int i = 0; i < 500; i=i+30) { + e131.setData((i + 0),random(0,255)); + e131.setData((i + 1),random(0,255)); + e131.setData((i + 2),random(0,255)); + } + e131.sendPacket(UNIVERSE); + +} From e9583daec7a2074ff536dc8b4bcc33f8b759c453 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 22 Feb 2022 10:41:57 +0000 Subject: [PATCH 2/9] clear packet --- ESPAsyncE131.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ESPAsyncE131.cpp b/ESPAsyncE131.cpp index faf3211..1b9c50e 100644 --- a/ESPAsyncE131.cpp +++ b/ESPAsyncE131.cpp @@ -89,10 +89,7 @@ bool ESPAsyncE131::begin (e131_listen_t type, ESPAsyncE131PortId UdpPortId, uint void ESPAsyncE131::sendPacket(uint16_t universe) { IPAddress ipMultiE131 = IPAddress(239, 255, ((universe >> 8) & 0xff), ((universe >> 0) & 0xff)); setPacketHeader(universe,512); - // ipMultiE131, udp.broadcastTo(pwbuffTX->raw, sizeof(pwbuffTX->raw), E131_DEFAULT_PORT); // , WiFi.localIP()); - // udp.broadcastTo(pwbuffTX->raw, sizeof(pwbuffTX->raw), E131_DEFAULT_PORT); - // udp.write(pwbuffTX->raw, sizeof(pwbuffTX->raw)); } @@ -139,7 +136,7 @@ int ESPAsyncE131::setPacketHeader(const uint16_t universe, const uint16_t num_ch sizeof pwbuffTX->root.vector + sizeof pwbuffTX->root.cid + frame_length; // clear packet - // TODO: memset(packet, 0, sizeof *packet); + memset(packetTX, 0, sizeof *packetTX); // set Root Layer values pwbuffTX->root.preamble_size = swapf_uint16(_E131_PREAMBLE_SIZE); From 5226433925381410eafebf9cf84f31ffb6db6bb3 Mon Sep 17 00:00:00 2001 From: netmindz Date: Wed, 23 Nov 2022 19:43:35 +0000 Subject: [PATCH 3/9] Update E131_Test-Sender.ino --- examples/E131_Test-Sender/E131_Test-Sender.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/E131_Test-Sender/E131_Test-Sender.ino b/examples/E131_Test-Sender/E131_Test-Sender.ino index 4c1a78e..15d8c36 100644 --- a/examples/E131_Test-Sender/E131_Test-Sender.ino +++ b/examples/E131_Test-Sender/E131_Test-Sender.ino @@ -3,7 +3,7 @@ * and print some statistics. * * Project: ESPAsyncE131 - Asynchronous E.131 (sACN) library for Arduino ESP8266 and ESP32 -* Copyright (c) 2019 Shelby Merrick +* Copyright (c) 2019 Shelby Merrick, send support Will Tatam * http://www.forkineye.com * * This program is provided free for you to use in any way that you wish, From 36eea0af605f8e7dabe4ad04f978f8e90f2c9ce4 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 23 Nov 2022 20:12:31 +0000 Subject: [PATCH 4/9] Add update-index --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4c24895..55c9868 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -22,6 +22,7 @@ jobs: arduino-cli config set directories.user ~/arduino - name: Install platforms run: | + arduino-cli core update-index arduino-cli core install $ESP8266_PLAT arduino-cli core install $ESP32_PLAT From 0922b02cd749737978766fe5031e29ecd6fcf4b9 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 23 Nov 2022 20:15:28 +0000 Subject: [PATCH 5/9] Add Sender test to CI --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 55c9868..0b62904 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -51,7 +51,9 @@ jobs: - name: Compile for ESP8266 run: | arduino-cli compile --fqbn $ESP8266_FQBN examples/E131_Test/E131_Test.ino + arduino-cli compile --fqbn $ESP8266_FQBN examples/E131_Test-Sender/E131_Test-Sender.ino - name: Compile for ESP32 run: | arduino-cli compile --fqbn $ESP32_FQBN examples/E131_Test/E131_Test.ino + arduino-cli compile --fqbn $ESP32_FQBN examples/E131_Test-Sender/E131_Test-Sender.ino From 9ac4f90d7c863fc731c352fa4f2c6b5c27fb70b7 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 23 Nov 2022 20:20:01 +0000 Subject: [PATCH 6/9] Add Sender test to CI - needs wifi.h --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0b62904..9a831bb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -46,6 +46,9 @@ jobs: mkdir -p ~/arduino/libraries mv alib/* ~/arduino/libraries rmdir alib + echo "#define SECRET_SSID "";" > ~/arduino/libraries/wifi.h + echo "#define SECRET_PSK "";" >> ~/arduino/libraries/wifi.h + # Build examples - name: Compile for ESP8266 From bc67993736863ec462c16218228e20e9fe47384d Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 23 Nov 2022 20:23:07 +0000 Subject: [PATCH 7/9] Add Sender test to CI - needs wifi.h --- .github/workflows/build.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9a831bb..0e9f6c1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -46,8 +46,9 @@ jobs: mkdir -p ~/arduino/libraries mv alib/* ~/arduino/libraries rmdir alib - echo "#define SECRET_SSID "";" > ~/arduino/libraries/wifi.h - echo "#define SECRET_PSK "";" >> ~/arduino/libraries/wifi.h + mkdir -p ~/arduino/libraries/wifi + echo "#define SECRET_SSID "";" > ~/arduino/libraries/wifi/wifi.h + echo "#define SECRET_PSK "";" >> ~/arduino/libraries/wifi/wifi.h # Build examples From 0c62fa91fe8a4f55cd6c57b6000d51a5a5708868 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 23 Nov 2022 20:27:58 +0000 Subject: [PATCH 8/9] Add Sender test to CI - needs wifi.h --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0e9f6c1..17c3d68 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -47,8 +47,8 @@ jobs: mv alib/* ~/arduino/libraries rmdir alib mkdir -p ~/arduino/libraries/wifi - echo "#define SECRET_SSID "";" > ~/arduino/libraries/wifi/wifi.h - echo "#define SECRET_PSK "";" >> ~/arduino/libraries/wifi/wifi.h + echo "#define SECRET_SSID \"test\";" > ~/arduino/libraries/wifi/wifi.h + echo "#define SECRET_PSK \"test\";" >> ~/arduino/libraries/wifi/wifi.h # Build examples From 410ce9345cb3d43c586704d16fa2f07a7a001f8c Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 23 Nov 2022 20:43:40 +0000 Subject: [PATCH 9/9] CI needs to actually use our code, not HEAD of repo for library --- .github/workflows/build.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 17c3d68..f56fea4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,12 +28,6 @@ jobs: # Grab all the required libraries # Checkout won't allow paths outside of our workspace, so we put them in alib and move later. - - name: Checkout ESPAsyncE131 - uses: actions/checkout@v2 - with: - repository: forkineye/ESPAsyncE131 - path: alib/ESPAsyncE131 - - name: Checkout ESPAsyncUDP uses: actions/checkout@v2 with: @@ -49,6 +43,7 @@ jobs: mkdir -p ~/arduino/libraries/wifi echo "#define SECRET_SSID \"test\";" > ~/arduino/libraries/wifi/wifi.h echo "#define SECRET_PSK \"test\";" >> ~/arduino/libraries/wifi/wifi.h + cp -rv ./ ~/arduino/libraries/ESPAsyncE131 # Build examples