Communication with an ESP8266 (NodeMCU) through Websockets

This example shows how MyViz, running on your computer, can communicate with an ESP8266 (NodeMCU) through Websockets.

The files can be downloaded for the following systems:

In order to run this example, you need to follow these steps (provided that MyViz is already installed):

  • Download the files somewhere on your computer
  • Connect your NodeMCU to your programmer
  • Upload on this module the sketch “Tutorial_Websocket_2.ino”, located in the “ESP8266_NodeMCU” folder of the archive
  • Connect your computer to the Wifi Access Point created by the NodeMCU. The credentials are:
    • SSID: MyViz
    • Password: myvizesp8266
  • Run MyViz. It opens with an empty window:

myviz_1

  • Click on “Load Dashboard” and open the file “Tutorial_Websocket_2.json”, located in the “Dashboard” folder of the archive. You can now play with this interface:

  • You can:
    • click on the LED switch to switch on or off the LED of your NodeMCU
    • connect the analog input A0 to any sensor to see its values plotted in real time
    • modifiy the multiplication factor for this input
    • move the slider, to see the plot of the value sent back by the board
  • To edit the dashboard, click on the icon on the top-middle of the window. Then you can modify any widget and learn how MyViz works: