Skip to content

Commit 311caa8

Browse files
committed
Initial commit.
0 parents  commit 311caa8

File tree

12 files changed

+1069
-0
lines changed

12 files changed

+1069
-0
lines changed

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true
7+
},
8+
"parserOptions": {
9+
"ecmaFeatures": {
10+
"jsx": true
11+
},
12+
"sourceType": "module"
13+
},
14+
"rules": {
15+
"no-const-assign": "warn",
16+
"no-this-before-super": "warn",
17+
"no-undef": "warn",
18+
"no-unreachable": "warn",
19+
"no-unused-vars": "warn",
20+
"constructor-super": "warn",
21+
"valid-typeof": "warn"
22+
}
23+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// A launch configuration that launches the extension inside a new window
2+
{
3+
"version": "0.1.0",
4+
"configurations": [
5+
{
6+
"name": "Debug ESP8266FS Extension",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"runtimeExecutable": "${execPath}",
10+
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
11+
"stopOnEntry": false
12+
}
13+
]
14+
}

.vscode/tasks.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Install NPM Packages",
8+
"type": "shell",
9+
"command": "npm install",
10+
"problemMatcher": []
11+
}
12+
]
13+
}

.vscodeignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.vscode/**
2+
.vscode-test/**
3+
docs/**
4+
test/**
5+
.gitignore
6+
jsconfig.json
7+
vsc-extension-quickstart.md
8+
.eslintrc.json

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Change Log
2+
All notable changes to the "vscode-esp8266fs" extension will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
7+
# [Unreleased]
8+
9+
## [0.9.0-rc1] - 2018-02-11
10+
11+
- Initial release - out for review.

LICENSE.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
----------------------------- START OF LICENSE --------------------------------
2+
3+
MIT License
4+
5+
Copyright (c) 2018 Kev Ashley
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
25+
------------------------------ END OF LICENSE ----------------------------------

README.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Visual Studio Code extension for ESP8266 File System (SPIFFS)
2+
3+
Welcome to the Visual Studio extension for the **ESP8266 File System Uploader**. This extension provides the same functionality for VSCode as the [Arduino ESP8266 filesystem uploader](https://github.com/esp8266/arduino-esp8266fs-plugin) does for the Arduino IDE: it packages and uploads a BLOB to an ESP8266 allowing it to use a portion of it's Flash Memory as a Storage Device with SPIFFS (**SPI** **F**lash **F**ile **S**ystem).
4+
5+
Whereas the Arduino IDE version adds a menu item to the IDE (*Tools/ESP8266 Sketch Data Updoad*), VSCode provides no such mechanism. Instead, this extension implements a single VSCode command (`ESP8266: File System Upload Data [esp8266fs.uploadData]`) to perform the same task.
6+
7+
While this extension really doesn't need the [Arduino IDE](https://www.arduino.cc/en/Main/Software) installed - it only needs the ESP8266 package and tools - it's best to have it installed anyway. This extension is meant to be a companion extension for the [Arduino for Visual Studio Code](https://github.com/Microsoft/vscode-arduino) plugin, and it relies on the Arduino IDE to compile and upload code through their toolchain.
8+
9+
## Features
10+
11+
* Works with or without the [Arduino for Visual Studio Code](https://github.com/Microsoft/vscode-arduino) plugin installed.
12+
* Uses settings from **.vscode/arduino.json**, **.vscode/.../settings.json** or **...arduino.../preferences.txt**.
13+
14+
> Tip: Add the "esp866fs.upload" command to your **gulp/webpack** toolchain to turn your ESP8266 into a "one-button" dev cycle.
15+
16+
## Requirements
17+
18+
The [ESP8266 core for Arduino](https://github.com/esp8266/Arduino) needs to be installed on your computer. This needs to be done through the [Arduino IDE](https://www.arduino.cc/en/Main/Software)'s Board Manager (*Tools/Board/Board Manager...*) or via the [Arduino for Visual Studio Code](https://github.com/Microsoft/vscode-arduino)'s "**arduino.showBoardManager**"command.
19+
20+
## Getting Started
21+
22+
After installing this extension, you need to:
23+
24+
* Create a new VSCode Project via the [Arduino for Visual Studio Code](https://github.com/Microsoft/vscode-arduino) extension (Command: `arduino.initialize`) or a new sketch with the **Arduino IDE**.
25+
26+
* Install the **ESP8266** board from the Board Manager.
27+
28+
* Select an **ESP8266** board as the target development board.
29+
30+
* Select the desired **SPIFFS** program/storage split (Arduino: *Tools/Flash Size...*, VSCode: *arduino.changeBoardType*).
31+
32+
* Create and populate a directory with the files to be uploaded to the target **ESP8266 SPIFFS** partition - **`i.e. to replace the current contents!`**
33+
34+
> Note: Maximum length of a file name in **SPIFFS** is 32 characters. Subdirectories are "simulated" in that a file name really contains the "/" of the file's folder. I.e. a file stored at "abc/def/ghi.txt" has a name with 16 characters. Files are packed relative to the `path` setting and not of the base OS.
35+
36+
* Set the `path` setting to point the base directory of the files to be uploaded.
37+
38+
* Set the `temp` setting to a filename that **mkspiffs** will create.
39+
40+
## Installation
41+
42+
Open VS Code and press `F1` or `Ctrl + Shift + P` to open command palette, select **Install Extension** and type `vscode-esp8266fs`.
43+
44+
Or launch VS Code Quick Open (`Ctrl + P`), paste the following command, and press enter.
45+
```bash
46+
ext install vscode-esp8266fs
47+
```
48+
You can also install directly from Marketplace within Visual Studio Code, searching for `ESP8266FS`.
49+
50+
## Extension Settings
51+
52+
The following Visual Studio Code settings are available for the `ESP8266FS` extension. These can be set in global user preferences `Ctrl + ,` or workspace settings (.vscode/settings.json). The later overrides the former.
53+
54+
```json
55+
{
56+
"arduino.path": "C:/Program Files (x86)/Arduino",
57+
"esp8266fs.dataFiles": "data",
58+
"esp8266fs.spiffsImage": "spiffs.image.bin",
59+
"esp8266fs.logLevel": "normal",
60+
}
61+
```
62+
* `arduino.path` - (*defined by the [Arduino ESP8266 filesystem uploader](https://github.com/esp8266/arduino-esp8266fs-plugin)*). Path to Arduino, you can use a custom version of Arduino by modifying this setting to include the full path. Example: `C:\\Program Files\\Arduino` for Windows, `/Applications` for Mac, `/home/$user/Downloads/arduino-1.8.1` for Linux.
63+
64+
* `esp8266fs.dataFiles` - Location of the files to be uploaded to the ESP8266. File names will be generated relative to this path.
65+
66+
* `esp8266fs.spiffsImage` - Location of the packed **SPIFFS** image to be uploaded to the ESP8266.
67+
68+
* `esp8266fs.logLevel` - Changes the amount of spew produced. Set to either `normal`, `verbose`, `silent`, or `debug`.
69+
70+
The following settings are per sketch settings (*defined by the [Arduino ESP8266 filesystem uploader](https://github.com/esp8266/arduino-esp8266fs-plugin)*). You can find them in `.vscode/arduino.json` under the workspace.
71+
72+
```json
73+
{
74+
"port": "COM6",
75+
"board": "esp8266:esp8266:generic",
76+
"configuration": "...FlashSize=4M3M,...ResetMethod=ck,..."
77+
}
78+
```
79+
* `port` - Name of the serial port connected to the device. Can be set by the `Arduino: Select Serial Port` command.
80+
* `board` - Current selected Arduino board alias. Can be set by the `Arduino: Change Board Type` command. Also, you can find the board list there.
81+
* `configuration` - (*Undocumented*) A comma-delimited string of the configuration settings selected for all board "menu" items. **ESP8266FS** relies on two key/value pairs in the string: `FlashSize` and `ResetMethod`.
82+
83+
Alternatively, if the `.vscode/arduino.json` file doesn't exist, or a particular setting is not defined, then the settings in the Arduino IDE's `preferences.txt` file will be used instead.
84+
85+
```ini
86+
board=generic
87+
target_package=esp8266
88+
target_platform=esp8266
89+
90+
serial.port=COM6
91+
92+
custom_FlashSize=generic_4M3M
93+
custom_ResetMethod=generic_ck
94+
95+
```
96+
97+
---
98+
99+
## Development
100+
101+
Installing Prerequisites:
102+
103+
* [Git](https://git-scm.com/)
104+
* [Node.js](https://nodejs.org/) (>= 6.5.0)
105+
* [Npm](https://www.npmjs.com/) (>= 3.10.3)
106+
107+
To *run and develop*, do the following:
108+
* `git clone https://github.com/kash4kev/vscode-esp8266fs`
109+
* `cd vscode-esp8266fs`
110+
* Open in Visual Studio Code (`code .`)
111+
* Press `F5` to debug
112+
113+
---
114+
115+
## Change Log
116+
117+
See the [Change log](https://github.com/kash4kev/vscode-esp8266fs/blob/master/CHANGELOG.md) for the details of changes for each version.
118+
119+
## Known Issues
120+
121+
The code for the "python/espota" ("**O**ver **T**he **A**ir" *or* **IP**) exection has __not__ been tested due to lack of appropriate hardware and locating the "espota.py" script.
122+
123+
## Release Notes
124+
125+
### 0.9.0
126+
127+
Initial release - out for review.
128+
129+
## License
130+
131+
This extension is licensed under the [MIT License](https://github.com/Microsoft/vscode-esp8266fs/blob/master/LICENSE.txt).

0 commit comments

Comments
 (0)