Above is my attempt to get the supernova code working on ESP8266. The code uploads and nothing happens. When uploaded to Teensy 3.2 the code works properly. Any ideas?
http://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
Pretty sure this is why it isn’t working but need to try changing the code, not sure yet what to do.
I want you to succeed… been wanting this for a while, but I’m way out of my depth with this code!
Im fairly certain the PROPGMEM part is the issue preventing it from working. It has to be initialized differently.
http://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html describes it. I am not sure how to modify the code though.
I was able to add a function to the web interface that would start the POV part but when I would select it, the board would stop working and had to be reset. It is getting closer though.
How does the IR interrupt work? That seems like a potential problem.
Declaring arrays as PROGMEM needs some special functions to access them, you cannot use pointers as you do I think. For example lineTable.
Paul says that on teensy PROGMEM does nothing, so your code works as-is. However on an ESP8266 it changes the way the data is allocated. https://forum.pjrc.com/threads/23526-PROGMEM-use-on-Teensy-3-0
You may try to
#define PROGMEM
in the beginning of you ino file, for example just before the #include “graphics.h” line, that will use normal memory, and might work if all your data can fit.
Looking over the IR code from PJRC, it looks like that is the part that is not completely compatible with the ESP8266. Here is what the GitHub project says:
ESP8266 is supported in a fork based on an old codebase that isn’t as recent, but it works reasonably well given that perfectly timed sub millisecond interrupts are different on that chip. See https://github.com/markszabo/IRremoteESP8266
It looks like they have added ESP32 support, though.
I don’t know if it would fit. I am putting hundreds of patterns in the graphics.h file. So using the instructions to point to the progmem it would be adding hundreds of pointers, unless maybe I can add something in setup to point to all of them?
@Sam_Guyer I haven’t tried the ir input using the current example I uploaded. I changed the ir library to the 8266ir library so it will compile. It doesn’t like the ir library that is included in the original adafruit sketch. I’m planning to maybe cut out the ir code and merge the code with the web control fastled.
I tried
#define PROGMEM
#include “graphics.h” // Graphics data is contained in this header file.
and it fits
Sketch uses 262427 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 45760 bytes (55%) of dynamic memory, leaving 36160 bytes for local variables. Maximum is 81920 bytes.
I would also add
#define memcpy_P memcpy
so that everything is in standard memory
I tried those suggestions and it didnt work. I did find a bike pov code on esp8266 that modifies the original adafruit pov code to work on esp.
Are you able to display a simple pattern on the strip connected to the ESP8266 ? With some basic FastLED code ? If tricking PROGMEM to do nothing does not work, I am afraid you will have to debug using Serial…
I am able to get lights functioning using basic fastled code. Pin definitions are correct. I did find imageinit() being in void setup was causing the board to restart repeatedly. Still trying to convert things over after reading through this. https://github.com/esp8266/Arduino/blob/master/doc/PROGMEM.rst
It turned out to be memory issues for sure. I haven’t tried working the IR code into the sketch yet, but after changing the sketch to include pgm_read_byte it works on esp8266. See my new post on my github. I am still trying to figure out how to modify the code to store patterns in flash rather than in working memory.