Mercurial > espworkshop
annotate setup.rst @ 33:61d01865fc86 default tip
Update setup instructions.
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Sat, 25 Jun 2016 12:47:39 +0200 |
| parents | 379eeec3777a |
| children |
| rev | line source |
|---|---|
| 6 | 1 Setup |
| 2 ***** | |
| 3 | |
| 4 Prerequisites | |
| 5 ============= | |
| 6 | |
| 7 To participate in the workshop, you will need the following: | |
| 8 | |
| 9 * A laptop with Linux, Mac OS or Windows and at least one free USB port. | |
| 10 * If it's Windows or Mac OS, make sure to install `drivers`_ for the CP2102 UBS2TTL chip. MacOS El Capitan requires `disabling kext signing`_ to install it. | |
| 11 * A micro-USB cable with data lines that fits your USB port. | |
| 12 * You will need a terminal application installed. For Linux and Mac you can | |
|
33
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
13 use ``screen``, which is installed by default. For Windows we recommend `PuTTy`_ or `CoolTerm`_. |
| 6 | 14 * Please note that the workshop will be in English. |
| 15 | |
| 16 .. _drivers: http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx | |
| 17 .. _disabling kext signing: http://farazmemon.com/2016/02/07/flashing-latest-firmware-on-nodemcu-devkit-v0-9-osx-el-capitan/ | |
| 18 .. _PuTTy: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html | |
|
33
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
19 .. _CoolTerm: http://freeware.the-meiers.org/ |
| 6 | 20 |
| 21 In addition, at the workshop, you will receive: | |
| 22 * "NodeMCU AMICA" development board with ESP8266 on it, | |
| 23 * Red LED, | |
| 24 * 100Ω resistor, | |
| 25 * SG90 microservo, | |
| 26 * Female-female and Male-female dupont cables, | |
| 27 * Piezoelectric speaker. | |
| 28 | |
| 29 You will take all that home with you. | |
| 30 | |
|
33
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
31 The firmware that is flashed on the boards is also available at https://bitbucket.org/thesheep/espworkshop/downloads/firmware-combined.bin |
|
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
32 |
| 6 | 33 There will be also some additional hardware available for experimenting, |
| 34 which you won't take home. | |
| 35 | |
| 36 | |
| 37 Development Board | |
| 38 ================= | |
| 39 | |
| 40 The board we are using is called "NodeMCU AMICA" and has an ESP8266 module | |
| 41 on it, which we will be programming. It comes with the latest version of | |
| 42 Micropython already setup on it, together with all the drivers we are going | |
| 43 to use. | |
| 44 | |
| 45 .. note:: | |
| 46 The D0, D1, D2, ... numbers printed on the board are different from what | |
| 47 Micropython uses -- because originally those boards were made for a | |
| 48 different software. Make sure to refer to the image below to determine | |
| 49 which pins are which. | |
| 50 | |
| 51 .. image:: ./images/board.png | |
| 52 :width: 512px | |
| 53 | |
| 54 | |
| 55 On top it has a micro-USB socket, for connecting to the computer. Next to it | |
| 56 are two buttons, one for reset and one for flashing. Then on both sides of the | |
| 57 board are two rows of pins, to which we will be connecting cables. | |
| 58 | |
| 59 The symbols meaning is as follows: | |
| 60 | |
| 61 * ``3v3`` - this is a fancy way to write 3.3V, which is the voltage that the | |
| 62 board runs on internally. You can think about this pin like the plus side | |
| 63 of a battery. There are several pins like this, they are all connected | |
| 64 inside. | |
| 65 * ``gnd`` - this is the ground. Think about it like the minus side of the | |
| 66 battery. They are also all connected. | |
| 67 * ``gpioXX`` - "gpio" stands for "general purpose input output". Those are | |
| 68 the pins we will be using for sending and receiving signals to and from | |
| 69 various devices that we will connect to them. They can act as output -- | |
| 70 pretty much like a switch that you can connect to plus or to minus with | |
| 71 your program. Or they can act as input, telling your program whether they | |
| 72 are connected to plus or minus. | |
| 73 * ``a0`` - this is the analog pin. It can measure the voltage that is applied | |
| 74 to it, but it can only handle up to 1V. | |
| 75 * ``vin`` - this pin is connected with the 5V from your computer. You can | |
| 76 also use it to power your board with a battery when it's not connected to | |
| 77 the computer. The voltage applied here will be internally converted to the | |
| 78 3.3V that the board needs. | |
| 79 * ``rst`` - this is a reset button (and a corresponding pin, to which you can | |
| 80 connect external button). | |
| 81 * ``flash`` - hold down this button while resetting to bring the board into | |
| 82 programming mode (also known as flashing mode). | |
| 83 | |
| 84 The other pins are used internally by the board, and we will not be connecting | |
| 85 anything to them. | |
| 86 | |
| 87 | |
| 88 Connecting | |
| 89 ========== | |
| 90 | |
| 91 The board you got should already have Micropython with all the needed libraries | |
| 92 flashed on it. In order to access its console, you will need to connect it to | |
| 93 your computer with the micro-USB cable, and access the serial interface that | |
| 94 appears with a terminal program. | |
| 95 | |
| 96 | |
| 97 Linux and MacOS | |
| 98 --------------- | |
| 99 | |
|
33
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
100 Simply open a terminal and run the following commands. On Linux:: |
| 6 | 101 |
| 102 screen /dev/ttyUSB0 115200 | |
| 103 | |
|
33
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
104 On MacOS:: |
|
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
105 |
|
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
106 screen /dev/tty.SLAB_USBtoUART 115200 |
|
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
107 |
|
7
53ba8183ea30
Add beeper example
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
6
diff
changeset
|
108 To exit screen, press ctrl+A and then capital K. |
|
53ba8183ea30
Add beeper example
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
6
diff
changeset
|
109 |
| 6 | 110 |
| 111 Windows | |
|
22
379eeec3777a
Remove accidentally pasted code
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
21
diff
changeset
|
112 ------- |
| 6 | 113 |
|
33
61d01865fc86
Update setup instructions.
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
22
diff
changeset
|
114 For the serial interface to appear in your system, you will need to install the drivers_ for CP2102. Once you have that, you can use either Hyper Terminal, PuTTy or CoolTerm to connect to it, following this guide_. |
| 6 | 115 |
| 116 The parameters for the connection are: 115200 baud rate, 8 data bits, no parity, 1 stop bit, no flow control. | |
| 117 | |
| 118 | |
| 119 Hello world! | |
| 120 ------------ | |
| 121 | |
| 122 Once you are connected, press "enter" and you should see the Micropython prompt, that looks like this:: | |
| 123 | |
| 124 >>> | |
| 125 | |
| 126 It's traditional to start with a "Hello world!" program, so type this and press "enter":: | |
| 127 | |
| 128 print("Hello world!") | |
| 129 | |
| 130 If you see "Hello world!" displayed in the next line, then congratulations, you got it working. | |
| 131 | |
| 132 .. _guide: https://techawarey.wordpress.com/tag/serial-port-communication-in-windows-7-using-hyper-terminal-and-putty/ | |
|
21
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
133 |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
134 |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
135 Official Documentation and Support |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
136 ================================== |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
137 |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
138 The official documentation for this port of Micropython is available at |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
139 http://micropython.org/resources/docs/en/latest/esp8266/. There is a also a |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
140 forum on which you can ask questions and get help, located at |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
141 http://forum.micropython.org/. Finally, there are ``#esp8266`` and |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
142 ``#micropython`` channels on http://freenode.net IRC network, where people chat |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
143 in real time. Remember that all people there are just users like you, but |
|
ee3b3aa250c8
Add links to official documentation and support
Radomir Dopieralski <sheep-devel@sheep.art.pl>
parents:
7
diff
changeset
|
144 possibly more experienced, and not employees who get paid to help you. |
