I am following the instruction from this DIY tutorial to set up the firmware for my dust sensor on Arduino board (NodeMCU): https://luftdaten.info/en/construction-manual/#feinstaubsensor-konfiguration

One line of code has me stumped to import the firmware onto the Arduino board:

Linux: ~ / .arduino15 / packages / esp8266 / tools / esptool / 0.4.9 / esptool -vv -cd nodemcu -cb 57600 -ca 0x00000 -cp /dev/cu.wchusbserial1410 -cf /path/to/firmware/file (the port behind, -cp ‘ may need to be adjusted)



  • Ubuntu Bionic Beavers 18.04
  • Python 3.6.8
  • pyserial 2.21.0
  • ESP8266 NodeMCU (Arduino UNO)

Desired Behaviour I'm trying to import Luftdaten’s designated firmware onto the Arduino Board.

Current Behavior The following line of code provided on Luftdaten’s website does not work:

~ / .arduino15 / packages / esp8266 / tools / esptool / 0.4.9 / esptool -vv -cd nodemcu -cb 57600 -ca 0x00000 -cp /dev/cu.wchusbserial1410 -cf /path/to/firmware/file (the port behind, -cp ‘ may need to be adjusted)

Error Message

esptool: error: argument --chip/-c: invalid choice: 'd' (choose from 'auto', 'esp8266', 'esp32')


Step 1: cd into the hidden file directory where esptool is located

cd ~/.arduino15/packages/esp8266/tools/esptool/0.4.9

Step 2: install the bootloader software (i.e. esptool)

pip install esptool

Documentation: https://github.com/espressif/esptool/blob/master/README.md

Step 3: Run the command to flash the firmware on Arduino

esptool --port /dev/ttyUSB0 write_flash 0x0000 ~/Downloads/latest_en.bin
  • Make sure to specify the correct port; open the ArduinoIDE and check Tools > Port, then Tools > Get board info to check whether the Arduino is recognized.

  • Make sure to write the correct directory path to the firmware.

  • In the template provided, "nodemcu" corresponds to "esp8266", and can be left blank since esptool can determine it automatically.

IF THE FOLLOWING ERROR ARISES: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' then change permission privileges with sudo chmod 666 /dev/ttyUSB0

  • 1
    n other words, what's happening here? try running esptool -h - this will output all the information you could possibly need – Jaromanda X Feb 20 '19 at 22:33
  • I'm well aware on how to call the help option, thank you. – HP-Nunes Feb 20 '19 at 22:38
  • 2
    well then how can you not understand what that command is doing? - verbosely, using nodemcu reset method, at the (OMFG why so low) baud rate 57600, upload to address 0x0000, using device /dev/cu.wchusbserial1410 upload the image /path/to/firmware/file – Jaromanda X Feb 20 '19 at 22:49
  • I wasn't able to look up the commands running esptool -h (-vv, -ca, -cp etc.); maybe I am missing something but I didn't see anything listed when I called -h. – HP-Nunes Feb 21 '19 at 1:07
  • Your explanation was very useful to read through the rest of the code. Thank you. – HP-Nunes Feb 21 '19 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.