Programming ESP8266 Boards with a Smartphone

In recent days, I wrote about low cost MCU boards such as the $2 BluePill, and the One Dollar Board project, but several people commented that while the board themselves are very cheap, it might still be a problem in some developing countries, where access to computers cannot be taken for granted. So person suggested that such initiative would work better in some countries if programming was possible via a smartphone instead. Is that true?

Computer_vs_Smartphone_OwnershipAccording to a 2014/2015 study by Pew Research Center, there is some truth to it, but it varies greatly between countries. For example,  55% of Brazilian adults own a computer at home, while only 24% own a smartphone, but in Kenya only 8% own a computer at home, while 15% own a smartphone. Some devices in the “cellphones but not smartphones” might be feature phones with WiFi and a web browser.

Anyway ideally a low cost board should support both computer and smartphones or cellphone with a web browser. 陳亮 has provided instructions to program ESP8266 WiFi boards with Lua using the web browser of his smartphone, for people who may want to program on the go, but this may also be useful for educators in developing countries.

ESP8266_Smartphone_ProgrammingSome of the steps (installing firmware) require a computer, but this could be either done at the factory or using a single computer in the classroom, with Lua programming done on the students smartphones. A summary of the steps can be found below:

  1. Build and download NodeMCU firmware with your required modules @ http://nodemcu-build.com/
  2. Flash NodeMCU firmware using a computer via a USB to TTL board
  3. Download the web server code based on Marcos Kirsch’s nodemcu-httpserver with Lua editor on Github.
  4. Configure the firmware with serial port and WiFi details
  5. Run NodeMCU uploader to load nodemcu-httpserver to the board
  6. Connect the board acting as an access point, and type the board’s IP in a web browser to start coding on your smartphone or other device with a web browser.

Hello_World_Lua_Editor

This solution would also work in locales where electricity is unreliable, as ESP8266 could run on batteries, and the phone already has its own.

Support CNX Software - Donate via PayPal or become a Patron on Patreon

6
Leave a Reply

avatar
6 Comment threads
0 Thread replies
1 Followers
 
Most reacted comment
Hottest comment thread
5 Comment authors
DonaldDroneArnabzoobabTheguyuk Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Theguyuk
Guest
Theguyuk

Very informative and interesting. ?

zoobab
Guest

You could also use USB serial terminal, like I did for displaying the console of an esp using USBTerminal (which has built-in support for ch340g usb-serial chip):

https://twitter.com/zoobab/status/707264483849273347

Arnab
Guest

It will be more interesting to flash the NodeMCU firmware with a rooted Smartphone which supports USB OTG.

CP2102 based USB to UART adapters are quite stable and cheap ~2$, we just need to compile the proper kernel module cp210x.ko , a bare bone serial console app like busybox microcom is enough.

@zoobab , does this USBTerminal app requires a rooted smartphone ? How the CH340G chips are supported ?
I can’t test it myself, as I don’t have one of those “Smart” phones.

zoobab
Guest

@Arnab
No, the driver is within the app, and does not load any kernel module. It supports only FTDI+CH340G+CDC for the moment, cp210x are not supported. The new version also supports STM32 VCP, which might be helpful for those chips.

Drone
Guest
Drone

Those statistics for computers in the home are never to be trusted. Governments are most often the source of the information, and Governments are at-best incompetent, and at-worst outright liars (it’s called propaganda). The cellphone data is better. That’s mostly because the sources are companies (cellular operators or carriers), which are usually publicly held and regularly report to their shareholders.

Donald
Guest
Donald

Never heard of a “global” sample including only Asian/African/American countries. This guy either has a fetish for the letter A or has to explain his hateboner for Spain, France, Great Britain, Germany, Italy, Sweden, etc, etc, etc.