Code Monkey home page Code Monkey logo

vscode-iot-utility's Introduction

IoT Utility

Join the chat at https://gitter.im/formulahendry/vscode-platformio Marketplace Version Installs Rating Build Status

Integrate PlatformIO into Visual Studio Code on top of PlatformIO Core. Cross-platform Build System without external dependencies to the OS software: 550+ embedded boards, 25+ development platforms, 15+ frameworks. Arduino and ARM mbed compatible.

Atmel AVR & SAM, Espressif 8266 & 32, Freescale Kinetis, Intel ARC32, Lattice iCE40, Microchip PIC32, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, ARM mbed, libOpenCM3, ESP8266, etc.

What's New in v0.3.0

Discover devices connected via Ethernet, Wi-Fi and USB: Press F1 and then select/type IoT Utility: Discover Device. (Make sure you have installed device-discovery-cli)

	IP Address    MAC Address       Type                                    Host Name

	10.172.14.69  08:00:27:d7:27:ef raspberrypi (Raspberry Pi)              raspberrypi
	10.172.15.84  00:15:5d:0f:9d:01 tessel (Tessel 2)                       tessel2
	10.172.14.219 00:0c:29:35:fa:9f huzzah (Adafruit HUZZAH ESP8266)
	10.172.15.98  78:2b:cb:b5:1c:9c ?

Note

If you want to build IoT projects connected to an IoT cloud service. You could take a look at aka.ms/azure.iot for Microsoft Azure IoT projects and resources.

If you are already using Azure IoT services, you could use Azure IoT Toolkit extension for better development experience.

Features

Prerequisites

Setup

  • Use existing project

    If you have an existing PlatformIO project, open the project folder directly in VS Code

  • Create new project

    In terminal, run platformio init --board <your_board_identifier> to initialize a new PlatformIO project, then open the project folder in VS Code. Refer to User Guide for platformio init command. For how to find Board Identifier, you could refer to this.

Usage

  • Build PlatformIO project: Use shortcut Ctrl+Alt+B, or press F1 and then select/type PlatformIO: Build, or right click the Text Editor and then click PlatformIO: Build in context menu

build

  • Upload firmware to devices: Use shortcut Ctrl+Alt+U, or press F1 and then select/type PlatformIO: Upload, or right click the Text Editor and then click PlatformIO: Upload in context menu

upload

  • Open Serial Monitor: Use shortcut Ctrl+Alt+S, or press F1 and then select/type PlatformIO: Open Serial Monitor, or right click the Text Editor and then click PlatformIO: Open Serial Monitor in context menu

openSerialMonitor

  • Search for library: Click the Library item in the Status Bar at the bottom, or press F1 and then select/type PlatformIO: Search Library, then type the query to search for library. Refer to the User Guide for the query syntax.

searchLibrary

  • Install library: Click the Download icon in the Status Bar at the bottom, or press F1 and then select/type PlatformIO: Install Library, then type library id or name to install. Refer to the User Guide for the detailed usage.

installLibrary

  • Quick way to open PlatformIO Terminal: Click the Terminal icon in the Status Bar at the bottom, or press F1 and then select/type PlatformIO: Open Terminal

openTerminal

  • Add Include Path to c_cpp_properties.json for C/C++ extension: Press F1 and then select/type PlatformIO: Add Include Path to Settings. Wait for some seconds, then the PlatformIO libraries will be automatically added into Include Path of c_cpp_properties.json. (Note: Do not modify c_cpp_properties.json manually since the c_cpp_properties.json will be fully regenerated and your manual changes will be lost.)

  • Combined Build, Upload and Open Serial Monitor with one command: Click the Right Arrow icon in the Status Bar at the bottom, or use shortcut Ctrl+Alt+A, or press F1 and then select/type PlatformIO: Build, Upload and Open Serial Monitor. Build, Upload and Open Serial Monitor will be run one by one.

buildUploadAndOpenSerialMonitor

  • Discover devices connected via Ethernet, Wi-Fi and USB: Press F1 and then select/type IoT Utility: Discover Device. (Make sure you have installed device-discovery-cli)
	IP Address    MAC Address       Type                                    Host Name

	10.172.14.69  08:00:27:d7:27:ef raspberrypi (Raspberry Pi)              raspberrypi
	10.172.15.84  00:15:5d:0f:9d:01 tessel (Tessel 2)                       tessel2
	10.172.14.219 00:0c:29:35:fa:9f huzzah (Adafruit HUZZAH ESP8266)
	10.172.15.98  78:2b:cb:b5:1c:9c ?

Settings

  • platformio.baudRate: Set baud rate for Serial Monitor. (Default is 9600)
  • platformio.showHelpInfo: Whether to show help info when opening PlatformIO Terminal. (Default is true)
  • platformio.autoUpdateIncludes: Whether to add Include Path to c_cpp_properties.json automatically. (Default is true)

Telemetry data

By default, anonymous telemetry data collection is turned on to understand user behavior to improve this extension. To disable it, update the settings.json as below:

{
    "platformio.enableTelemetry": false
}

Change Log

See Change Log here

Issues

Currently, the extension is in the very initial phase. If you find any bug or have any suggestion/feature request, please join the chat on Gitter or submit the issues to the GitHub Repo.

Contributions

Contributions are warmly welcome! Please follow the Contribution Guide to setup development environment.

vscode-iot-utility's People

Contributors

dymo avatar formulahendry avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-iot-utility's Issues

Identifier "snprintf" is not defined intellisense error

Recently intellisense in visual studio code has begun giving me an 'identifier "snprintf" is not defined' error when I call the snprintf funciton. This is using PlatformIO with the ESP8266. This code compiles and runs fine.

Add license

Please add a license, I don't have any strong opinion on which one - it could be MIT like VS Code uses.

I think it should be both in package.json and in a file so GitHub can show it correctly.

How to select project for key command?

Thanks for this nice utility. I have mapped ctrl-r to call build, upload, and start monitor. Alas, it looks like it always uses the same (wrong) project to build instead of the 'active' one. How can I fix this?

Bad cli commands

The platformio command seems to expect entirely other commands than this extension provides. Everything results in an error starting from initialization.

Completely unusable.
Also the serial monitor is very bad, setting the baud rate from settings in json is just crazy. (ESP8266 requires multiple baud rates for uploading and debugging) A separate interface would be much better. I would not use the serial monitor in its current state. (edit I see that one can modify the baud rate also from the platformio.ini file, but still I'd rather take an A,B,C,D,E,F,G option to select from baud rates when opening the serial monitor)
I still don't know how to send commands from the serial interface.
VSCode 1.13.0, installed the platformio core and the PlatformIO IDE extension from extensions.
PlatformIO, version 3.3.1
Windows 10

But otherwise the interface seems really nice.

Closed because I posted in the wrong project, I see that there are 2 forks.

Add C/C++ extension as an extension dependency

I wonder whether it would be better to add C/C++ extension as an extension dependency. i.e. put below settings into package.json. Installing PlatformIO extension will also install the C/C++ extension.

"extensionDependencies": [
    "ms-vscode.cpptools"
]

There seems no side effect.

fresh install on VSC, Windows 64bits, 1.18.1 doesn't work

Start with an open, empty folder then: Platform.IO IDE 0.7.4 => Install and asks for reload. After reloading it opens PIO Home and there is the Home icon on the left side (that is the only one)

Then, actions "Initialize or update project and I select a platform and it installs it. In the folder now there are some other files (same if I open home and then "Initialize project").
I open the main.cpp and try to build => "No build task to run found" (there are no platform.io icons on the lower status bard besides the home as well...).

VSC, Windows 64bits, 1.18.1

How can I troubleshoot this?

thanks!

c_cpp_properties.json should be recreated

The current implementation of addIncludePathToFile(includes) only adds new include paths to the file, it doesn't clean up the old paths. I guess this is to be nice and not risk deleting anything the user may have added manually, but in this case we get all the information we need from PlatformIO, so it is ok to say that this file should not be modified by the user.

I don't know if the C++ extension can handle comments in the c_cpp_properties.json file to warn the user against modifying it, but I have always loved the comment Visual Studio adds to auto generated files: "This code was generated by a tool", see: http://www.urbandictionary.com/define.php?term=tool if you don't understand why that makes me smile.

If you have different board environments in your PIO project (ex. a regular Arduino Uno and an ESP8266 with Arduino framework), then the include paths for the tool chain will be completely different, but both environments will have mostly the same header files with only small differences, so if the user change the default environment in the platformio.ini file and we end up with include paths for both frameworks in c_cpp_properties.json, then there is a risk that the C++ extension will use the wrong, slightly different, header file and drive the user crazy when things doesn't work that way his editor tells him. I have tried that, when it showed me intellisense for snprintf from a Windows Mobile header file while I was working on a ESP8266 Arduino project and they are different, which leads to the next point:

Default for the C++ extension is to keep a cache in the users home folder, which then can have information from the system header files, so we should also set "databaseFilename": "${workspaceRoot}/.vscode/browse.vc.db" to make sure that it only have the include files the list PIO provides. I don't know if that means we should also delete the browse.vc.db* files when updating c_cpp_properties.json.

@sean-mcmanus do you have an opinion about that?

We should also set the defines to the list coming from PIO.

Good job

Great little tool. Has substituted my own task.json nearly completely. Could you provide a hint, how to run BUILD and UPLOAD one after the other with one stroke?

Thanks

c_cpp_properties.json file removes entries automatically when you close and reopen vscode

This is preventing including library files because this is the location of a required include file.
Steps to reproduce.

  1. Open a folder and initialize it for platformio
  2. Select the ATMegga2560 board configuration.
  3. Create a main.cpp file
  4. Add line #include <Arduino.h>
  5. Add line #include <Adafruit_GFX.h>
  6. Add void setup and void loop callback functions
  7. Open c_cpp_properties.json and select the line containing TFT/src and copy it to a new line
  8. Add the utility subfolder
  9. Close VSCODE
  10. Reopen VSCODE
  11. Observe in awe as after a few seconds the utility entry removes itself.

image

In file included from src\main.cpp:2:0:
lib\ST7775/TFT_2_ST7775.h:10:26: fatal error: Adafruit_GFX.h: No such file or directory
#include <Adafruit_GFX.h>
^

compilation terminated.
platformio issue

Requires Chinese language and visual operate interface

  1. There is no multi-language display, such as Chinese
  2. There is no visual interface and icons, the wizard, pure command operation is very troublesome
  3. Arduino IDE project is not compatible with the Arduino IDE project, Arduino IDE can not be opened
  4. Functionally unable to completely replace the Arduino IDE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.