Working with the ESP8266 is always a great experience, it becomes just a matter of getting the proper I/O and then in few minutes your module is running. The introduction of the ESP8266 in the supported SoC for Souliss has open the world of smart devices to the DIYers and the very competitive price of this IC will spread it into consumer products.
In the last few days we have started working with Authometion to support the new LYT8266, a variant of their RGBW LED Bulb that has an ESP8266 inside, so that you should program your sketches directly into the lamp (this is in contrast with the approach used with LYT88).
Thanks to the Arduino cores for ESP8266 you can program this bulb directly from the Arduino IDE using OTA (Over the Air) programming, running Souliss you have direct access via SoulissApp or openHAB.
A side-to-side comparison show a LYT88 bulb (on the left side) with a LYT8266 (right one), the voltage regulation is based on a switching circuit (on top right, you can see the inductor and regulator) this is due to the high current required by the ESP8266 compared to a standard microcontroller with external RF radio (as on the left side). The I/O is basically the same, with one mosfet for each channel used to sink the current from the LEDs powered at near 12 Vdc.
LOAD YOUR SKETCH OverTheAir (OTA)
Loading a new sketch has two option, using the cable or the air. The Over the Air programming is very simple and can be used right out-of-the-box if your bulb has Souliss pre-loaded.
You need the following pre-requisites to load a sketch:
- Install the Arduino IDE 1.6.5 (this is the supported release at time of writing)
- Install Python 2.7 and have it in your Windows path
- Install the ESP8266 cores for Arduino, the cores are distributed via the Arduino IDE Board Manager and needs an URL for the distribution of the code. You can check the supported core here
- As today, the URL to be used is http://arduino.esp8266.com/staging/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
- Install Souliss library on Library Manager of Arduino IDE
Once you will power your bulb, if is the first time and has never been configured before, you will see an Access Point called Souliss, just connect and point your browser to http://192.168.4.1
You get a web interface from where you can configure the WiFi and IP parameters, and select the node as Gateway or Peer. Configure one bulb as Gateway and the others as Peer, they will build automatically a Souliss network and will be available in SoulissApp. Note: if the DHCP box is ticked it will over-ride a manually entered address if present - and likewise for the Gateway address - so don’t tick those boxes if you wish to manually specify the addresses.
Your bulbs have full features, but if you want to upload a new sketch you just need to go in the Arduino IDE and set the following parameters:
- Board as Generic ESP8266 Module
- Flash Mode QIO
- Flash Frequency 40 MHz
- Upload Using OTA
- CPU Frequency 80 MHz
- Flash Size 1M (64K SPIFFS)
- Upload Speed 115200
In the Port sub-menu you will see the bulb and its OTA IP address which allows you to upload a new sketch over wifi as if it was connected via cable (assuming your Arduino IDE computer has wifi access to the ESP device of course).
It is very important that you always upload an OTA enabled sketch each time, otherwise you will not see the OTA device available in the Port sub-menu for uploading to over the air, and therefore you will need to connect and upload via the cable. Start from the e02_LYT8266_WiFi_Bulb.ino to build your own sketch.
LOAD YOUR SKETCH VIA USART CABLE
Using the cable to connect via USART can be useful if you don’t want OTA or if you have bricked your OTA sketch, also you can use the whole flash size (1 MByte) whereas on OTA you are only able to use 512 KBytes. All the previous pre-requisite applies also for this case.
PIN | Resistor | Serial Adapter |
---|---|---|
ESP03_URXD | TX | |
ESP03_UTXD | RX | |
GPIO16_RESET | RTS* | |
GPIO0 | DTR* | |
GND | GND |
The two connection with * are not mandatory, without you need to turn OFF the bulb and place GPIO0 to GND every time that you want to program it, this is similar to any other ESP8266 based device, this tutorial gives the basic to use the Arduino IDE and the ESP8266 cores.
On board of the LYT8266 the programming connector, is very small and need an adaptor supplied with the dev kit, and expose the TX, RX together with GND and GPIO0 and others. You haven’t the Vcc, so you should power the ESP8266 board connecting it to main 220 Vac (or 110 Vac), so be careful.
On the module there is an ESP-03, so on the Arduino IDE select the COM module as per your operating system and the following settings:
- Board as Generic ESP8266 Module
- Flash Mode QIO
- Flash Frequency 40 MHz
- Upload Using Serial
- CPU Frequency 80 MHz
- Flash Size 1M (64K SPIFFS)
- Upload Speed 115200
As first step, you need to load the e02_LYT8266_WiFi_Erase sketch, this will clear the FLASH sector used as EEPROM from random data and later load the e02_LYT8266_WiFi_Bulb this will start the bulb as access point with a web configuration interface restoring the factory firmware.
The LYT8266 in our hands are actually prototypes that will be unvelived at Maker Faire Rome 2015 at the Authometion booth, there will be also a workshop to have your hands on these devices. The sales will start after the faire, so a month or so before having them available on the market.
UPDATE
The LYT8266 is now on the Authometion store, have a look here is also available as pre-assembled device
Enjoy!