Installing on the MacOS requires following software
Step 1 : Installing XCode (This is required on the MacOs for future installation in the following setups.)
MacOS Package Install
Step 2 : Download and install the Package MacPorts
Step 2 : Download MacPorts and run the following commands in the terminal.
If everything works fine then run the command below to confirm macports has been installed on MacOS.
This will output :
cd MacPorts-2.6.1/ ./configure make sudo make install
Installing Virtual COM Port (VCP)
The CP210x USB to UART Bridge Virtual COM Port (VCP) drivers are required for device operation as a Virtual COM Port to facilitate host communication with CP210x products. These devices can also interface to a host using the direct access driver.
Step 3 : Installing CP210x VCP Driver
Step 4 : Open the downloaded folder and install the driver
Step 5 : If you have got the following output, GREAT! your driver is installed.
Step 6 : Drag the driver app (displayed in the above pic) to the application folder.
Step 7 : Now Open the terminal and search for SLAB_USBtoUART using the following command.
If you find the above file then go to next step, if not try reinstalling the driver and PLUG IN THE NodeMCU then try again.
Voila ! Now you are ready to use the NodeMCU
Getting a MicroPython REPL prompt
REPL stands for Read Evaluate Print Loop, and is the name given to the interactive MicroPython prompt that you can access on the ESP8266. Using the REPL is by far the easiest way to test out your code and run commands.
There are two ways to access the REPL: either via a wired connection through the UART serial port, or via WiFi.
REPL over the serial port
To access the prompt over USB-serial you need to use a terminal emulator program.
On Mac you can use the built-in screen program or alternatively you can also install picocom
screen /dev/tty.SLAB_USBtoUART -b115200
picocom /dev/tty.SLAB_USBtoUART -b115200
Once you have made the connection over the serial port you can test if it is working by hitting enter a few times. You should see the Python REPL prompt, indicated by
Now you are ready to play with the NodeMCU
Testing the NodeMCU
In the REPL run these commands :
print("Hey, I am ESP8266")
Quitting the REPL
Ctrl-A + Ctrl-Q
Frequently Asked Questions
- I used screen command, how to quit it?
Case : 1
If you are on the screen and want to quit
Use this command :
ctrl-A + ctrl-\
It will then ask you to confirm :
Case : 2
If you have quit the terminal and now unable to run picocom
Use the command in the terminal
lsof | grep screen
now again repeat the process in the case: 1
screen -x 26778 # 26778 is the Process Id [screen is terminating]
Please do let us know if we are missing any topic or you want us to elaborate any topic, comment below and subscribe to be updated.