Advertisement
lazar00

esp8266 essential commands adn tools

May 18th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. pip install esptool
  2. //OR
  3. sudo pip install esptool
  4.  
  5. //clear the chip
  6. esptool.py --port /dev/ttyUSB erase_flash
  7.  
  8. //upload the micropython
  9. esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 firmware.bin
  10.  
  11. //access to the board
  12. //if screen cannot be installed use picocom
  13. screen /dev/tty.board_name 115200
  14.  
  15. //use ampy to push/pull the files from board
  16. /*ampy commands
  17.  
  18. ampy - Adafruit MicroPython Tool
  19.  
  20. Ampy is a tool to control MicroPython boards over a serial connection.
  21. Using ampy you can manipulate files on the board's internal filesystem and
  22. even run scripts.
  23.  
  24. Options:
  25. -p, --port PORT Name of serial port for connected board. [required]
  26. -b, --baud BAUD Baud rate for the serial connection. (default 115200)
  27. --help Show this message and exit.
  28.  
  29. Commands:
  30. get Retrieve a file from the board.
  31. ls List contents of a directory on the board.
  32. put Put a file on the board.
  33. rm Remove a file from the board.
  34. run Run a script and print its output.
  35.  
  36.  
  37. ESP8266 - MicroPython tutorial
  38.  
  39. #to flash the board --- KEEP IN MIND THAT TX AND RX PINS ARE DISCONNECTED!!!
  40. sudo esptool.py --port /dev/ttyUSB0 erase_flash
  41.  
  42. #upload/flash python to the board --- some boards will require this flag in order to flash the board --flash_mode=dio
  43. sudo esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_mode=dio --flash_size=detect 0 ~/Downloads/esp8266-20171101-v1.9.3.bin
  44.  
  45.  
  46. #to put script to the board use this command
  47. #you can use PUT, GET...
  48. sudo ampy --port /dev/ttyUSB0 put main.py
  49.  
  50. # access to the baord python shell
  51.  
  52. picocom /dev/ttyUSB0 -b115200
  53. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement