I just read an article on how to run arduino sketches on a ESP8266

I just read an article on how to run arduino sketches on a ESP8266 Wifi module ( http://makezine.com/2015/04/01/installing-building-arduino-sketch-5-microcontroller/ ).
I haven’t one of these and was wondering if fastled would compile also.
They say in this article ( http://makezine.com/2015/04/01/esp8266-5-microcontroller-wi-fi-now-arduino-compatible/ ) : “any third party libraries that don’t rely on low level access to the AVR should work”.
Has anyone tried ?
I usualy use a raspberry pi + arduino for web/wifi control, but this thing would lower considerably the cost for simple wifi projects.
http://makezine.com/2015/04/01/installing-building-arduino-sketch-5-microcontroller

Hmm that article is a little ambiguous.

the real story is that this project https://github.com/sandeepmistry/esp8266-Arduino
allows you to configure the new Arduino IDE to be able to build for the ESP8266, rather than use Eclipse, and use some Arduino like functions.

EDIT: i just found this snippet “Libraries that don’t rely on low-level access to AVR registers should work well.” So its a bit of a stretch to call it Arduino compatible.

agreed, it’s not like it has an arduino bootloader … but still, it seems promising, I see so many mentions of it lately in my rss feeds, the community has been waiting for low cost wifi …

FastLED does TONS of low-level access to the particular hardware’s pins; this is why it’s so fast. But it also means that we have to “port it” to each new architecture. Basically, FastLED doesn’t run “on Arduino”. FastLED runs directly on the native hardware.

The ESP8266 isn’t an AVR chip like the Arduino Uno, Leonardo, Mini, Micro, Mega, or Nano.

The ESP8266 ALSO isn’t any kind of ARM-based chip like in the Teensy, Due, DigiX, SparkCore, or RFduino. It’s not ARM-based at all.

(We already natively support all of those boards, and more.)

Instead, the ESP8266 a totally unrelated non-AVR, non-ARM chip architecture: a Tensilica Xtensa LX106 – a “post-RISC”, DSP-like processor. On the hardware level it has virtually nothing in common with ARM or AVR processors. That alone makes it a very, very big porting effort for us. (If you’re a chip geek it an assembly language hacker, check it out; it’s DSP heritage is evident and interesting.)

Anyway, this is unlike what it’s like for Arduino libraries that don’t directly access the hardware, which will port more easily-- once they have all of the Arduino APIs available, which they don’t today (eg analogWrite doesn’t work, etc).

Furthermore, the current implementation of the Arduino wifi APIs on the ESP8266 appears to rely on both interrupts and periodic service routines-- neither of which is going to mix easily with FastLED support for all the “three-wire” LED chips that depend on exact timing.

So: we’ve looked at this chip and this board and it’s definitely interesting, and the appeal is pretty obvious! But a full native port of FastLED isn’t going to happen AT LEAST until the development tool chain under the Arduino IDE matures a bit, and even then it’s going to take quite a bit of time and work.

In the meantime, if you want to use an ESP8266 as a serial-to-wifi bridge attached to an existing supported microcontroller board, that should work just fine with FastLED already today! This is definitely the road you should go down if you want to add cheap serial wifi to an LED project.

Final note: I believe that there’s already a WS2811 driver for ESP8266. If that’s all you need- then maybe that’s a better, shorter route than FastLED!

Oh and one other thing. FastLED is 100% open source! You can port it to any new architecture you like; you have access to absolutely all the same tools and source code that we do. All it takes to go from “but I have no idea where to start!” to “ok, now it works great, supports everything, here’s my code to merge” is … time, and determination, and love. Lots and lots of those things.

Anyway, if you’re reading this and you’re an expert C++ coder who’s already familiar with the internals of Tensilica Xtensa architecture and tools used on the ESP8266, as well as the protocols used by 3- wire (clockless) and 4- wire (clocked) LED chipsets, by all means, please consider helping out with a native port of FastLED to LX106.

And if you’re reading this, and you’re not (yet) an expert in all those things… well then, it’s time to start studying, isn’t it?!? :slight_smile:

But seriously: we really appreciate all the code contributions, large and small, from our community. Porting all of FastLED to an entirely new architecture is going to take a ton of work, and if you can help, we’d love it.

This is a bit advanced topic for me, but I get the big picture :stuck_out_tongue:
So, for 5$ this could replace my raspberry for simple projects, connect it to an arduino and send serial commands, to change light patterns or settings for example.
Still nice, I think I’ll get one and test it …

Exactly! That’s what it was originally sold for. The hacker community is now ALSO experimenting with running sketches ON the chip, but that’s a tall hill to climb.

On the other hand, the serial-wifi bridge should be easy!

I am a web developer, good at scripting languages like javascript, actionscript, and also other server side languages, I’m also playing with processing a bit, so this is a bit out of league for me, having three little kids I don’t have that much time to learn a complete new software paradigm … on the other side, I have seen other projects like this one that made me want to ‘contribute’ somehow : https://www.youtube.com/watch?v=gC7OEI3sOrI
I think it’s a good idea to be able to test code and led configurations ‘virtualy’.
This one is coupling fastled and processing via serial, it would be nice to have a processing only environment emulating the functionalities, no hardware required.

Thanks for all your energy and enthusiasm. I really like the work that some folks are doing on “emulators” for LED development… looks very valuable and promising!

Here is a nice FTDI to ESP8266 adapter, that also does level shifting. It’s super easy to use. https://www.tindie.com/products/FemtoCow/esp8266-ftdi-and-breadboard-adapter-with-33v-reg/

@LeRoy_Miller ​ nice find, pitty its a Atmega32U4 and not a 328

There’s also the Phaser[1] & Arachnio[2]

[1] http://www.phasor.io/

[2] https://www.kickstarter.com/projects/logos-electro/arachnio

It would be nice to save the $2-$3 and use the ESP8266 directly. But FastLED has so many advantages that it makes a lot of sense to keep the AVR and just talk to the ESP8266 over serial. Could be some exceptions, for example if you just want to use the ESP8266 to pump pixels directly from a remote computer.

@Stuart_Taylor : curious what your thinking is on 328 vs 32U4?

@Mark_Kriegsman yah, i bet that sounded odd :wink:
The ATMEGA32U4 has more features, and should be able to do anything a 328 can. Its got more IO, more ADC channels, more RAM, more timers, etc. But i’ve tinkered with the 328 (and the 168 before it) for so long, it becomes an extension to your thinking (e.g i dont have to look up pinouts - well i do, when i have to work out what the “arduino” pin out is referring wrt the physical on the hardware, i can breadboard one blind folded).

I guess what i’m saying is that i’m stuck in my ways, and the 32u4 isn’t sexy enough for me to bothered to get to know it so intimately (says the guy with hundreds of PIC mcu in his parts bins), unlike say the SAMX which has piqued my interest.

Ah! Yeah. I totally hear you on that one. Familiarity = faster from concept to delivery, and in a world of finite available time, that matters.

Personally, I find Leonardo-ish boards very easy to connect and work with. The extra 512 bytes of SRAM doesn’t hurt either.

OTOH, there are lots of great options out there; no one of them is a universal solution to all things.

we’re way OT now, but, the 4k of boot-loader on the Leonardo is irksome. 4K of space which was worth the purchase of an ICSP to avoid it.

Sorry guys, also i was really excited about arduino ide without take in accout the inner hardware differences at low level. Anyway, as pointed by scargill… what do you thing about the work done at SMING?
http://www.esp8266.com/viewtopic.php?f=6&t=2133

Just for x-ref: http://makezine.com/2015/04/03/esp8266-community-added-arduino-support-5-microcontroller/
Note the numerous references to “what doesn’t/won’t work”… some of those are the reasons why this will have to be a full-native port (someday) for FastLED.