Shenzhen Xin Yuan Electronic Technology Co., Ltd.
 
手机官网
 
关注我们微信公众号
购物车图片 购物车 ( )
找服务 找新闻
The recommended reading
Hot label / Products

Arduino ESP8266 in the Visual Studio IDE

Author:
Time: 2017-08-02
Clicks: 124

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

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 (192.168.2.12) 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
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

 

 

Share to:
Prev:NoneNext:None
Related recommendations
2019 - 06 - 13
点击次数: 1
The emergence of T-WATCH brings us much fun, we want to share with everyone and hope it can be used ...
2019 - 06 - 12
点击次数: 5
T-Watch, a product that is easy to be carried around and programmed anywhere, will be able to achieve what you think. And let us pay for your creativity!Thank you for your support and look forward to ...
2019 - 05 - 31
点击次数: 19
Passing the fun of programming and helping children become the creators of the digital age' This is the ideology of the core yuan and the inevitable development direction of future education!With the ...
2019 - 05 - 30
点击次数: 14
TTGO VGA32 V1.1 Controller PS/2 Mouse And Keyboard Controller Graphics Library Game Engine And ANSI/VT Terminal For The ESP32VGA output requires a digital to analog converter (DAC): it can be done by ...
  • 资质认证

    服务商100%实名审核认证

  • 支付安全

    明码标价支付及信息安全

  • 专人服务

    服务全程进行信息化监控

  • 售后无忧

    服务出问题客服经理全程跟进

The unified hotline:
0086 13928411439
skype:seatechnolgy
@outlook.com


邮编:330520
  • Alibaba

  • ebay

  • "Sweeping" attention to us, more activities, surprise waiting for you
    E-mail: lily@lilygo.cc       Wechat: 13928411439       QQ :3004603945       Facebook:lily@lilygo.cc
     

    Copyright ©2005 - 2013 Shenzhen Xin Yuan Electronic Technology Co., Ltd.
    犀牛云提供企业云服务