Skip to content

Artnet / DMX / RGB pixel controller on d1 Mini NodeMCU 4Mb

Notifications You must be signed in to change notification settings

buttonsbond/atp-artnet-esp8266

Repository files navigation

atp-artnet-esp8266

All Tech Plus - Artnet NodeMCU Controller

Please note you may have to hard code your ssid and pw for your WiFi for the time being. Though if the ESP8266 hasn't been connected before you should get WiFi manager the first time. I'll have this fixed soon - or rather programmed!

Description

A sketch to allow a node MCU 4M with 1M SPIFFS to process Artnet/DMX packets from xLights Scheduler plus a few bonuses

Last year (2018) after following a few of Dr ZZZs YouTube videos I decided that I wanted to tinker with RGB Pixels. So I bought my first set of pixels which just happened to be WS2801 - the kind that also needed to use a data pin as well as a clock pin. I had all sorts of issues getting it to work, most likely because my knowledge of writing sketches was not that great (still not that great by the way!), in the end I found a version of McLighting that worked and so made do with that for Christmas of that year.

This year, well, I wanted to get some more pixels (bought one more set of WS2801 to make up 100 string, and 2 sets of WS2811 another 100 string) and use xLights to control them. I found a library which is included in this project (all sources at foot of this read me) which could listen for Artnet/DMX packets, basically the R,G and B values for each node, and managed to cobble something together which, well, worked. I wasn't happy enough with that though, as I won't be running an xLight show all the time, I'd like to be able to select inbuilt effects just like I did with McLighting - so I've lifted a few effects from different sources to use as built in effects.

User interfaces

It has a web interface!

Just got to the IP address shown in either the serial console, or http://nodename.local if your machine is running Bonjour. The interface itself isn't terribly refined at the moment - it needs finishing and improving.

MQTT

More or less working MQTT, the topics are hostname/effect, hostname/startup, hostname/cycle and hostname/off.
  • hostname/effect pass a number as payload corresponding to the effect number.
  • hostname/startup pass either 1 to set on, or 0 to set off.
  • hostname/cycle pass either 1 or 0.
  • hostname/off pass anything you like will turn off startup, and turn the lights off [not currently working]

Wemo

You can now control with your Amazon Alexa. The device is known by its hostname. Commands are:
  • Alexa, turn on hostname
  • Alexa, turn off hostname
  • Alexa, set hostname to X percent
  • Alexa, set hostname to 81 percent
  • Alexa, set hostname to 80 percent
Note that percentage values 1 to 15 are converted to the effect number. 81 percent will turn on the setting for cycling the built in effects, whilst 80 percent will set that to off. [not working]

Now, this may not be coded super effeciently, I may have been wasteful with variable storage, there will always be a better way of doing things, so that's where you come in - feel free to contribute additions and improvements.

Installation Instructions

Take a copy of the ZIP file from this github and extract it into your Arduino sketch folder. You'll have the folder with the various .ino files in it as well as a data folder.

You may optionally need to install the tool for uploading Sketch data - find instructions here: https://github.com/esp8266/arduino-esp8266fs-plugin

Open the main sketch (currently called xmas-artnet-ws2811.ino). If you've installed the above tool ok, from the tools menu you'll have the option to upload the sketch data - this is the web interface and config file.

You may need to make a few changes in the settings.h file, there are comments in there to help you. Most likely you will only need to change DATA_PIN and/or CLOCK_PIN - I couldn't find a way of changing these on the fly - maybe someone else will know how?

Compile and upload your sketch in the usual way.

data folder

The data folder contains the html, css and js files which make up the web interface. You will also find there a config file in json format. It is not necessary to edit for your own needs but you can if you wish - the web interface will update the config when you make changes in any event.

You will need to initially upload the sketch data folder with the Sketch Data Upload tool - don't forget to allocate some SPIFF storage on your ESP8266.

Sources

Built in effects

Works on...

  • Node MCU d1 Mini 4Mb (ESP8266 MOD) - that's what I've got. I'll add more if people tell me!

Current Issues

Sometimes when settings are changed - the ESP8266 dumps its stack - not sure exactly why. I thought it was to do with incomplete web requests so I added in a few delays before restarting the sketch after a save. If anyone has a fix?

To be done - in no particular order

  • Add MQTT support so can be used with Home Assistant and Node Red [PARTIALLY WORKING]
  • Ability to change wifi [TO BE COMPLETED]
  • Fix bugs
  • Tidy up code a bit
  • Maybe add some more comments
  • More built in effects
  • Add ability to save a Artnet/DMX sequence and load to play - not sure if this will be feasible depending on what I can get the file size down to
  • Finish the web interface - a few rough edges still!

About

Artnet / DMX / RGB pixel controller on d1 Mini NodeMCU 4Mb

Resources

Stars

Watchers

Forks

Packages

No packages published