Skip to content

Commit 40f84d3

Browse files
committed
Move REPL stuff and add other terminal emulators
1 parent 6713b70 commit 40f84d3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

source/_posts/2016-07-21-esp8266-and-micropython-part1.markdown

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
layout: post
33
title: "ESP8266 and MicroPython - Part 1"
44
description: "Using MicroPython on ESP8266 based devices and Home Assistant."
5-
date: 2016-07-21 06:00:00 +0200
6-
date_formatted: "July 21, 2016"
5+
date: 2016-07-27 06:00:00 +0200
6+
date_formatted: "July 27, 2016"
77
author: Fabian Affolter
88
comments: true
99
categories: How-To
@@ -13,7 +13,7 @@ og_image: /images/blog/2016-07-micropython/social.png
1313
<img src='/images/blog/2016-07-micropython/micropython.png' style='clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;' width='200' />
1414
The first release of Micropython for ESP8266 was delivered a couple of weeks ago. The [documentation](http://docs.micropython.org/en/latest/esp8266/esp8266_contents.html) covers a lot of ground. This post is providing only a little summary which should get you started.
1515

16-
If you don't participated in the KickStarter campaign only the source code was available. This meant that you needed to build the firmware on your own. As of now the [pre-built firmware](https://micropython.org/download/#esp8266) is available for the public.
16+
Until a couple of weeks ago, the pre-built MicroPython binary for the ESP8266 was only available to backers. This has changed now and it is available to the public for [download](https://micropython.org/download/#esp8266).
1717

1818
<!--more-->
1919

@@ -39,7 +39,9 @@ Wrote 540672 bytes at 0x0 in 13.1 seconds (330.8 kbit/s)...
3939
Leaving...
4040
```
4141

42-
Now reset the device. You should then be able to use a terminal program like `minicom` or `picocom` to connect and get the [REPL (Read Evaluate Print Loop)](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#getting-a-micropython-repl-prompt) prompt.
42+
Now reset the device. You should then be able to use the [REPL (Read Evaluate Print Loop)](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#getting-a-micropython-repl-prompt). On Linux there is `minicom` or `picocom`, on a Mac you can use `screen` (eg. `screen /dev/tty.SLAB_USBtoUART 115200`), and on Windows there is Putty to open a serial connection and get the REPL prompt.
43+
44+
The [WebREPL](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html#webrepl-a-prompt-over-wifi) work over a wireless connection and allows easy access to a prompt in your browser. An instance of the WebREPL client is hosted at [http://micropython.org/webrepl](http://micropython.org/webrepl). Alternatively, you can create a local clone of their [GitHub repository](https://github.com/micropython/webrepl). This is neccessary if your want to use the command-line tool `webrepl_cli.py` which is mentionend later in this post.
4345

4446
```bash
4547
$ sudo minicom -D /dev/ttyUSB0
@@ -76,8 +78,6 @@ Various ESP8266 development board are shipped with an onboard photocell or a lig
7678
>>> brightness.read()
7779
```
7880

79-
The REPL can also be accessed through with a browser. For your convinience, is an instance of the WebREPL client hosted at [http://micropython.org/webrepl](http://micropython.org/webrepl). Alternatively, you can create a local clone of their [GitHub repository](https://github.com/micropython/webrepl). This is neccessary if your want to use the command-line tool `webrepl_cli.py`.
80-
8181
Make sure that you are familiar with REPL and WebREPL because this will be needed soon. Keep in mind the password for the WebREPL access.
8282

8383
Read the [instructions](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html) about how to setup your wireless connection. Basically you need to upload a `boot.py` file to the microcontroller and this file is taking care of the connection setup. Below you find a sample which is more or less the same as shown in the [documentation](http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/network_basics.html#configuration-of-the-wifi).
@@ -102,7 +102,7 @@ def do_connect():
102102
print('Network configuration:', sta_if.ifconfig())
103103
```
104104

105-
Upload this file:
105+
Upload this file with `webrepl_cli.py` or the WebREPL:
106106

107107
```bash
108108
$ python webrepl_cli.py boot.py 192.168.4.1:/boot.py

0 commit comments

Comments
 (0)