Sunday, August 13, 2017

Atom - platformio = fail

Editing both the main sketch and the libraries was a total hassle in the Arduino IDE. After a quick look around I installed atom and platformio. Very sexy.

UPDATE: platformio is a complete fail. I was getting unusual data from the DS3231 clock, but I couldn't tell if it was my wrapper or the original library that I'd grabbed for the Arduino IDE.

Long story short, I tried renaming the original library folder, installed the first DS3231 library from the platformio gui (after I hunted the gui down) and got the same result.

Ok, no big deal, let's see what the library is doing with the hour/h12/pm data.

Wait, where is the library? It's not in the lib directory. I guess it's global?

So where is the global library folder? It's not visible in the project folder/file list on the left.

I hunt down the library gui button that has the 'reveal in finder' button, and resort to opening the .cpp file in.... TextWrangler. What a waste of time. I can't edit the .cpp file in platformio? I can't select to open it with Atom - platformio just throws a big red error box and pukes.

I'm giving up on platformio for now; it's library system is overly complicated/obtuse/opaque, and I can't easily open my own global library files to edit them at the same as my source code. It is in active development so I can see it getting better, but for now there isn't any difference to just opening everything in TextWrangler and recompiling in the Arduino IDE.

It seems to work; after some futzing around with extra #includes in the projects main .cpp file  I think I foiled the broken library path logic enough - I have a few custom libs and it's compiling without throwing errors because it can't find the Arduino base libs like EEPROM.h and my hacked Wire.h.

It's notion of statically compiled libraries in a per-project /lib folder is totally counterintuitive to why I write libraries in the first place - shared, reusable code. Also, there were a few support questions and the response was 'our libs are better'. Really? Better than what the entire open source community writes? Bullshit.

But whatever, it works for now. Worst case is the author updates it, breaks the logic in a different way, and then I throw it all out and go back to the Arduino IDE, TextWrangler, and forcing recompiles outside by deleting .o files. Blech.


No comments:

Post a Comment