Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: 2.1
parameters:
pixel-driver-version:
type: string
default: "0.0.1"
orbs:
docker: circleci/docker@1.7.0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure we are using this orb here?

executors:
docker-publisher:
docker:
- image: circleci/buildpack-deps:latest-alpine
commands:
move-src:
steps:
- run:
name: move src into project folder
command: |
mkdir esp_pixel_driver
cp *.* esp_pixel_driver/
cd esp_pixel_driver
deps-arduino:
steps:
- run:
name: install arduino deps
command: |
arduino-cli lib install "ArtnetWifi"
arduino-cli lib install "FastLED"
arduino-cli lib install "WiFiManager"
arduino-cli lib install "ArduinoJson"

jobs:
build:
docker:
- image: rnavt/esp32builder:1ff8208
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this docker image is defined multiple times. to reduce duplicate hard coding itd be good to put the image into the executors list at the top

steps:
- checkout
- move-src
- deps-arduino
- run:
name: build arduino binary
command: |
cd esp_pixel_driver
arduino-cli compile --fqbn esp32:esp32:esp32 --clean
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we storin these bad larrys anywhere after compiling?


lint:
docker:
- image: rnavt/esp32builder:1ff8208
steps:
- checkout
- move-src
- run:
command: |
cd esp_pixel_driver
arduino-lint
workflows:
version: 2
pixel-driver-build:
jobs:
- lint
- build
Empty file modified .gitignore
100644 → 100755
Empty file.
12 changes: 12 additions & 0 deletions DmxParameters.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "DmxParameters.h"

DmxParameters::DmxParameters() {}

DmxParameters::DmxParameters(uint16_t universe, uint16_t length,
uint8_t sequence, uint8_t *data, CRGB *leds) {
this->universe = universe;
this->length = length;
this->sequence = sequence;
this->data = data;
this->leds = leds;
}
20 changes: 20 additions & 0 deletions DmxParameters.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef DMX_PARAMETERS_H
#define DMX_PARAMETERS_H

#include <Arduino.h>
#include "config.h"
#include <FastLED.h>

class DmxParameters {
public:
uint16_t universe;
uint16_t length;
uint8_t sequence;
uint8_t *data;
CRGB *leds;
DmxParameters(uint16_t universe, uint16_t length, uint8_t sequence,
uint8_t *data, CRGB *leds);
DmxParameters();
};

#endif
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif
#endif

48 changes: 30 additions & 18 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,42 @@ The pixel mapped artnet subscriber expects 3 channels of color data per pixel to
| <-- Pixel Start Channel \
| `Red` | `Green` | `Blue` |

### Strip Length & DMX Universes

In order to prevent phasing between pixels in different universes, the driver will not update the strand until _all_ expected universes are received. The number of expected universes maybe calculated with the following formula:

``` cpp
expectedUniverses = pixels / 170 + ((pixels % 170) ? 1 : 0);
```

## Configuration

Set the following values in `config.h` before uploading to your microcontroller.
This pixel driver allows for configuration via webform & via macros in `config.h`

### Output Pin

| Parameter | Variable | Default | Options |
| ---------------- | -------------- | ------------------ | ----------------------------------- |
| Output Mode | OUTPUT_MODE | OUTPUT_MODE_LED | OUTPUT_MODE_LED, OUTPUT_MODE_MOCK |
| Output Pin | OUTPUT_PIN | 17 | ESP GPIO Number |
| LED Strip Length | STRIP_LENGTH | 250 | |
| Start Universe | START_UNIVERSE | 1 | |
| Start Channel | CHANNEL_OFFSET | 0 | |
| Serial Log Level | LOG_LEVEL | LOG_LEVEL_STANDARD | LOG_LEVEL_STANDARD, LOG_LEVEL_DEBUG |
Output pins for FastLED must be constant at compile time. `#define` the following in `config.h`:

* Setting LOG_LEVEL to LOG_LEVEL_DEBUG may impact performance
| Parameter | Variable | Type | Notes |
| ---------- | ---------- | ---- | --------------- |
| Output Pin | OUTPUT_PIN | int | ESP GPIO Number |

---
### Startup Form

### Secret Config
This pixel driver uses an ESP32 compatible branch of [WiFi Manager](https://github.com/tzapu/WiFiManager/tree/development). On device start, the ESP will broadcast a wifi network & serve a webpage at `192.168.4.1`. Network details and configuration for the pixel driver may be entered in that form.

Create `secret.h` at the root of the repo. `#define` the following values:
### Static

| Parameter | Variable |
| ----------------- | --------- |
| Wifi Network SSID | WIFI_SSID |
| Wifi Password | PASSWORD |
Configuration values may be preconfigured by setting any of the following values in `config.h` before uploading to your microcontroller.

---
| Parameter | Variable | Type | Notes |
| ------------------------- | ------------------------- | ------ | --------------------------------- |
| Disable WifiManager Setup | DISABLE_WIFIMANAGER_SETUP | -- | `#define` to activate |
| Enable Demo Animations | ENABLE_DEMO_ANIMATIONS | -- | `#define` to activate |
| Serial Log Level | DEBUG_LOGS | bool | Activating may impact performance |
| Enable LED Output | OUTPUT_LEDS | bool | |
| LED Strip Length | STRIP_LENGTH | int | |
| Start Universe | START_UNIVERSE | int | |
| Start Channel | CHANNEL_OFFSET | int | |
| Wifi Network SSID | WIFI_SSID | char[] | |
| Wifi Password | PASSWORD | char[] | |
20 changes: 20 additions & 0 deletions config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "config.h"

void Configuration::applyOverrides()
{
#ifdef DEBUG_LOGS
this->debug_logs = DEBUG_LOGS;
#endif
#ifdef START_UNIVERSE
this->start_universe = START_UNIVERSE;
#endif
#ifdef OUTPUT_LEDS
this->output_leds = OUTPUT_LEDS;
#endif
#ifdef STRIP_LENGTH
this->strip_length = STRIP_LENGTH;
#endif
#ifdef CHANNEL_OFFSET
this->channel_offset = CHANNEL_OFFSET;
#endif
}
42 changes: 32 additions & 10 deletions config.h
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
#ifndef CONFIG_H
#define CONFIG_H

// TODO: replace with Wifi manger form config

#include "enums.h"
#include <Arduino.h>

#define OUTPUT_MODE OUTPUT_MODE_LED
#define ENABLE_DEMO_ANIMATIONS
#define OUTPUT_PIN 17
//TODO: Determine true max strip length for 8266 and 32
#define MAX_STRIP_LENGTH 500

class Configuration
{
public:
uint32_t ip;
uint32_t gateway;
uint32_t subnet;
int strip_length;
int start_universe;
int channel_offset;
bool debug_logs;
bool output_leds;
void applyOverrides();
};

/*

//override with static values
#define DISABLE_WIFIMANAGER_SETUP

#define DEBUG_LOGS false
#define OUTPUT_LEDS true

#define NAME "Pixel Driver Deluxe"
#define DESCRIPTION "ESP Pixel Driver"
#define STRIP_LENGTH 250

// Pixel Mapped Output Configuration
#define START_UNIVERSE 1 //DMX Universe to listen in
#define CHANNEL_OFFSET 0 //DMX Start Channel

#define LOG_LEVEL LOG_LEVEL_STANDARD // 0: normal, 1: debug

//Must define:
/*
#define WIFI_SSID "hfsjdkf"
#define PASSWORD "sdjfhdskjfn"
//#define WIFI_SSID "hfsjdkf"
//#define PASSWORD "sdjfhdskjfn"

*/
#include "secret.h"

#endif

Empty file modified enums.h
100644 → 100755
Empty file.
Loading