Shenzhen Xin Yuan Electronic Technology Co., Ltd.
购物车图片 购物车 ( )
找服务 找新闻
The recommended reading
Hot label / Products

Arduino ESP8266 in the Visual Studio IDE

Time: 2017-08-02
Clicks: 300

NOTE: The esp8266 Arduino core has a bug that causes wifi dhcp connect to fail if a delay() is used in the setup() function

NOTE: Make sure the Serial Monitor DTR and RTS checkboxes are OFF when using esp8266 devices, otherwise you will find youself pressing the reset button quite often :)

The ESP8266 hardware can be installed from within Visual Studio Board Manager but the Arduino Ide Board Manager is recommended (bug: click the Rescan button twice after installing new hardware for the boards to appear).

NOTE: December 2016 - WiFi (with OTA) Debug Beta has been released. Update of variables during debug is not yet supported. Uses UDP messaging. Breakpoints and debugging auto-deactivates when a debug session ends. To upload with USB and debug with WiFi set the "Remote Transport" project property to "Udp" and the "Local Port" to the IpAddress. For OTA devices there is no configuration required except to switch the tool bar from "Release" to "Debug". It is also recommended to switch on "vMicro>Debugger>Full Speed".  BETA - Do not use the WiFi debugger with remote devices that can not be manually reset.

Tip: If new hardware is installed outside of visual micro (ie: in the arduino ide) then click 'tools>visual micro>reload toolchains' or restart Visual Micro

Arduino ESP8266 in the Visual Studio IDE


SPIFFS File System

To publish a file system to an ESP8266 create a sub folder called "data" below any Arduino project and then click "vMicro>Publish Server Data Files".

note: This feature currently ignores the solution explorer and uploads all files and folders that exist in the "[project]\data" sub folder.

Arduino ESP8266 in the Visual Studio IDE

tip: The Board options provide various SPIFFS settings. Read more


OTA with auto-discovery

"Apple Bonjor for Windows" must be installed for IP address auto discovery to work. This will automatically look for IP addresses on the local network.

Detailed instructions can be found here OTA Guide

If an upload password has been set in the espcode, a password dialog will appear when OTA begins

OTA configuration is automatic. The image shows two esp boards have been discovered using the Apple Bonjour Service.

Arduino ESP8266 in the Visual Studio IDE


OTA without requiring Apple Bonjour auto-discovery

Ip addresses can be manually entered into the Visual Micro ports (serial) list when the combo box is in the collapsed state. After entering the Ip address, press the ENTER key to confirm.

mDNS properties such as {network.port} will not be available when an ip address is entered manually (and the address has not been discovered by the Bonjour Service)

Instead of using mDNS a local project "board.txt" file can be added to the project.

The image shows the project's board.txt in the lower editor and a manually entered ip address ( that has not been discovered via the Bonjour Service.

Arduino ESP8266 in the Visual Studio IDE


OTA Upload Code Example (applies to all methods of ota)

Example Esp OTA code (esp core v2.2.0) :-

void ArduinoOTABegin(String &hostname)
// Set port

// set hostname

// Uncomment the next line to require authentication
// ArduinoOTA.setPassword((const char *)"test");

// start OTA Server


Full/paid Visual Micro Users Can Use Board.txt in the project folder to provide overrides (instead of using Bonjour)

Board.txt password required example:-

 # local project board.txt overrides

Board.txt password not required example:-

 # local project board.txt overrides



Share to:
Related recommendations
2020 - 07 - 06
点击次数: 15
2020 - 06 - 15
点击次数: 179
LILYGO® TTGO T-PCIE ESP32-WROVER-B AXP192 Chip WIFI Bluetooth Nano Card SIM Series Composable Development Board Hardware
2020 - 05 - 09
点击次数: 195
LILYGO®TTGO T-Watch-K210 AIOT AI Face Recognition Programmable Development Hardware Built-in OV2640 Lens
2020 - 04 - 24
点击次数: 133
LILYGO® annual US $ 1 free shipping event, in order to thank the new and old customers for their support, our main US $ 1 event product in 2020 is LILYGO® TTGO T-OI, the duration of the even...
  • 资质认证


  • 支付安全


  • 专人服务


  • 售后无忧


The unified hotline:
0086 13928411439

  • Aliexpress

  • ebay

  • "Sweeping" attention to us, more activities, surprise waiting for you
    E-mail:       Wechat: 13928411439       QQ :3004603945

    Copyright ©2005 - 2013 Shenzhen Xin Yuan Electronic Technology Co., Ltd.