focalintent / FastLED-Sparkcore

SparkCore specific port of FastLED
MIT License
24 stars 34 forks source link

platforms/avr/led_sysdefs_avr.h: No such file or directory #2

Closed stevesparks closed 8 years ago

stevesparks commented 9 years ago

Veryfing code using this library in Particle Build fails with this error:

FastLED/led_sysdefs.h:19:43: fatal error: platforms/avr/led_sysdefs_avr.h: No such file or directory
 #include "platforms/avr/led_sysdefs_avr.h"
                                           ^

My code is cribbed from the "Fire2012" example.

enjrolas commented 9 years ago

I'm seeing the same error when building any of the fastLED examples for Photon. They run fine on a spark core, but I can't build anything for a photon. I forked the library and am working on a fix now -- I'll comment if I get anywhere.

stevesparks commented 9 years ago

@enjrolas I have also heard that it's a kernel thing and that the more recent versions of the develop branch in https://github.com/spark/firmware provide this functionality. I have tried running that kernel and bricked one of my Photons. :/

focalintent commented 9 years ago

FastLED doesn't fully support the photon yet, which is most likely the biggest source of issues for folks trying to build for it.

webdevbrian commented 9 years ago

Dan! Again, we meet again! Let me (and others I'm sure) know if you have a paypal donation link -- your library is a huge part of our livelihood for sure. I think I speak for others with this, and obviously myself but thank you for such the hardwork on this lib. It is HUGELY appreciated.

wmoecke commented 9 years ago

This seems to be caused by FastLED library not loading the correct header file for the Photon platform. It's somehow defaulting to AVR - I've confirmed my suspicion after doing a Google search and finding this thread. It also seems that the developers are aware of this issue for quite some time, and they've already got a hold of some photons so I am convinced it's only a matter of time until we can use FastLED on the photons.

Btw, thanks a lot to the developers for this amazing library.

focalintent commented 9 years ago

Yes - because there are so many arduino variants and because of some fallback things I have in the code if the library doesn't recognize the platform you are building for it drops back to unspecified arduino based avr.

stevesparks commented 9 years ago

In my surfing, I also encountered some discussion of a branch of the Particle firmware that claims to add the necessary features for one to compile locally. I downloaded this firmware, built it, flashed it. It was not retaining wifi credentials between power cycles.

I didn't achieve anything valuable, quite the opposite: about 20 minutes into playing with it, I accidentally touched 5V to the 3V3 pin and cooked it. :-1:

webdevbrian commented 9 years ago

Thank you Dan - for all of your hardwork!!!

Sent from my iPhone

On Jul 18, 2015, at 2:46 PM, Daniel Garcia notifications@github.com wrote:

Yes - because there are so many arduino variants and because of some fallback things I have in the code if the library doesn't recognize the platform you are building for it drops back to unspecified arduino based avr.

— Reply to this email directly or view it on GitHub.

wmoecke commented 9 years ago

@stevesparks, you've brought up an interesting subject. I've currently got 2 photons, the first one I had worked for a few days, and after flashing a series of sketches built using the particle IDE, one day it decided by itself to never forget its wifi settings (not even after a full factory reset performed several times), and flashes from the particle IDE, but you never see anything going on.

This one I had purchased from @enjrolas for his L3D cube. He sent me a replacement, which last evening after the confusing setup (never can get it to work right the first time without debugging) I got connected and had flashed it a few times with the same sketch to make sure it was working OK. But then, I powered it down for an hour or so, and when I powered it back on it had not only forgotten the wifi settings (just like yours apparently) but also the firmware I had loaded last into it.

So I might be asking a dumb question, but is there a way to flash firmware into the photon (just like you would do a bootloader flash via ICSP into the Arduino's Mega328P) - and really reset everything on the hardware, or are we stuck with the known options (cloud, USB flash)?

wmoecke commented 9 years ago

ummm, regarding my last question, it seems the option would be to put the device in DFU mode and use the CLI utilities to load the compiled binary - as it is explained in item #4 on the README.md. I was hoping to try and revive my 'dead' photon but I recall having tried to flash it with the device in dfu mode but it yielded nothing.

stevesparks commented 9 years ago

@wmoecke Great questions and I want the answers too; Let's go find an answer, but probably not in the FastLED repo. :grinning:

wmoecke commented 9 years ago

Makes perfect sense, I apologize for the off-topic. Got carried away. :-)

"Success consists of going from failure to failure without loss of enthusiasm" - Winston Churchill

2015-07-18 19:38 GMT-03:00 Steve Sparks notifications@github.com:

@wmoecke https://github.com/wmoecke Great questions and I want the answers too; Let's go find an answer, but probably not in the FastLED repo. [image: :grinning:]

— Reply to this email directly or view it on GitHub https://github.com/focalintent/FastLED-Sparkcore/issues/2#issuecomment-122602503 .

stevesparks commented 9 years ago

@wmoecke If the code commits I referenced find their way into the device firmware updater supported by https://build.particle.io/build, I would expect the stock build of FastLED to just start working and moot this issue entirely.

I suggest that @focalintent need not work on this immediately, but instead, we might wish to push for Particle to make the change.

wmoecke commented 9 years ago

But @stevesparks, how about that issue you mentioned when you flashed that fork into your photon? Wouldn't that affect all photons that try to use the library flashing code from the particle IDE?

stevesparks commented 9 years ago

The underlying truth here is that Particle shipped us Photon parts containing a given build, "Build X". Their UI offers a FastLED library for Photon development which is not compatible with Build X. I'm sure this is a mixup because I assume FastLED works fine on Core. Solution: Particle needs to fix FastLED in their UI for Photon, or strip it out.

If this involves pushing new Photon firmware that works as well as the current shipping stuff and includes those #define statements, fine with me. If it involves them hacking their copy of FastLED, pretty much also fine with me. Either way I feel like it's their bug to fix.

focalintent commented 9 years ago

No, it is my bug to fix - because every hardware platform requires extensive plowed/validation/optimization. Personally I wouldn't trust particle to port FastLED to their platform (and from a quick look at the data sheets the I/o register layout for the photon is different enough from what's used in the core that it isn't going to just be a couple of quick defines to make it work.

focalintent commented 9 years ago

To expand on my above comment, FastLED is unique amongst most arduino-style/friendly libraries in that I bypass pretty much everything in the arduino environment and talk directly to the underlying hardware at the lowest levels (sometimes in asm, even bypassing the compiler). It means that porting FastLED to new hardware often involves an evening (or few) digging through the data sheet/user manual for the cpu (and really, how many arduino users are even aware that there is dedicated documentation at such a low level).

wmoecke commented 9 years ago

Ummm, that explains the 'fast' in FastLED - It's been literally just a few days since I've been made aware of this library, and since my first glimpse at some of the high level code, been thinking, "how the hell they've managed to make the calculations so much faster on the arduino" - now there's the answer. :+1:

Coding in pure assembly language comes with a price - it's not 'adaptable' or 'portable' in any sense. Each new hardware platform will require its own version coded to cope with their idiossincrasies. I hope I spelled that word right. Too late for googling now.

focalintent commented 8 years ago

Yes, this is still an open issue, I haven’t had the time to work on the Photon port yet.

On Sep 7, 2015, at 10:32 AM, Robert Schanafelt notifications@github.com wrote:

So is this still an open issue? Will using this with a Particle Photon brick the device?

— Reply to this email directly or view it on GitHub https://github.com/focalintent/FastLED-Sparkcore/issues/2#issuecomment-138346427.

rschanafelt commented 8 years ago

@focalintent I'm hoping to get an installation up and running for Halloween using the Particle Photon / FastLED / DotStars. Is there anything I can do to help? (Unfortunately my ASM skills are way out-of-date or I'd take a crack at porting it myself.) I'm curious about when you might take this on, or how the community could help? As with all open source projects, I'm grateful for your efforts to port this, so a big thanks for your work!

focalintent commented 8 years ago

Mostly it is just a matter of getting the time to work on it - I have a full time job and a couple of contracting jobs that are taking up my time at the moment. If things go well, I can probably poke at it a bit next weekend.

prismlyuk commented 8 years ago

Got here through a search for the aforementioned error. I'd love to see a port happen at some point and i'd be happy to donate too. :)

MrRocketman commented 8 years ago

One more vote for a port! I got as far as figuring out that to detect the photon I need:

elif defined (STM32F2XX)

Then I ran into about a thousand errors because I undoubtedly have my project setup wrong. I would be happy to donate as well if it helps. I really need this library for my Halloween/Christmas lights! The NeoPixel library is nowhere near fast enough!

Thanks! James

eklex commented 8 years ago

Good news, everyone! I added the support for Photon. See my comment in the master FastLED library.

ScruffR commented 8 years ago

@focalintent: Would be nice if the corrected version could be pushed to Particle Build (Web IDE) soon.

Thanks for all your efforts :+1:

focalintent commented 8 years ago

I've pulled the pull request over to the branch - does the particle build ide not pick it up? (I really hate their dev environment sometimes).

ScruffR commented 8 years ago

Unfortunately not. You'd have to nodge up the version number in spark.json (which I think you did already anyway) and then go into Particle Build, into libraries (as you did first time putting it online) and CONTRIBUTE LIBRARY again. After validating and importing the new version you need to publish it again too.

All that to ensure that no half-baked commits or untested work-in-process versions go public.

focalintent commented 8 years ago

Heh - I haven't touched the particle build ide since putting up the initial version of the library - I'll hopefully have some time to poke at it over the thanksgiving break.

ScruffR commented 8 years ago

That would be great :+1:

blownupp commented 8 years ago

I'm sorry if I am missing something obvious here, but has this been pushed through yet? I just tried building "Fire2012.ino" on my Photon running the latest firmeware and latest FastLED and I'm getting that same AVR #include issue.

focalintent - I appreciate the work you've put into this, thank you.

Everyone else - thanks for your time!

In file included from blink.cpp:1:0:
FastLED/FastLED.h:12:2: warning: #warning FastLED version 3001000 (Not really a warning, just                 telling you here.) [-Wcpp]
 #warning FastLED version 3001000  (Not really a warning, just telling you here.)
^
In file included from FastLED/FastLED.h:34:0,
             from blink.cpp:1:
This looks like an error in FastLED library. Would you like to create an issue on GitHub to let the     author know?
CREATE ISSUE
FastLED/led_sysdefs.h:19:43: fatal error: platforms/avr/led_sysdefs_avr.h: No such file or     directory
 #include "platforms/avr/led_sysdefs_avr.h"
                                       ^

compilation terminated.
make[1]: *** [../build/target/user/platform-6blink.o] Error 1
make: *** [user] Error 2>
RickDB commented 8 years ago

Is the fixed library already in the particle build environment or do I need to manually add it via the local IDE? As the current version there is 3.1.3 but still get the same error from the op.

focalintent commented 8 years ago

I need to actually push the changes to the web based build system - which i'll do when I get back from traveling for the holidays.

RickDB commented 8 years ago

Awesome, thanks :+1:

lessavyfav commented 8 years ago

So excited for Fast LED! Thanks, refreshing the IDE like a kid at Christmas. I'm no whiz but if there is anything I can do to help please let me know.

I've not been able to get code to work using the local Particle IDE - it compiles successfully but then, after flashing ,my Photon goes into S.O.S. mode with 5 blinks for "Usage Fault" which I don't get...

Jarmom commented 8 years ago

Rather excited to get FastLED onto my Photon as well! Been waiting a while for this! Hope your holidays went well, Dan!

focalintent commented 8 years ago

Pushed to the particle ide - thanks again, @eklex for doing the kicks!

enjrolas commented 8 years ago

I'm still getting a build error in the particle web IDE -- the usual FastLED/led_sysdefs.h:19:43: fatal error: platforms/avr/led_sysdefs_avr.h: No such file or directory

include "platforms/avr/led_sysdefs_avr.h"

                                       ^

@focalintent -- is it working for you in the particle web IDE, or the local IDE?

enjrolas commented 8 years ago

FWIW, I also downloaded the current git repo, added the project folder to the local particle dev IDE, and tried to compile, and I got the same error.

focalintent commented 8 years ago

I currently do not have a setup that I can easily test sparkcore stuff with (and won't for another week or so - juggling a bunch of other stuff and need to find my particle hardware) - so I'm relying on @eklex's work for the moment. However, multiple people have reported being able to pull the current https://github.com/focalintent/FastLED-Sparkcore master and have it work for them - so I wonder if there's something else going on with your setup?

Although it's looking like something in the particle web ide didn't update.

(I really hate their web ide/platform from a library maintainer standpoint, it's almost irritating enough to the point where I sometimes get tempted to completely punt spark core/photon support - as it is, the spark core library is always behind what I do on the main FastLED repo)

focalintent commented 8 years ago

It looks like there's something you have to do in the particle IDE to use a newer version of a library, it's not enough for me to update the library version. Click on the info link next to the library and make sure your'e using version 3.1.4 - if not, select 3.1.4 to switch to that version.

RickDB commented 8 years ago

Yeah had the same issue and selecting 3.1.4 manually fixed it (default is still 3.1.3 there). Did have to change some things from the default FastLED sample sketch as otherwise it wouldn't compile, got it to work in my AtmoOrb sketch like this:

https://github.com/ambilight-4-mediaportal/AtmoOrb/blob/master/Particle/Photon/AtmoOrb_UDP.ino

focalintent commented 8 years ago

What changes did you have to change from the default sketch?

I'l try to keep the library more up to date - there's a bunch of major changes coming down the line (check out https://github.com/FastLED/FastLED/wiki/RGBSet-Reference) - but the fact that the sparkcore stuff has to live in a separate repo makes keeping it in sync a pain in the ass :(

RickDB commented 8 years ago

Sample had #include "FastLED.h" in there but particle IDE places the correct one with extra path at the top automatically so that fixed itself, also added the version check from the library at the top just in case. CRGBSet looks very nice, thanks for your work on this as this is so much better than NeoPixel :+1:

ScruffR commented 8 years ago

One or two things you need to do/know about libraries in Particle Build is that it keeps a local "inventory" of known libraries that might need to be refreshed to make a new version visible (sometimes you even need to press the CLEAR CACHE button in the Build properties drawer). And once you import a lib to your project its files will actually be copied over into your remote project folder (which you never actually see), so whatever updates happen on the original library will not be carried over to your project to avoid possible breaking of running code. To upgrade an already imported lib, you need to remove the old one and reimport the new one.

Jarmom commented 8 years ago

I just wanted to take a minute to thank you, Dan. I really appreciate all the hard work you put into keeping things up to date! I'll definitely be playing with the library for some time to come! Keep up the awesome work! :+1:

simetin commented 8 years ago

I cleared the cache and I created a new app, but I still get this error. Am I doing anything wrong ? FastLED/led_sysdefs.h:19:43: fatal error: platforms/avr/led_sysdefs_avr.h: No such file or directory

include "platforms/avr/led_sysdefs_avr.h"

Thanks Dan for the library, I'm using it on arduino and I really love it !

focalintent commented 8 years ago

You have to go into the info for the library and make sure you are using version 3.1.4 or later of the library. As mentioned, particle's build system doesn't seem to do this automatically. Unfortunately I can't describe exact steps to you right now because their web ui isn't loading for me at all.

RickDB commented 8 years ago

@tchinou1

Added some step by step screenshots:

Step 1 - Select Library as normal

http://s15.postimg.org/aqb98kt57/step1.png

Step 2 - Click on the highlighted info button

http://s15.postimg.org/gpz0c8dxn/step2.png

Step 3 - Click on the highlighted 3.1.4 version

http://s15.postimg.org/a22epmuff/step3.png

Step 4 - 3.1.4 should now be selected where after you can add it your app

http://s15.postimg.org/8j70knnuz/step4.png

simetin commented 8 years ago

Thanks yes I don't get the error anymore, but I get a bunch of weird errors. Like if the library wasn't include, but it is. Ex: error: 'CRGB' does not name a type error: 'TProgmemRGBPalette16' does not name a type error: 'FastLED' was not declared in this scope

RickDB commented 8 years ago

Make sure to use this at the top as some of the samples out there are invalid.

#include "FastLED/FastLED.h"
FASTLED_USING_NAMESPACE;

#if FASTLED_VERSION < 3001000
#error "Requires FastLED 3.1 or later; check github for latest code."
#endif

Full example using that here:

https://github.com/ambilight-4-mediaportal/AtmoOrb/blob/master/Particle/Photon/AtmoOrb_UDP.ino