-
Notifications
You must be signed in to change notification settings - Fork 132
Request for SPIFFS support for ESP8266 #628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this has been asked before but I can't recall where or by who. |
That's OK. Could you give me hints as to how I might add this myself? I am a professional Java developer and long time user of Eclipse, though I have never worked on plugins for Eclipse. |
The best thing is look for java code that does it. Which in this case probably exists. |
I can help with the integration where when how what |
Hi Paul. Can You sketch out how you want to approach this? For example,
what menu items go where, any mockup of screens, what is the output, etc..
…On Jan 14, 2017 14:15, "Paul Andrews" ***@***.***> wrote:
That's OK. Could you give me hints as to how I might add this myself? I am
a professional Java developer and long time user of Eclipse, though I have
never worked on plugins for Eclipse.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#628 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALC6ZX5gE41BCprNXTBSfQ0FCVxU8v9ks5rSMpygaJpZM4LjfMd>
.
|
Hi, I forked and cloned master, I have one compilation error in BoardSelectionPage line 306: Description Resource Path Location Type @wimjongman I am a long way from figuring that out. If I can get anything to work at all in a reasonable timeframe I will get back to you. |
I figure I will make this work like the equivalent process in the Arduino IDE. i.e. everything in a directory called 'data' will be packaged up by mkspiffs and then uploaded using esptool (or OTA). I see that mkspiffs is defined in platform.txt, somewhat like the esptool and network upload tool is. I see that 'esptool' is defined in boards.txt as 'generic.upload.tool', but I don't see how the path to the executable is resolved at runtime. I see that network_cmd is referenced in pre_processing_platform_default.txt, but I don't see the key (tools.esp8266OTA) being referenced anywhere in the code. In short, I'm not sure how I am supposed to find the path to mkspiffs. When I figure this out (or you tell me) I will then also have to figure out:
So, any suggestions you have on any of this would be gratefully received. |
requestLayout is from the class org.eclipse.swt.widgets control. requestLayout is not so important. It makes the page to recalculate and adapt so it shows ok. resizing the page does the same thing.
That is absolutely normal. The only tool Sloeber knows (from the top of my head) is make and upload. In short: to start mkspiffs the right command is ${A.TOOLS.MKSPIFSS.PATH}/${A.TOOLS.MKSPIFFS.CMD}
To run this use the consoled commands Now some questions from me to you. PS We use slack now. I have send you an invite. |
Hi, I will dig some more into the compilation error - I have commented it out for now. FYI I am using Mars, maybe that has some impact? The info you provided is useful, I should be able to make some progress from that. BTW mkspiffs is a tool that builds the spiffs from one or more files on your computer. esptool is then used to upload the results, so mkspiffs is like the compilation/packaging phase and esptool is the upload phase. Both tools are part of the esp8266 boards package that can be installed in the Arduino IDE. Both tools will require a lot of command line options. I am basing a lot of this on https://github.com/esp8266/arduino-esp8266fs-plugin. |
Mars could be the reason. The comment states
To make the mkspiff part of the build add following line to the pre_platform.txt From the link you supplied I would conclude they run the upload spiff as a command not connected to the build or the upload. |
OK. I am thoroughly confused. The nearest filename to pre_platform.txt is pre_processing_platform_default.txt and there is nothing like the entry you give in there. I really want to do this, but I am thinking at the moment that the easiest thing to do would be to configure a couple of external tools. The paths can be made relative to eclipse_home. e.g. ${eclipse_home}/arduinoPlugin/tools/esp8266/mkspiffs/0.1.2/mkspiffs.exe with arguments specific to my situation. |
Never settle Paul! ;)
…On Sun, Jan 15, 2017 at 10:50 PM, Paul Andrews ***@***.***> wrote:
OK. I am thoroughly confused. The nearest filename to pre_platform.txt is
pre_processing_platform_default.txt and there is nothing like the entry
you give in there. I really want to do this, but I am thinking at the
moment that the easiest thing to do would be to configure a couple of
external tools. The paths can be made relative to eclipse_home. e.g.
${eclipse_home}/arduinoPlugin/tools/esp8266/mkspiffs/0.1.2/mkspiffs.exe
with arguments specific to my situation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#628 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALC6UP4Qfy9SvaUj93om-c7449OFt8Vks5rSpS3gaJpZM4LjfMd>
.
|
I said :"add following line to the pre_platform.txt" As to the name any existing pre_platform file will do. I'm not sure whether it is already implemented but pre_processing_platform_8266.txt would be the best choice. But given the current situation I would go with pre_processing_platform_default.txt. Platform.txt and boards.txt external tools |
Just to let you know; I haven't forgotten, but life has taken over! Very busy with my son's robotics club. It also turns out that it was good to not jump straight in, because I now have a list of esp8266 related commands I want to add:
All of which I have implemented as external commands, but that is very clunky! |
judge2005, for your issue #1 (mkspiffs) and #2 (upload, wired) you can look at https://github.com/esp8266/arduino-esp8266fs-plugin/blob/master/src/ESP8266FS.java which is a plugin for the Arduino IDE that handles these. |
I added the following lines to ... in my local copy. This is really just to document what the 'recipe' is as I doubt that this is how it should really be done - i.e. it isn't really part of the build. It seems like these should be on some sort of context menu so that the user can select the resources that would be the target of the command. They should also only be enabled for ESP8266 projects and the spiff uploading should switch between OTA and serial based on what port is selected for the uploading. Perhaps it would be easier if the existing environment variables were accessible to external command scripts using the env_var eclipse variable (or are they already - I just tried it, they don't seem to be)? #for erase flash. Only works for ESP8266 and only if using wired... #for mkspiffs. Should include -s {{A.BUILD.SPIFFS_END} - {A.BUILD.SPIFFS_START}}. Or perhaps this should be a parameter? As should the source and destination. #for wired spiff upload. Should parameterize spiff file name #for OTA spiff upload. Only works for ESP8266 and only if using OTA. Should parameterize spiff filename |
If these are the commands to be run... wouldn't it be a good idea to add them as programmers? |
I think mkspiffs is part of the build. Uploading the spiffs isn’t, but it would be painful to have to switch to a different programmer when you wanted to upload them and then back again when you wanted to upload a sketch. Clearing flash is essentially resetting the ESP to factory defaults.
From: jantje<mailto:[email protected]>
Sent: Tuesday, March 7, 2017 8:31 PM
To: Sloeber/arduino-eclipse-plugin<mailto:[email protected]>
Cc: Paul Andrews<mailto:[email protected]>; Comment<mailto:[email protected]>
Subject: Re: [Sloeber/arduino-eclipse-plugin] Request for SPIFFS support for ESP8266 (#628)
If these are the commands to be run... wouldn't it be a good idea to add them as programmers?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#628 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AIsNqx26P2NGnCM-OecQRpzzRoNZzXu1ks5rjgT8gaJpZM4LjfMd>.
|
@judge2005, In your A.RECIPE.OBJCOPY.ERASE_FLASH and A.RECIPE.OBJCOPY.UPLOAD_SPIFF variables it would be better to use A.UPLOAD.RESETMETHOD instead of hardcoding ck. This is configurable by the user in project properties. Instead of hardcoding this: {A.BUILD.PATH}/../data you can instead use ${ProjDirPath}/data. Using spiffs (no extension) is a bit cryptic and would be better as spiffs.bin. |
@mpandrews2000
I'm with you here but it is not so easy. env_var is a eclipse concept. So even-though all these environment Variables are in CDT->configuration, configuration is a CDT concept (not core eclipse) and as such not reachable. |
here's what I did (on linux) and it's not exactly rocket science but in the absence of anything else, it works well enough for me. In Neon -> Run -> External Tools -> External Tools Configurations:
You can even setup a "wipe flash" tool too by calling esptool with the correct parameters. I realize that this is a little rigid and there may be a way to better determine the argument parameters in a more dynamic fashion than I've implemented here. |
I think I need to dive into these external tools. It may contain an easy fix. |
Since erase flash was mentioned in #628 (comment), here are the arguments to make that work:
You end up with something like this in the menu when you configure these: For me so far as I can tell, the configuration for these "configuration based jobs" get stored in xml files in /home/joe/Dev/Workspaces/Eclipse_Neon/.metadata/.plugins/org.eclipse.debug.core/.launches where there's one file present in here per configured job i.e.
..so with that in mind there might be a way to programatically control these items. One thing I do see however is that my external tools are always present in the menu regardless of the project type being worked on in eclipse..so that might not be ideal / might have to be worked around. |
oh and to eliminate any confusion/ambiguity I guess I should say that where I've mentioned "esptool", I'm referring to this one: https://github.com/igrr/esptool-ck and not some other random esptool (although admittedly it does all appear to be a bit random / wild west in the esptool area ;)) |
I fear the external tools will not be so easy (for me) |
Ah well no probs. As I mentioned earlier in the absence of anything else, this manual lashed together solution works well enough for me right now. Other people might want a more "professional" implementation and there might be a better way to do it than to leverage external tools.. |
Hello |
I did not make more progress. Did you try the external tools? |
I have created an ant file that will do these four tasks. It is available at https://github.com/judge2005/sloeber_spiffs. It uses a small inline groovy script to parse the org.eclipse.cdt.core.prefs file, so it will use whatever settings you have defined for the project it runs in, and it picks up the locations of all of the needed external tools and your project from there. There are a couple of properties in the build.xml that define the spiff source directory and the destination file name. BTW I couldn't get OTA uploads to work in the brief amount of testing I did. YMMV. and I haven't tested the erase flash task. I didn't want to erase my flash... Maybe this could be implemented within the plugin itself. On the other hand, it works pretty well as an ant build. |
I wanted to use the ant file here above, but when building i get an null pointer exception in build.xml 20 |
I updated the readme with more instructions. |
This is a old topic, but found it first with google having the same issue. The solution above seems to no longer be working since there is no property file to read. I found a good solution here: Solution |
Hi,
Would you consider adding support for the creation and upload of SPIFF bin files?
Thanks - Paul
The text was updated successfully, but these errors were encountered: