Skip to content
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

add esp insights framework support #1205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Click <kbd>F1</kbd> to show Visual studio code actions, then type **ESP-IDF** to
| Install ESP-Matter | | |
| Install ESP-Rainmaker | | |
| Install ESP-HomeKit-SDK | | |
| Install ESP-Insights | | |
| Launch IDF Monitor for CoreDump / GDB-Stub Mode | | |
| Launch QEMU Server | | |
| Launch QEMU Debug Session | | |
Expand Down
2 changes: 2 additions & 0 deletions docs/tutorial/additional_frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Besides ESP-IDF, you can install other frameworks to extend the extension functi

5. [ESP-HomeKit-SDK](https://github.com/espressif/esp-homekit-sdk) can be clone with the **Install ESP-HomeKit-SDK** command to the selected directory and set `idf.espHomeKitSdkPath` (`idf.espHomeKitSdkPathWin` in Windows) configuration setting.

6. [ESP-Insights](https://github.com/espressif/esp-insights) can be clone with the **Install ESP-Insights** command to the selected directory and set `idf.espInsightsPath` (`idf.espInsightsPathWin` in Windows) configuration setting.

> **NOTE:** You can also just set each configuration setting with the framework directory path if you already have them. For example, on Visual Studio Code menu `View` -> `Command Palette..`. -> type `Preferences: Open Settings (UI)` and search for ESP-ADF (or other framework) to manually set this path.

> **NOTE:** Please review [ESP-IDF Settings](../SETTINGS.md) to see how to modify these configuration settings.
Expand Down
1 change: 1 addition & 0 deletions l10n/bundle.l10n.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"Use current ESP-Matter {matterPathDir}": "Utilice ESP-Matter actual {matterPathDir}",
"Use current ESP-Rainmaker {rainmakerPathDir}": "Utilice ESP-Rainmaker actual {rainmakerPathDir}",
"Use current ESP-HomeKit-SDK {espHomeKitPathDir}": "Utilice ESP-HomeKit-SDK actual {espHomeKitPathDir}",
"Use current ESP-Insights {espInsightsPathDir}": "Utilice ESP-Insights actual {espInsightsPathDir}",
"Enter non empty string": "Introduzca una cadena que no esté vacía",
"Enter a valid integer": "Introduzca un número entero válido",
"ESP-IDF: Select Port to Use (COM, tty, usbserial)": "ESP-IDF: seleccione el puerto a usar (COM, tty, usbserial)",
Expand Down
1 change: 1 addition & 0 deletions l10n/bundle.l10n.pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"Use current ESP-Matter {matterPathDir}": "Use ESP-Matter atual {matterPathDir}",
"Use current ESP-Rainmaker {rainmakerPathDir}": "Use o ESP-Rainmaker atual {rainmakerPathDir}",
"Use current ESP-HomeKit-SDK {espHomeKitPathDir}": "Use o ESP-HomeKit-SDK atual {espHomeKitPathDir}",
"Use current ESP-Insights {espInsightsPathDir}": "Use o ESP-Insights atual {espInsightsPathDir}",
"Enter non empty string": "Insira uma string não vazia",
"Enter a valid integer": "Insira um número inteiro válido",
"ESP-IDF: Select Port to Use (COM, tty, usbserial)": "ESP-IDF: Selecione a porta a ser usada (COM, tty, usbserial)",
Expand Down
1 change: 1 addition & 0 deletions l10n/bundle.l10n.ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"Use current ESP-Matter {matterPathDir}": "Использовать текущий ESP-Matter {matterPathDir}",
"Use current ESP-Rainmaker {rainmakerPathDir}": "Используйте текущую версию ESP-Rainmaker {rainmakerPathDir}.",
"Use current ESP-HomeKit-SDK {espHomeKitPathDir}": "Использовать текущий ESP-HomeKit-SDK {espHomeKitPathDir}",
"Use current ESP-Insights {espInsightsPathDir}": "Использовать текущий ESP-Insights {espInsightsPathDir}",
"Enter non empty string": "Введите непустую строку",
"Enter a valid integer": "Введите допустимое целое число",
"ESP-IDF: Select Port to Use (COM, tty, usbserial)": "ESP-IDF: выберите порт для использования (COM, tty, usbserial)",
Expand Down
1 change: 1 addition & 0 deletions l10n/bundle.l10n.zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"Use current ESP-Matter {matterPathDir}": "使用当前 ESP-Matter {matterPathDir}",
"Use current ESP-Rainmaker {rainmakerPathDir}": "使用当前的 ESP-Rainmaker {rainmakerPathDir}",
"Use current ESP-HomeKit-SDK {espHomeKitPathDir}": "使用当前的 ESP-HomeKit-SDK {espHomeKitPathDir}",
"Use current ESP-Insights {espInsightsPathDir}": "使用当前的 ESP-Insights {espInsightsPathDir}",
"Enter non empty string": "输入非空字符串",
"Enter a valid integer": "输入有效的整数",
"ESP-IDF: Select Port to Use (COM, tty, usbserial)": "ESP-IDF:选择要使用的端口(COM、tty、usbserial)",
Expand Down
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@
"description": "%param.espRainmakerPath%",
"scope": "resource"
},
"idf.espInsightsPath": {
"type": "string",
"default": "${env:INSIGHTS_PATH}",
"description": "%param.espInsightsPath%",
"scope": "resource"
},
"idf.espIdfPathWin": {
"type": "string",
"default": "${env:IDF_PATH}",
Expand Down Expand Up @@ -463,6 +469,12 @@
"description": "%param.espHomeKitSdkPath%",
"scope": "resource"
},
"idf.espInsightsPathWin": {
"type": "string",
"default": "${env:INSIGHTS_PATH}",
"description": "%param.espInsightsPath%",
"scope": "resource"
},
"idf.port": {
"type": "string",
"default": "/dev/ttyUSB1",
Expand Down Expand Up @@ -1222,6 +1234,11 @@
"title": "%espIdf.getEspHomeKitSdk.title%",
"category": "ESP-IDF"
},
{
"command": "espIdf.getEspInsights",
"title": "%espIdf.getEspInsights.title%",
"category": "ESP-IDF"
},
{
"command": "espIdf.installEspMatterPyReqs",
"title": "%espIdf.installEspMatterPyReqs.title%",
Expand Down
2 changes: 2 additions & 0 deletions package.nls.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"espIdf.getEspMatter.title": "Instalar ESP-Matter",
"espIdf.getEspMdf.title": "Instalar ESP-MDF",
"espIdf.getEspRainmaker.title": "Instalar ESP-Rainmaker",
"espIdf.getEspInsights.title": "Instalar ESP-Insights",
"espIdf.heaptrace.title": "Rastreo de montón",
"espIdf.idfReconfigureTask.title": "ESP-IDF: Ejecute la tarea de reconfiguración de idf.py",
"espIdf.importProject.title": "Importar proyecto ESP-IDF",
Expand Down Expand Up @@ -121,6 +122,7 @@
"param.espMatterPath": "Ruta para localizar el framework ESP-Matter (ESP_MATTER_PATH)",
"param.espMdfPath": "Ruta para localizar el framework ESP-MDF (MDF_PATH)",
"param.espRainmakerPath": "Ruta para localizar el framework ESP-Rainmaker (RMAKER_PATH)",
"param.espInsightsPath": "Ruta para localizar el framework ESP-Insights (INSIGHTS_PATH)",
"param.exportPaths": "Rutas que se agregarán a PATH",
"param.exportVars": "Variables que se agregarán a las variables de entorno del sistema",
"param.flashBaudRate": "Tasa de baudios de flasheo ESP-IDF",
Expand Down
2 changes: 2 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"espIdf.getEspMatter.title": "Install ESP-Matter",
"espIdf.getEspMdf.title": "Install ESP-MDF",
"espIdf.getEspRainmaker.title": "Install ESP-Rainmaker",
"espIdf.getEspInsights.title": "Install ESP-Insights",
"espIdf.heaptrace.title": "Heap Trace",
"espIdf.idfReconfigureTask.title": "ESP-IDF: Run idf.py reconfigure task",
"espIdf.importProject.title": "Import ESP-IDF Project",
Expand Down Expand Up @@ -121,6 +122,7 @@
"param.espMatterPath": "Path to locate ESP-Matter framework (ESP_MATTER_PATH)",
"param.espMdfPath": "Path to locate ESP-MDF framework (MDF_PATH)",
"param.espRainmakerPath": "Path to locate ESP-Rainmaker framework (RMAKER_PATH)",
"param.espInsightsPath": "Path to locate ESP-Insights framework (INSIGHTS_PATH)",
"param.exportPaths": "Paths to be appended to PATH",
"param.exportVars": "Variables to be added to system environment variables",
"param.flashBaudRate": "ESP-IDF Flash Baud rate",
Expand Down
2 changes: 2 additions & 0 deletions package.nls.pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"espIdf.getEspMatter.title": "Instale ESP-Matter",
"espIdf.getEspMdf.title": "Instale ESP-MDF",
"espIdf.getEspRainmaker.title": "Instale ESP-Rainmaker",
"espIdf.getEspInsights.title": "Instale ESP-Insights",
"espIdf.heaptrace.title": "Rastreamento de pilha",
"espIdf.idfReconfigureTask.title": "ESP-IDF: Execute a tarefa de reconfiguração idf.py",
"espIdf.importProject.title": "Importar projeto ESP-IDF",
Expand Down Expand Up @@ -121,6 +122,7 @@
"param.espMatterPath": "Caminho para localizar a estrutura ESP-Matter (ESP_MATTER_PATH)",
"param.espMdfPath": "Caminho para localizar a estrutura ESP-MDF (MDF_PATH)",
"param.espRainmakerPath": "Caminho para localizar a estrutura ESP-Rainmaker (RMAKER_PATH)",
"param.espInsightsPath": "Caminho para localizar a estrutura ESP-Insights (INSIGHTS_PATH)",
"param.exportPaths": "Caminhos a serem anexados ao PATH",
"param.exportVars": "Variáveis ​​a serem adicionadas às variáveis ​​de ambiente do sistema",
"param.flashBaudRate": "Taxa de transmissão de flash ESP-IDF",
Expand Down
2 changes: 2 additions & 0 deletions package.nls.ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"espIdf.getEspMatter.title": "Установите ESP-Matter",
"espIdf.getEspMdf.title": "Установить ЭСП-МДФ",
"espIdf.getEspRainmaker.title": "Установите ESP-Rainmaker",
"espIdf.getEspInsights.title": "Установите ESP-Insights",
"espIdf.heaptrace.title": "Трассировка кучи",
"espIdf.idfReconfigureTask.title": "ESP-IDF: запустить задачу перенастройки idf.py",
"espIdf.importProject.title": "Импортировать проект ESP-IDF",
Expand Down Expand Up @@ -121,6 +122,7 @@
"param.espMatterPath": "Путь для поиска структуры ESP-Matter (ESP_MATTER_PATH)",
"param.espMdfPath": "Путь для поиска платформы ESP-MDF (MDF_PATH)",
"param.espRainmakerPath": "Путь к инфраструктуре ESP-Rainmaker (RMAKER_PATH)",
"param.espInsightsPath": "Путь к инфраструктуре ESP-Insights (INSIGHTS_PATH)",
"param.exportPaths": "Пути для добавления в PATH",
"param.exportVars": "Переменные, добавляемые в переменные системной среды",
"param.flashBaudRate": "Скорость передачи флэш-памяти ESP-IDF",
Expand Down
2 changes: 2 additions & 0 deletions package.nls.zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"espIdf.getEspMatter.title": "安装 ESP-Matter",
"espIdf.getEspMdf.title": "安装 ESP-MDF",
"espIdf.getEspRainmaker.title": "安装 ESP-Rainmaker",
"espIdf.getEspInsights.title": "安装 ESP-Insights",
"espIdf.heaptrace.title": "堆跟踪",
"espIdf.idfReconfigureTask.title": "ESP-IDF: 运行IDF.py重新配置任务",
"espIdf.importProject.title": "导入 ESP-IDF 项目",
Expand Down Expand Up @@ -121,6 +122,7 @@
"param.espMatterPath": "定位 ESP-Matter 框架的路径 (ESP_MATTER_PATH)",
"param.espMdfPath": "定位 ESP-MDF 框架的路径 (MDF_PATH)",
"param.espRainmakerPath": "定位 ESP-Rainmaker 框架的路径 (RMAKER_PATH)",
"param.espInsightsPath": "定位 ESP-Insights 框架的路径 (INSIGHTS_PATH)",
"param.exportPaths": "要附加到 PATH 的路径",
"param.exportVars": "要添加到系统环境变量的变量",
"param.flashBaudRate": "ESP-IDF 烧录波特率",
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export namespace ESP {
"idf.espMdfPath",
"idf.espRainmakerPath",
"idf.espHomeKitSdkPath",
"idf.espInsightsPath",
"idf.gitPath",
"idf.pythonBinPath",
"idf.port",
Expand Down
40 changes: 40 additions & 0 deletions src/espInsights/espInsightsDownload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Project: ESP-IDF VSCode Extension
* File Created: Thursday, 30th May 2024 2:07:24 pm
* Copyright 2024 Espressif Systems (Shanghai) CO LTD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Uri } from "vscode";
import { AbstractCloning } from "../common/abstractCloning";
import { readParameter } from "../idfConfiguration";

export class EspInsightsCloning extends AbstractCloning {
constructor(gitBinPath: string = "git") {
super(
"https://github.com/espressif/esp-insights.git",
"ESP-Insights",
"main",
gitBinPath,
"https://gitee.com/EspressifSystems/esp-insights.git"
);
}
}

export async function getEspInsights(workspace: Uri) {
const gitPath = await readParameter("idf.gitPath", workspace) || "git";
const insightsInstaller = new EspInsightsCloning(gitPath);
await insightsInstaller.getRepository("idf.espInsightsPath", workspace);
}

23 changes: 23 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ import { checkDebugAdapterRequirements } from "./espIdf/debugAdapter/checkPyReqs
import { CDTDebugConfigurationProvider } from "./cdtDebugAdapter/debugConfProvider";
import { CDTDebugAdapterDescriptorFactory } from "./cdtDebugAdapter/server";
import { IdfReconfigureTask } from "./espIdf/reconfigure/task";
import { getEspInsights } from "./espInsights/espInsightsDownload";

// Global variables shared by commands
let workspaceRoot: vscode.Uri;
Expand Down Expand Up @@ -782,6 +783,10 @@ export async function activate(context: vscode.ExtensionContext) {
getEspRainmaker(workspaceRoot)
);

registerIDFCommand("espIdf.getEspInsights", async () =>
getEspInsights(workspaceRoot)
);

registerIDFCommand("espIdf.setMatterDevicePath", async () => {
if (process.platform === "win32") {
return vscode.window.showInformationMessage(
Expand Down Expand Up @@ -3633,6 +3638,11 @@ async function getFrameworksPickItems() {
workspaceRoot
) as string;

const espInsightsPathDir = idfConf.readParameter(
"idf.espInsightsPath",
workspaceRoot
) as string;

const pickItems = [];
try {
const doesIdfPathExists = await utils.dirExistPromise(espIdfPath);
Expand Down Expand Up @@ -3700,6 +3710,19 @@ async function getFrameworksPickItems() {
target: espHomeKitPathDir,
});
}

const doesEspInsightsExists = await utils.dirExistPromise(
espInsightsPathDir
);
if (doesEspInsightsExists) {
pickItems.push({
description: "ESP-Insights",
label: vscode.l10n.t(`Use current ESP-Insights {espInsightsPathDir}`, {
espInsightsPathDir,
}),
target: espInsightsPathDir,
});
}
} catch (error) {
const errMsg = error.message ? error.message : "Error getting frameworks";
Logger.errorNotify(errMsg, error);
Expand Down
13 changes: 13 additions & 0 deletions src/newProject/newProjectInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface INewProjectArgs {
espAdfPath: string;
espMdfPath: string;
espHomeKitSdkPath: string;
espInsightsPath: string;
boards: IdfBoard[];
components: IComponent[];
serialPortList: string[];
Expand Down Expand Up @@ -82,6 +83,10 @@ export async function getNewProjectArgs(
"idf.espHomeKitSdkPath",
workspace
) as string;
const espInsightsPath = idfConf.readParameter(
"idf.espInsightsPath",
workspace
) as string;
let templates: { [key: string]: IExampleCategory } = {};
templates["Extension"] = getExamplesList(extensionPath, "templates");
const idfExists = await dirExistPromise(espIdfPath);
Expand All @@ -104,6 +109,13 @@ export async function getNewProjectArgs(
const homeKitSdkTemplates = getExamplesList(espHomeKitSdkPath);
templates["ESP-HOMEKIT-SDK"] = homeKitSdkTemplates;
}
const espInsightsExists = await dirExistPromise(
espInsightsPath
);
if (espInsightsExists) {
const espInsightsTemplates = getExamplesList(espInsightsPath);
templates["ESP-Insights"] = espInsightsTemplates;
}
progress.report({ increment: 50, message: "Initializing wizard..." });
return {
boards: espBoards,
Expand All @@ -112,6 +124,7 @@ export async function getNewProjectArgs(
espIdfPath: idfExists ? espIdfPath : undefined,
espMdfPath: mdfExists ? espMdfPath : undefined,
espHomeKitSdkPath: homekitSdkExists ? espHomeKitSdkPath: undefined,
espInsightsPath: espInsightsExists ? espInsightsPath : undefined,
serialPortList,
targetList,
templates,
Expand Down
6 changes: 6 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,12 @@ export function appendIdfAndToolsToPath(curWorkspace: vscode.Uri) {
);
modifiedEnv.RMAKER_PATH = rainmakerPathDir || modifiedEnv.RMAKER_PATH;

const espInsightsPathDir = idfConf.readParameter(
"idf.espInsightsPath",
curWorkspace
);
modifiedEnv.INSIGHTS_PATH = espInsightsPathDir || modifiedEnv.INSIGHTS_PATH;

const defaultToolsPath = path.join(containerPath, ".espressif");
const toolsPath = idfConf.readParameter(
"idf.toolsPath",
Expand Down
Loading