Arduino ESP8266 in the Visual Studio IDE

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 2017 - 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

 

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.

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 ESP8266.com 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.

 

OTA without requiring auto-discovery (more experienced users + pro/full version)

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 (192.168.2.12) that has not been discovered via the Bonjour Service.

 

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
ArduinoOTA.setPort(APORT);

// set hostname
ArduinoOTA.setHostname(hostname.c_str());

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

// start OTA Server
ArduinoOTA.begin();
}

 

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
  network.password=123
  network.auth_upload=yes
  network.port=8266

Board.txt password not required example:-

 # local project board.txt overrides
  network.port=8266

 

Other Pages