Skip to content

Getting Started with Android Firmata and NodeMcu Board

Xujiaao edited this page May 31, 2018 · 18 revisions

Step 1: Setup Arduino IDE

Starting with 1.6.4, Arduino IDE allows installation of third-party platform packages using Boards Manager.

  • Install the current upstream Arduino IDE at the 1.8 level or later. The current version is at the Arduino website.

  • Start Arduino and open Preferences window.

  • Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.

  • Open Boards Manager from Tools > Board menu and install esp8266 platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).

See https://github.com/esp8266/Arduino for more information.

Step 2: Install Usb Driver (for Mac OSX users)

  • Download and install the SiLabs serial driver for the chip.

  • Plug in your NodeMcu board via USB, and make sure the serial port is available:

    # Make sure the '/dev/cu.SLAB_USBtoUART' exists
    $ ls -lah /dev/cu*
    > ...
    > crw-rw-rw-  1 root  wheel   38,  11  5 31 23:51 /dev/cu.SLAB_USBtoUART

If it dose NOT work, change another cable may help... 😅

See https://github.com/nodemcu/nodemcu-devkit/wiki/Getting-Started-on-OSX for more information.

Step 3: Setup NodeMcu

  • Open the Arduino IDE, select: File > Examples > Firmata > StandardFirmataWiFi

  • Open Tools > Board, select: NodeMCU 1.0 (ESP-12E Module)

  • Open Tools > Port, select the corresponding port

  • Hold the flash button on the NodeMCU board and Click the "Upload" button.

If the upload was successful, the board is now prepared as an Access Point.

Step 4: Connect the NodeMcu Access Point

On your Android Device, open: Settings > WLAN, you will find an Access Point with a name like ESP_XXXX, connect it.

By default the network is open, and the IP Address is 192.168.4.1.

Step 5: Update your Android Application

Now you can change the Transport URI to tcp://192.168.4.1.

connectBoard("tcp://192.168.4.1".toTransport(), {
    ...
})
Clone this wiki locally