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:
- Windows: https://github.com/3sigma/MyViz_Tutorials/tree/master/Tutorials_Windows/Websocket_2
- Linux: https://github.com/3sigma/MyViz_Tutorials/tree/master/Tutorials_Linux/Websocket_2
- Mac OS X: https://github.com/3sigma/MyViz_Tutorials/tree/master/Tutorials_OSX/Websocket_2
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
- Download and install the following Arduino libraries, in order to use Json format and Websockets in the sketch you will download on your NodeMCU:
- 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:
- 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: