# Serial RGB LED driver, Interplay Medium™ dendrite module (for ESP8266)

This is IM denrite module (remote wifi network device) created for [Interplay Medium™](https://interplaymedium.org) project.

![Interplay Medium RGB Serial LED Dendrite](https://repository.interplaymedium.org/Serial_RGB/IMG_2142.jpg)

## Pinouts 

For LEDs be sure to add MOSFETs and current limiting resistors appropriately. Wiring scheme will be added probably later. 

![ESP8266 Pinout](https://repository.interplaymedium.org/RGBW%20Controller/esppinout_.png)
![ESP8266 Programming](https://repository.interplaymedium.org/RGBW%20Controller/usbprogram_.png)

## Bidirectional MOSFET level shifter

To drive an addressable RGB strip along with ESP8266, you need to synchronize logical levels. 
I usually use a simple MOSFET solution for single-channel shifting, hovever for multi-channel management, I would recommend using a simple Logic Gate IC like 74HC08 or a level shifter such as TXB0104.

![Bidirectional MOSFET level shifter](https://repository.interplaymedium.org/Serial_RGB/bidirectonal-mosfet-level-shifter.png)

## Preparing the building environment

Make sure that you have the environment installed as described at

1. [makeEspArduino.mk](https://github.com/plerup/makeEspArduino.git)
2. [esp8266 Arduino SDK](https://github.com/esp8266/Arduino)

3. In the *make* script, change path for each variable approprately: 
    MAKE_FILE=....
    ESP_SDK_ROOT=....

## Change your IM AXOD microserver or AP (router) WIFI login and password

create the file 
    vim ../info

assign SSID and PASSWORD of your local IM AXOD microserver or Access Point in there

    WIFI_SSID="ssid"
    WIFI_PASS="ssid password"

You can change it later whenewer you want using HTTP interface

## Building 

initial buildong and flashing firmware at once 
 
    ./make Serial_RGB upload

after that you may just build the binary and uload it using remote HTTP interface

    ./make Serial_RGB  
    curl -F image=@Serial_RGB.bin -s im_<....>.lan/update

## Usage 


By default dendrite can be reached on "im_serial_[last 4 digits of MAC address]" doman

Change it with 

    curl "im_serial_[last 4 digits of MAC address]?rename=NEWNAME"

Turn on the color and effect 

    curl "im_serial_[last 4 digits of MAC address]?gradient=ffffffccff44&slidez=-1&delay=100"

Other options

    curl "im_serial_[last 4 digits of MAC address]/help"

## Todo 

The development of this firmware is in progress. Here is a brief list of upcoming changes: 

* features (save, reset....)
* state return in 2 variants  
    txt (default)  
    JSON  
    html UI
* add commands  
    dimm and soft state changing  
    rgbwdef -- save default values in EEPROM, which is returning on reset command  
  
* switching AP/slave, AP by defuault
    remote access setup (host name, AP/slave, SSID, passw)  
    save in EEPROM  

## License

Copyright © 2016 Dmitry Shalnov [interplaymedium.org]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this files except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.






