<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://iot.ctreber.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ctreber</id>
	<title>IoT with AME - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://iot.ctreber.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ctreber"/>
	<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Special:Contributions/Ctreber"/>
	<updated>2026-04-30T06:00:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Status_and_Logging&amp;diff=349</id>
		<title>AME Status and Logging</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Status_and_Logging&amp;diff=349"/>
		<updated>2020-12-28T15:06:17Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Status Information and Logging=&lt;br /&gt;
&lt;br /&gt;
Since a whole bunch of components are working together things can get tough when there is a problem. The AME stack provides logging via I2C and status information via a RGB-LED.&lt;br /&gt;
&lt;br /&gt;
==Logging with &amp;quot;Logsury&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
Logging can be switched off in production&lt;br /&gt;
&lt;br /&gt;
* at build time &lt;br /&gt;
* at run time via switching an I/O pin on or off on Arduino reset&lt;br /&gt;
&lt;br /&gt;
If logging is switched off at build time, the logging code completely disappears from the program (accomplished with C++ macros). Logging library and statements do not consume any space or processing time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Event Visualization with the &amp;quot;Event Facility&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
The AME Stack issues events that may be of interest to a user:&lt;br /&gt;
&lt;br /&gt;
* Regarding the WLAN connection:&lt;br /&gt;
** Note to self: Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* Regarding the TCP connection:&lt;br /&gt;
** Note to self: Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* When the MQTT connection is in place&lt;br /&gt;
** The LED twitches every second, indicating the Arduino is running and not stuck in an endless loop&lt;br /&gt;
** Every time a message is sent, it flashes in blue, indicating the attempt is being made&lt;br /&gt;
** Every time a message is received, it flashes in ???, indicating a message has been received (the broker did sent it our way)&lt;br /&gt;
** Every time a ping response is received, it changes color (either green or magenta), indicating pings are being sent &#039;&#039;and&#039;&#039; received (the broker replied)&lt;br /&gt;
&lt;br /&gt;
These events get handled by an Event Facility that comes in three versions:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Do Nothing&amp;quot; (it does what you think)&lt;br /&gt;
* Use a programmable RGB LED (using colors and flashing)&lt;br /&gt;
* Use an LCD screen (symbols in the top right corner)&lt;br /&gt;
&lt;br /&gt;
The programmable status LED consumes only one Arduino pin while it is able to provide quite a bit of useful information. The library to &amp;quot;talk to it&amp;quot; is very small.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=348</id>
		<title>The AME Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=348"/>
		<updated>2020-12-28T14:52:51Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=The AME Stack=&lt;br /&gt;
&lt;br /&gt;
AME =&lt;br /&gt;
&lt;br /&gt;
* Arduino (for brains)&lt;br /&gt;
* MQTT (for communicating with devices)&lt;br /&gt;
* ESP8266 (for TCP over WLAN)&lt;br /&gt;
&lt;br /&gt;
Contens&lt;br /&gt;
&lt;br /&gt;
* [[AME_Goals|Design Goals]]&lt;br /&gt;
* [[AME_Software|Software]]&lt;br /&gt;
* [[AME_Hardware|Hardware]]&lt;br /&gt;
* [[AME_Status_and_Logging|Status Information and Logging]]&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=My_IoT_projects&amp;diff=347</id>
		<title>My IoT projects</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=My_IoT_projects&amp;diff=347"/>
		<updated>2019-02-04T16:24:55Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* My IoT Projects - What I Built Over Time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=My IoT Projects - What I Built Over Time=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;[[File:20170521T124850.jpg|left|thumb|200px|AC.clock]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;[[File:20170128T201427_scaled.jpg|left|thumb|300px|AC.ticker]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;[[File:20180611T222225_corrected.JPG|left|thumb|200px|AC.home]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;[[File:20170802T120601.jpg|left|thumb|300px|AC.gadget-7Segment]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;[[File:20170128T214017_scaled.jpg|left|thumb|300px|AC.programmer]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [[AC.balcony]] - Measures temperature, humidity, soil moisture, brightnessy and atmospheric pressure. Controls balcony plants watering system supplied from container.&lt;br /&gt;
* [[AC.camper]] - Measures temperature and humidity in the camper van parked outside in the yard. Sends alarms from two motion sensors. Will be upgraded to relaying information from the solar charger obtained via ModBus. Connected to the Internet via mobile internet WLAN router.&lt;br /&gt;
* [[AC.clock]] - RGB LED ring showing time as lit pixels, adapted to ambient brightness. Gets time updates via MQTT.&lt;br /&gt;
* [[AC.gadget-7Segment]] - Counting up with 7 segment displays (6 digits) salvaged from a long lost calculator. IO multiplexing with shift registers.&lt;br /&gt;
* [[AC.gadget-15Segment]] - Showing a scrolling text on 15 segment displays (5 digits) I got from a friend IN THE 80s (gasp!). IO multiplexing with three 8 bit shift registers.&lt;br /&gt;
* [[AC.gardenControl]] - Measures inside temperature, inside humidity, outside temperature, outside humidity, and soil moisture at our garden plot about 2km from home. Controls watering system supplied from ground water pump. Connected via mobile internet WLAN router.&lt;br /&gt;
* [[AC.gardenPower]] - Controls outside and inside lighting of the hut on our garden plot. Uses motion sensors to control outside lighting and send alarms.&lt;br /&gt;
* [[AC.home]] - A wall-mounted &amp;quot;terminal&amp;quot; with touch screen LCD to show outside temperature etc.&lt;br /&gt;
* AC.home2 - A 4 x 20 character LCD display in a box (desktop, shelf) displaying sets of data such as temperature, humidity for balcony, garden, camper van.&lt;br /&gt;
* [[AC.power]] - Switches up to 8 power outlets on and off. I am using a number of these throughout to house to, in example, control lighting.&lt;br /&gt;
* [[AC.programmer]] - An Arduino ISP/ logger with a LCD Screen&lt;br /&gt;
* AC.rgui - A &amp;quot;remote GUI&amp;quot; (LCD) that can receive pixel data in rectangular portions, in example to serve as WLAN-fed picture frames&lt;br /&gt;
* [[AC.signal]] - Controls a full size train signal replica (showing symbols &amp;quot;off&amp;quot;, &amp;quot;full ahead&amp;quot;, &amp;quot;slow ahead&amp;quot;, &amp;quot;stop&amp;quot;)&lt;br /&gt;
* [[AC.ticker]] - A LED ticker tape. Text and speed can be controlled remotely.&lt;br /&gt;
&lt;br /&gt;
Plans:&lt;br /&gt;
&lt;br /&gt;
* AC.balcony 2.0 - Wind sensor (direction, strength) and a rain gauge&lt;br /&gt;
* AC.kitchen - Report on stove plate and fridge temperature&lt;br /&gt;
* AC.power - Add temperature reporting to control the temperature in the camper van and garden plot hut, using an electric heater&lt;br /&gt;
* AC.train - Controls my G-gauge garden train. Instead of supplying power and DCC control through the rails (which I found to be very flaky due to oxidation of the rails outside), the trains get powered by rechargeable batteries and controlled through MQTT via WLAN. An older prototype based on a 433GHz radio connection and a proprietary protocol is already working.&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AC.programmer&amp;diff=258</id>
		<title>AC.programmer</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AC.programmer&amp;diff=258"/>
		<updated>2018-07-07T22:39:30Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Tools]], [[My_IoT_projects|My IoT Projects]]&lt;br /&gt;
&lt;br /&gt;
=AC.programmer=&lt;br /&gt;
&lt;br /&gt;
AC.programmer is an [https://www.arduino.cc/en/Tutorial/ArduinoISP Arduino as an ISP] (In System Programmer) with some added bells and whistles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:20170128T214017 scaled.jpg|left|thumb|800px|Version 1 - Just a plain ISP programmer]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ISP Programming==&lt;br /&gt;
&lt;br /&gt;
* does not use the serial interface of the Arduino and &lt;br /&gt;
* does not require a pre-installed boat loader&lt;br /&gt;
&lt;br /&gt;
Instead, the programmer uses the SPI interface to communicate which the target that has been switched into serial programming mode on reset. The work normally performed by the boot loader is offloaded to the programmer.&lt;br /&gt;
&lt;br /&gt;
Why would you do that, adding an ISP programmer to your setup? &lt;br /&gt;
&lt;br /&gt;
# It frees up the serial interface for communications with the ESP8266 WLAN chip. This was the main reason for me to use an ISP. SoftwareSerial is slow, and even at slow speeds it means asking for trouble (lost characters, in example). Seriously, SoftwareSerial is unusable for this purpose.&lt;br /&gt;
# It frees up the 2kB of flash memory that the boot loader occupies, all yours to use. This is the only way to get to access to the full 32kB of flash memory the smaller Arduinos have to offer. Here (todo: provide link) is an entry for boards.txt of the Arduino IDE that reflects the gain in memory.&lt;br /&gt;
&lt;br /&gt;
There is one disadvantage, though: Without having the serial interface connected to your computer, you loose that option for logging. I developed a logging facility called &amp;quot;Logsury&amp;quot; that, amongst other channels, supports logging via I2C. That does NOT block the I2C interface as many addressable devices may be connected. AC.programmer forwards log information received via I2C to its own serial interface (connected to the computer), and/ or displays it on its large LCD display, or logs it to a file store on a SD Card (or any combination thereof).&lt;br /&gt;
&lt;br /&gt;
==Building AC.programmer==&lt;br /&gt;
&lt;br /&gt;
LCDs for Arduino often use up pretty much all port pins. Plugging the display directly into an Arduino Uno is convenient but makes all the decisions for you (like, using up the SPI connections to communicate with the SD card often found on the display). &lt;br /&gt;
&lt;br /&gt;
Plus, not all connections are needed. If you have only one LCD, &amp;quot;chip select&amp;quot; can simply be tied to 5V. If you don&#039;t need to read from display RAM, you don&#039;t need the &amp;quot;read mode&amp;quot; pin. What you really need is pins for &amp;quot;command/data&amp;quot;, &amp;quot;write mode&amp;quot;, and &amp;quot;reset&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
And, of course, 8 data pins - unless you use a shift register. This is quite a bit slower (by a factor of about 4), but it saves you 6 port pins as you only need &amp;quot;data&amp;quot; and &amp;quot;clock&amp;quot; to operate the shift register. By clever placement of parts this even saves quite a bit of wiring as well. That&#039;s what I did!&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
What should the programmer offer?&lt;br /&gt;
&lt;br /&gt;
* Program Arduinos (duh) - DONE&lt;br /&gt;
* Speed. It is possible to crank up the speed between computer and programmer to 115200baud and between programmer and target to whatever the target can handle. - DONE&lt;br /&gt;
* Information on the programming process. &amp;quot;Arduino as ISP&amp;quot; uses 3 LEDs to provide status information. We have a whole LCD display. If something goes wrong, I can say exactly what. During programming, I can display what is written where (pages of flash and EEPROM memory). - DONE&lt;br /&gt;
* A way to load data into EEPROM memory, if my application needs it. Preconfigured WLAN settings for multiple SSIDs come to mind...&lt;br /&gt;
* Run on battery power. When I&#039;m &amp;quot;in the field&amp;quot;, I want to be able to update devices without connection to the grid. - DONE (can be powered via USB or externally using a built-in voltage controller)&lt;br /&gt;
* Power the target. I have fried a number of Arduinos by connecting them and the programmer to different power sources in ways that were clearly less than optimal (&amp;quot;no common ground&amp;quot; is what you want to avoid). - DONE&lt;br /&gt;
* Upload programs from SD card. Again, when I&#039;m &amp;quot;in the field&amp;quot;, I don&#039;t want to lug around a whole laptop just to program devices the memory of which could not even hold one of the colorful desktop icons.&lt;br /&gt;
* Some fun, like information on what exactly the Arduino IDE is sending to and receiving from the programmer. - DONE (though this slows down programming to a crawl)&lt;br /&gt;
&lt;br /&gt;
Sketching a plan:&lt;br /&gt;
&lt;br /&gt;
* Display log messages on the LCD - DONE&lt;br /&gt;
* Log IDE/programmer and programmer/target interaction - DONE&lt;br /&gt;
* First, get the whole thing to work (program a target) - DONE&lt;br /&gt;
* Visually display the programming progress. In example, display bars or rectangles that represent the flash and EEPROM pages and show what is being read and being written. Ditto the fuses. - DONE&lt;br /&gt;
* On request, show the signature of the target, fuse bit values - DONE&lt;br /&gt;
* Change parameters via the touch screen (like, the SPI speed)&lt;br /&gt;
&lt;br /&gt;
[[file:20170802T120644 scaled.jpg|left|thumb|800px|Version 2 - With LCD and I2C log facility]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Future Ideas==&lt;br /&gt;
&lt;br /&gt;
These are items that once on my to do list; not sure if I will follow up on them:&lt;br /&gt;
&lt;br /&gt;
* Write complete STK/SPI log to SD card (CTP-1045). Why would I do that? That out of curiosity how the Arduino IDE interacts with the programmer.&lt;br /&gt;
* Program to SD (the IDE thinks it&#039;s programming an Arduino but the programmer just record what is being done, for later replay; CTP-1047)&lt;br /&gt;
* Program from SD card (the replay mentioned above; CTP-1049)&lt;br /&gt;
* Record Logsury output on SD card (CTP-1050)&lt;br /&gt;
* Program EEPROM (in example, to configure WLAN settings; CTP-1051)&lt;br /&gt;
* Save EEPROM contents to SD card (CTP-1052)&lt;br /&gt;
* Save Flash to SD card (in example, for duplicating a configured Arduino; CTP-1053)&lt;br /&gt;
* Reset target via touch screen (in example, if the reset button can&#039;t be accessed easily; CTP-1067)&lt;br /&gt;
&lt;br /&gt;
[[Tools]], [[My_IoT_projects|My IoT Projects]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=257</id>
		<title>AME Hardware</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=257"/>
		<updated>2018-06-26T12:05:30Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* Arduino */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Hardware)=&lt;br /&gt;
&lt;br /&gt;
[[File:20170802T115833.jpg|left|thumb|600px|Voltage controller (left), Arduino (top right), and ESP8266 (bottom right)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
The Arduino is a computer on a chip - CPU, memory for programs (ROM, flashable), memory for variables (RAM, volatile), memory for data (EPROM, non-volatile, runtime-programmable), counters, timers, I/O pins, and various interfaces (shared with the I/O pins; interrupts, serial, I2C, SPI). Different models offer different amounts of assets.&lt;br /&gt;
&lt;br /&gt;
Cheap versions can be ordered from Chinese suppliers for 2.50€ a piece. I&#039;m using them all the time, and they just work fine (didn&#039;t have a single dud in 20+ Arduinos).&lt;br /&gt;
&lt;br /&gt;
The pins:&lt;br /&gt;
&lt;br /&gt;
* ACC: +5V (if you use the 5V variety of the Arduino, otherwise 3.3V)&lt;br /&gt;
* RAW: This feeds the internal voltage regulator. You may apply a higher voltage then on the ACC pin, supposedly up to 12V, but I would not overdo it. In this case, +5V may be obtained on the ACC pin, but the small regulator can&#039;t supply much.&lt;br /&gt;
* GND: Connect to GND of the ESP8266&lt;br /&gt;
* RST: Reset&lt;br /&gt;
* TXD: Transmit data (another name for I/O pin 0). Connect to RX of the ESP8266 (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* RXD: Receive data (another name for I/O pin 1). Connect to TX of the ESP8266 (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* 2-13: Digital I/O Pins. Pin 13 is connected to the internal LED (which does not hurt if you want to use the pin for your own purposes).&lt;br /&gt;
* A0-A7: Analog I/O Pins (can be used for digital I/O as well)&lt;br /&gt;
&lt;br /&gt;
Some I/O pings have alternative meanings depending whether you use certain interfaces (if you don&#039;t, they&#039;re all yours):&lt;br /&gt;
&lt;br /&gt;
* Serial interface: I/O pins 0, 1 become Transmit Data (TXD), Receive Data (RDX)&lt;br /&gt;
* External interrupts: I/O pins 2, 3&lt;br /&gt;
* Serial Peripheral Interface (SPI): I/O pins 11, 12, 13 become Master Out Slave In (MOSI), Master In Slave Out (MISO), Serial Clock (SCK). This is a serial bidirectional bus with transfer in both directions at the same time. Slaves must be selected using a digital I/O pin, but there is no protocol overhead. Very efficient, but uses a few pins plus one pin for each device.&lt;br /&gt;
* Inter-Integrated Circuit or Two-Wire Interface (I2C or TWI): I/O pins A4, A5 become Serial Data (SDA), Serial Clock (SCL). This is a serial bidirectional bus. Communication partners are selected by using addresses transmitted over the bus using a communications protocol. More talkative, but uses only two pins for any amount of devices.&lt;br /&gt;
&lt;br /&gt;
Standard-use of pins:&lt;br /&gt;
&lt;br /&gt;
* 7: Logsury on/off (optional if you don&#039;t want to use the runtime-configuration option of Logsury)&lt;br /&gt;
* 8: ESP8266 reset (optional if you don&#039;t want to make use of the reset option of AC_ESP8266)&lt;br /&gt;
* 9: Status LED (optional if you don&#039;t want to use the LED-version of AC_EventFacility)&lt;br /&gt;
&lt;br /&gt;
==ESP8266==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039; &#039;&#039;&#039;Work in progress, stand by. Some information may be plain wrong, so... Last edit 19.06.2018.&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ESP8266 is IP- and WLAN-connectivity on a chip - SSL, TCP, UDP, WLAN; as a client or even as an access point (limited to 4 connections).&lt;br /&gt;
&lt;br /&gt;
The chip supports a number of modes that exclude each other:&lt;br /&gt;
&lt;br /&gt;
* Single/ multiple connection. Determines if only a single connection can be active at the same time, or up to four connections. The mode can only be changed if there currently is no connection. For SSL only single connection mode is supported (I guess SSL is too demanding for multiple connections). Multiple connection mode is required for server mode. Why would you limit yourself to a single connection? I don&#039;t know, but I use single connection mode because I need only one connection (to the MQTT broker), and sending out commands and parsing replies is more complex in multiple connection mode.&lt;br /&gt;
* IP client/ server mode. Determines if the chips opens connections as a client or if it accepts incoming connections as a server. The latter requires multiple connection mode.&lt;br /&gt;
* WLAN station/ AP mode. Determines if the chip acts as a client that logs into an existing WLAN or if the chip acts as a WLAN access points which other clients can connect to. &lt;br /&gt;
&lt;br /&gt;
The pins:&lt;br /&gt;
&lt;br /&gt;
* Vcc: 3.3V (using a voltage converter if you use a 5V power supply). Really recommended to avoid strange behavior: Use a 100uF or larger electrolytic capacitor between Vcc and GND to buffer power spikes the ESP generates during operation (I&#039;m using 1000uF).&lt;br /&gt;
* GND: Connect to GND of the Arduino&lt;br /&gt;
* RST: Reset. Tie to 3.3V (optional, but just to make sure OR connect to Arduino pin for allow for programmable hardware resets).&lt;br /&gt;
* CH-PD: Chip enable. Tie to 3.3V (mandatory, otherwise the chip won&#039;t listen).&lt;br /&gt;
* GPIO0: Digital I/O pin 0. Tie to 3.3V (optional, but just to make sure as this pin is used in conjunction with RST to program the ESP).&lt;br /&gt;
* GPIO2: Digital I/O pin 2. You can use this pin for your own programs; otherwise just don&#039;t connect it.&lt;br /&gt;
* TX: Transmit. Connect to RXD of the Arduino (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* RX: Receive. Connect to TXD of the Arduino (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
&lt;br /&gt;
Regarding the level shifting and voltage conversion: I am using a small COTS board that does both (it&#039;s the larger blue board that the smaller black ESP8266-board is plugged into). That is not a requirement; I&#039;ve been using separate level shifters and voltage converters in some projects. It just means more manual wiring and no cost savings.&lt;br /&gt;
&lt;br /&gt;
=== ESP Troubles===&lt;br /&gt;
&lt;br /&gt;
I have had ESPs that misbehaved a lot, and the chip and the serial connection are prone to problems in general (IMNSHO as I spent many hours on dealing with this).&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;misbehave&amp;quot; I mean:&lt;br /&gt;
&lt;br /&gt;
* Simply not reacting as expected (replying to a command in unexpected ways)&lt;br /&gt;
* Not be able to establish a WLAN or TCP connection&lt;br /&gt;
* Being stuck in some internal odd state that produces gobs of output&lt;br /&gt;
* Random reboots&lt;br /&gt;
&lt;br /&gt;
These problems can all be addressed though. Sometimes a software rest helps (a command sent via the serial interface). Sometime a hardware reset is required. On rarer occasions the power needs to be cycled. My software stack uses software and hardware resets. In order to perform hardware resets I connect an Arduino I/O pin to the ESP reset pin (the library supports this). It would be easy to extend that scheme to cycling the power by using another I/O pin, and a transistor that switches the chip off and on again.&lt;br /&gt;
&lt;br /&gt;
The ESP is its own computer on a chip, just like the Arduino. And it can be programmed by you, just like an Arduino. For why I don&#039;t use it &#039;&#039;instead&#039;&#039; of an Arduino, please see the next section.&lt;br /&gt;
&lt;br /&gt;
==Why not just an ESP8266?==&lt;br /&gt;
&lt;br /&gt;
Good question! Less hardware, more memory, direct function calls instead of serial communications all sound good. But, the Arduino has more I/O pins. I found programming the ESP is slow, and the ESP is less forgiving when it is handled the wrong way, be it hardware or even software. I fried an ESP by just trying to &amp;quot;blink&amp;quot; all I/O pins, to find out which number corresponds to which pin. After that the ESP did not interact with the programmer any more :-(.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=256</id>
		<title>AME Software</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=256"/>
		<updated>2018-06-24T20:16:19Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* AC_ESP8266 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Software)=&lt;br /&gt;
&lt;br /&gt;
[[File:The_AME_Stack_(Software).png|left|thumb|1200px|Class structure (operations incomplete)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction/ Random Thoughts==&lt;br /&gt;
&lt;br /&gt;
Because there is no concurrency on the Arduino platform we have to implement it ourselves. The Arduino standard-loop() is extended through all the classes listed below. loop() is executed as often as possible and gives each class its turn to do &amp;quot;its thing&amp;quot; (in example, detect incoming IP data on the lowest level, or perform and publish a temperature measurement on the highest).&lt;br /&gt;
&lt;br /&gt;
Instances on a higher lever of the stack should not have to know how to configure the instances they use on a lower level. In example, the MQTT level needs TCP connectivity but should not have to know whether this is being provided via Ethernet or WLAN. Because every thing needs a buzzword to market the idea, the concept of providing specific configuration from the outside has been called &amp;quot;Dependency Injection&amp;quot;. In the case of the AME stack, a factory configures instances for each level and plugs them together.&lt;br /&gt;
&lt;br /&gt;
==AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess.&lt;br /&gt;
&lt;br /&gt;
[[ESP8266 AT Command Reference]]&lt;br /&gt;
&lt;br /&gt;
===Pattern expansion===&lt;br /&gt;
&lt;br /&gt;
Commands with parameters can be assembled using a pattern string and a &amp;quot;multi&amp;quot; (more on that later) argument string. The pattern string contains &#039;$&#039; (Dollar) signs with are filled with sections of the argument string. The &amp;quot;multi&amp;quot; string simply is a sequence of string terminated by 0.&lt;br /&gt;
&lt;br /&gt;
In example, pattern string &amp;quot;$, $!&amp;quot; and argument string &amp;quot;Hello\0World\0&amp;quot; get expanded into &amp;quot;Hello, World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Pattern matching&lt;br /&gt;
&lt;br /&gt;
Responses with arguments can be parsed using a pattern string, producing a &amp;quot;multi&amp;quot; result string.&lt;br /&gt;
&lt;br /&gt;
In example, using pattern  string &amp;quot;time: $,count: $&amp;quot; to parse response &amp;quot;time: 47, count: 11&amp;quot; yield result string &amp;quot;47\011\0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The code for parsing is &amp;quot;a bit&amp;quot; tricky (it took me a day to write it and half a day to really understand it a year later). This is why I explain it here, for myself and other.&lt;br /&gt;
&lt;br /&gt;
Here is a description of the algorithm. A pattern consists of wildcards and blocks of text that must match. Wildcards and text blocks must alternate.&lt;br /&gt;
&lt;br /&gt;
Example: Pattern &amp;quot;$ BLOCK_B $ BLOCK_D $&amp;quot; consists of three wildcards and two blocks of text that must match. Another way of seeing this is &amp;quot;wildcards separate fixed blocks of text&amp;quot;. What you get is &amp;quot; BLOCK_B &amp;quot; and &amp;quot; BLOCK_D &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The next task: Locate the fixed text blocks in the text to parse. All text blocks must be found; otherwise, there is no overall match.&lt;br /&gt;
&lt;br /&gt;
Example: Text &amp;quot;BLOCK_A BLOCK_B BLOCK_C BLOCK_D BLOCK_E&amp;quot;. BLOCK_B and BLOCK_D are contained in the text. Another way of seeing this is &amp;quot;fixed blocks of text separate &#039;free text&#039;&amp;quot;. What you get is &amp;quot;BLOCK_A&amp;quot;, &amp;quot;BLOCK_C&amp;quot;, and &amp;quot;BLOCK_D&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Next step: Return matching free text as result.&lt;br /&gt;
&lt;br /&gt;
While this is not too tricky, the code is because it does it all in one go and not in three separate steps. But knowing how it is done is helpful in understanding the code.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
loop() ensures arriving IP data and chip messages get read and interpreted.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
None; this is the lowest level of the stack.&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
If IP data arrives or the connection was lost it informs the listener.&lt;br /&gt;
&lt;br /&gt;
==AC_TCP_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
loop() just calls loop() on ESP level.&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
See next point.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
If IP data arrives is passes it on to the next higher level.&lt;br /&gt;
&lt;br /&gt;
==AC_MTTQ==&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
loop() checks for the need to ping the broker if there was no recent network activity (to keep the connection alive) and whether the wait for a ping request has timed out. It checks, too, if the TCP connection is working.&lt;br /&gt;
&lt;br /&gt;
It probably would be better design to leave that to the TCP level. Some philosophy is involved here as well: Should the TCP level make sure a created connection is being maintained, or is it better to back-delegate error handling to the caller as requirements for error handling may depend on the use of the TCP API?&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
If a MQTT publication has been received it informs the listener.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
If IP data has been received it decodes the MQTT message.&lt;br /&gt;
&lt;br /&gt;
==AC_IoT/ Devices==&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
loop() re-establishes the MQTT connection if it has been lost. This currently happens on this level as information about device and capabilities is being published when a connection is made (again). It probably would be better design to leave connection maintenance to the MQTT level and just get notified when there was a connection problem and the connection got reestablished.&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
See next point.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
Passes MQTT publications on to capabilities if the topic name matches or the publication is of generic nature.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
Optional. Can be used to in example perform and publish a temperature measurement every 60 seconds.&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
May publish messages via MQTT.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
May subscribe to MQTT topics.&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
Communications between Arduino and ESP8266 is via serial interface. The timing demands are high as the ESP mercilessly transmits arriving IP data at full speed. SoftwareSerial definitely is &#039;&#039;not&#039;&#039; an option. The hardware serial interface usually is used to program the Arduino, though. I use SPI programming und logging via I2C to free up the hardware interface ([[AC.programmer|details]]). And since we don&#039;t need a bootloader anymore, we gain 2kB of flash memory as well. &lt;br /&gt;
&lt;br /&gt;
To avoid problems I increased the size of the receive buffer from 64 to 256 bytes. This does eat RAM memory, but makes for safer operation. Your mileage may vary: if your messages are short 64 Bytes is just fine.&lt;br /&gt;
&lt;br /&gt;
To adjust the receive buffer size, add the line&lt;br /&gt;
&lt;br /&gt;
  #define SERIAL_RX_BUFFER_SIZE 256&lt;br /&gt;
&lt;br /&gt;
in HardwareSerial.h before the first #if. In newer installations of the Arduino IDE on Windows the file does not reside south of the program folder, but is located in AppData/Local, in example&lt;br /&gt;
&lt;br /&gt;
  C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=File:20180615T143431_corrected.jpg&amp;diff=255</id>
		<title>File:20180615T143431 corrected.jpg</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=File:20180615T143431_corrected.jpg&amp;diff=255"/>
		<updated>2018-06-24T20:15:27Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=ESP8266_AT_Command_Reference&amp;diff=254</id>
		<title>ESP8266 AT Command Reference</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=ESP8266_AT_Command_Reference&amp;diff=254"/>
		<updated>2018-06-24T16:55:02Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* ESP8266 AT Command Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=ESP8266 AT Command Reference=&lt;br /&gt;
&lt;br /&gt;
Communication with the ESP is via serial connection. The designers of the ESP adopted a scheme known as &amp;quot;AT commands&amp;quot; that stems from the age when computers connected to a network via modem (I am even older than that).&lt;br /&gt;
&lt;br /&gt;
The commands that the ESP understands depend on the firmware version. There are a number of those; here are the ones I found a manual for:&lt;br /&gt;
&lt;br /&gt;
* 0.20&lt;br /&gt;
* 0.22&lt;br /&gt;
* 0.23&lt;br /&gt;
* 0.24&lt;br /&gt;
* 0.25&lt;br /&gt;
* 0.30&lt;br /&gt;
* 1.3 At the beginning of 2017 this was the newest version when ordering from Banggood&lt;br /&gt;
* 1.4&lt;br /&gt;
* 1.5&lt;br /&gt;
* 1.5.4&lt;br /&gt;
* 2.0.0&lt;br /&gt;
* 2.1.0&lt;br /&gt;
&lt;br /&gt;
REM: A change in FW version does not imply a change in supported AT commands.&lt;br /&gt;
&lt;br /&gt;
Communication with the ESP comes in four flavors:&lt;br /&gt;
&lt;br /&gt;
* test command: To query values parameters can assume, use AT+&amp;amp;lt;cmd&amp;amp;gt;=?&lt;br /&gt;
* query command: To query the current value of parameters, use AT+&amp;amp;lt;cmd&amp;amp;gt?&lt;br /&gt;
* setup command: To set parameters, use AT+&amp;amp;lt;cmd&amp;amp;gt;=&amp;amp;lt;x&amp;amp;gt;&lt;br /&gt;
* execute command: To execute a function, use AT+&amp;amp;lt;cmd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This scheme does not always apply but gives you an idea.&lt;br /&gt;
&lt;br /&gt;
Generally:&lt;br /&gt;
&lt;br /&gt;
* Strings need to be quoted&lt;br /&gt;
* Parameter are separated with a comma&lt;br /&gt;
* Each command must be followed with CRLF&lt;br /&gt;
* 115200Baud is the default speed&lt;br /&gt;
&lt;br /&gt;
I wrote a Java program that communicates with an ESP8266 to try out things before I put them into my AC_ESP8266 library. Testing out of Eclipse is just way faster and more convenient then uploading a new version to the Arduino each time. And, logging on the desktop offers way more possibilities.&lt;br /&gt;
&lt;br /&gt;
==Basic==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Group&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;AT Command&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Parameters&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Response&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;MQTT-Relevant?&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Test AT startup&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT+RST&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Restart module&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x, for error handling&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT+GMR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;View version info&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;amp;lt;AT version info&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;lt;SDK version info&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;lt;compile time&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x, for issuing the correct commands&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT+GSLP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Enter deep-sleep mode&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;time in millis&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;time&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;ATE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;commands echo or not&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;ATE0, ATE1&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+RESTORE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Factory reset&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+UART&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;UART configuration, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+UART_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;UART current configuration&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;amp;lt;baudrate 110-115200&amp;amp;gt;, &amp;amp;lt;databits 5-8&amp;amp;gt;, &amp;amp;lt;stopbits 1: 1, 2: 1.5, 3: 2&amp;amp;gt;, &amp;amp;lt;parity 0: none, 1: odd, 2: even&amp;amp;gt;, &amp;amp;lt;flow control 0: disable, 1: RTS, 2: CTS, 3: RTS + CTS&amp;amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+UART_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;UART default configuration, save to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;once&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+SLEEP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Sleep mode (station mode only)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;sleep mode 0: disable, 1: light, 2: modem&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
Query:&lt;br /&gt;
&amp;lt;p/&amp;gt;+SLEEP:&amp;amp;lt;sleep mode&amp;amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;Set:&lt;br /&gt;
&amp;lt;p/&amp;gt;OK&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+WAKEUPGPIO&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set a GPIO to wake ESP8266 up from light-sleep mode&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+RFPOWER&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set maximum value of RF TX Power&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;power 0-82&amp;amp;gt; in 0.25dBm&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+RFVDD&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set RF TX Power according to VDD33&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WLAN==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Group&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;AT Command&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Parameters&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Response&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;MQTT-Relevant?&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWMODE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Wi-Fi mode(sta/AP/sta+AP), [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWMODE_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Wi-Fi mode (station/ AP/ station+AP). Settings not updated in flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;mode 1: station, 2: softAP, 3: softAP + station&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWMODE_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Wi-Fi default mode(station/ AP/ station+AP). Save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - what does saving to flash provide?&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWJAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Connect to AP, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWJAP_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Connect to AP, won’t save to flash (station mode only)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;ssid&amp;amp;gt;,&amp;amp;lt;pwd&amp;amp;gt;[, &amp;amp;lt;bssid&amp;amp;gt;]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
Query:&lt;br /&gt;
&amp;lt;p/&amp;gt;+CWJAP_CUR:&amp;amp;lt;ssid&amp;amp;gt;, &amp;amp;lt;bssid&amp;amp;gt;, &amp;amp;lt;channel&amp;amp;gt;, &amp;amp;lt;rssi&amp;amp;gt;&amp;lt;/br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;p/&amp;gt;Set:&lt;br /&gt;
&amp;lt;p/&amp;gt;OK&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;or&lt;br /&gt;
&amp;lt;p/&amp;gt;+CWJAP:&amp;amp;lt;error code 1: connection timeout, 2: wrong password, 3: cannot find target AP, 4: connection failed&amp;amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWJAP_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Connect to AP, save to flash (station mode only)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - what does saving to flash provide?&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWLAPOPT&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set the configuration of command AT+CWLAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;sort enable 0: no sort, 1: sort by rssi&amp;amp;gt;,&amp;amp;lt;mask b0: ECN, b1: SSID, b2: RSSI, b3: MAC, b4: chn, b5: freq offset, b6: freq calibration&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWLAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Lists available APs&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;ssid&amp;gt;[, &amp;lt;mac&amp;gt;, &amp;lt;ch&amp;gt;]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
+CWLAP:&amp;amp;lt;ecn 0: open, 1: WEP, 2: WPA_PSK, 3: WPA2_PSK, 4: WPA_WPA2_PSK, 5: WPA2_Enterprise&amp;amp;gt;, &amp;amp;lt;ssid&amp;amp;gt;, &amp;amp;lt;rssi&amp;amp;gt;, &amp;amp;lt;mac&amp;amp;gt;, &amp;amp;lt;ch&amp;amp;gt;, &amp;amp;lt;freq offset&amp;amp;gt;, &amp;amp;lt;freq calibration&amp;amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;OK&lt;br /&gt;
&amp;lt;p/&amp;gt;depending on options set with CWLAPOPT&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;maybe, for selecting a WLAN&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWQAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Disconnect from AP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;maybe, for error handling&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set configuration of ESP8266 soft-AP, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSAP_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set current configuration of ESP8266 soft-AP. Settings not updated in flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;amp;lt;ssid&amp;amp;gt;, &amp;amp;lt;pwd&amp;amp;gt;, &amp;amp;lt;chl&amp;amp;gt;, &amp;amp;lt;ecn 0, 2, 3, 4&amp;amp;gt;[, &amp;amp;lt;max conn 1-4&amp;amp;gt;][, &amp;amp;lt;ssid hidden 0: broadcast, 1: don&#039;t broadcast&amp;amp;gt;]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
Query:&lt;br /&gt;
&amp;lt;p/&amp;gt;+CWSAP_CUR:&amp;amp;lt;ssid&amp;amp;gt;, &amp;amp;lt;pwd&amp;amp;gt;, &amp;amp;lt;chl&amp;amp;gt;, &amp;amp;lt;ecn&amp;amp;gt;, &amp;amp;lt;max conn&amp;amp;gt;, &amp;amp;lt;ssid hidden&amp;amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;Set:&lt;br /&gt;
&amp;lt;p/&amp;gt;OK&lt;br /&gt;
&amp;lt;p/&amp;gt;or&lt;br /&gt;
&amp;lt;p/&amp;gt;ERROR&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSAP_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set configuration of ESP8266 soft-AP. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWLIF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Get station IP which is connected to ESP8266 soft-AP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;amp;lt;IP addr&amp;amp;gt;, &amp;amp;lt;mac&amp;amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Enable/Disable DHCP, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCP_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Enable/Disable DHCP, changes not save to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCP_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Enable/Disable DHCP, save changes to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCPS_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP range of DHCP server, changes not save to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCPS_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP range of DHCP server, save changes to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWAUTOCONN&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Connect to AP automatically on power-up&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;enable 0: disable, 1: enable auto-connect on startup&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - quite possibly!&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTAMAC&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 station [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTAMAC_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 station. Changes not save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTAMAC_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 station. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAPMAC&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 soft-AP [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAPMAC_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 soft-AP. Changes not save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAPMAC_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 soft-AP. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTA&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 station, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTA_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 station. Changes not save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - to query&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTA_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 station. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 soft-AP, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAP_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 soft-AP. Changes not save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAP_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 soft-AP. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSTARTSMART&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Start SmartConfig (for AirKiss or ESP-TOUCH)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSTOPSMART&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Stop SmartConfig&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSTARTDISCOVER&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Start the mode that ESP8266 can be found by WeChat&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSTOPDISCOVER&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Stop the mode that ESP8266 can be found by WeChat&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+WPS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set WPS function&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+MDNS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MDNS function&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TCP==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Group&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;AT Command&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Parameters&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Response&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;MQTT-Relevant?&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTATUS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Get connection status&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
STATUS:&amp;amp;lt;stat: 2: connected to AP, obtained IP, 3: TCP or UDP connection created, 4: TCP or UDP disconnected, 5: not connected to AP&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
+CIPSTATUS:&amp;amp;lt;link ID 0-4&amp;amp;gt;, &amp;amp;lt;type TCP or UDP&amp;amp;gt;, &amp;amp;lt;remote_IP&amp;amp;gt;, &amp;amp;lt;remote_port&amp;amp;gt;, &amp;amp;lt;local_port&amp;amp;gt;, &amp;amp;lt;tetype 0: client, 1: server&amp;amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPDOMAIN&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;DNS function&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTART&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Establish TCP connection, UDP transmission or SSL connection (only one at the same time, high memory consumption)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;link ID 0-4&amp;amp;gt;,&amp;amp;lt;type TCP, UDP, SSL&amp;amp;gt;, &amp;amp;lt;remote IP&amp;amp;gt;, &amp;amp;lt;remote port&amp;amp;gt;[, &amp;amp;lt;TCP keep alive&amp;amp;gt;]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSSLSIZE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set the size of SSL buffer&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;maybe, SSL would be great&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSEND&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Send data&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT+CIPSEND=&amp;amp;lt;link ID&amp;amp;gt;, &amp;amp;lt;length&amp;amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;then receives serial data until length is reached, then&lt;br /&gt;
&amp;lt;p/&amp;gt;ERROR&lt;br /&gt;
&amp;lt;p/&amp;gt;or&lt;br /&gt;
&amp;lt;p/&amp;gt;SEND OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSENDEX&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Send data, if &amp;lt;length&amp;gt; or &amp;quot;\0&amp;quot; is met, data will be sent&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSENDBUF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Write data into TCP-send-buffer&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPBUFRESET&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Reset segment ID count&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPBUFSTATUS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Check status of TCP-send-buffer (not for SSL connections)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPCHECKSEQ&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Check if a specific segment is sent or not&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPCLOSE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Close TCP/UDP/SSL connection &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIFSR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Get local IP address &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
+ CIFSR:&amp;amp;lt;IP address&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPMUX&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set multiple connections mode&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - to select single mode, but do we need single mode?&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSERVER&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Configure as server&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPMODE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set transmission mode&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;- not used so far&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+SAVETRANSLINK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Save transparent transmission link to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;- I get the impression this creates a TCP connection and after that, serial talks transparently to that connection&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTO&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set timeout when ESP8266 runs as TCP server&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIUPDATE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Upgrade firmware through network&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+PING&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Function PING &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;IP&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
+&amp;amp;lt;time&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;p/&amp;gt;Or&lt;br /&gt;
&amp;lt;p/&amp;gt;ERROR&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;maybe, for error handling&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPDINFO&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Show remote IP and remote port with &amp;quot;+IPD&amp;quot; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Hardware_Problems&amp;diff=253</id>
		<title>Hardware Problems</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Hardware_Problems&amp;diff=253"/>
		<updated>2018-06-24T13:42:11Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Embedded Hardware Problems=&lt;br /&gt;
&lt;br /&gt;
Bugs are not limited to software - plain electricity can be tricky, too! Sometimes it even kills (and I&#039;m referring to Arduinos here).&lt;br /&gt;
&lt;br /&gt;
* [[Staying well-grounded]] - Why not everybody can have their own GND (ground; this is important to the health of your Arduino!)&lt;br /&gt;
* [[Sufficient power-supply]] - Some chips suck (power)&lt;br /&gt;
* [[Port-Power]] - How to not power an Arduino (via an I/O port)&lt;br /&gt;
* Fun with [[pitfalls-power lan|power LAN]] adapters (don&#039;t plug your fridge into one)&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Port-Power&amp;diff=252</id>
		<title>Port-Power</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Port-Power&amp;diff=252"/>
		<updated>2018-06-24T13:41:08Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Created page with &amp;quot;Hardware Problems  =Port-Power - How to not power an Arduino (via an I/O port)=  I powered up my breadboard circuit, the LED on the Arduino came on - all is well.   Or not...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Hardware Problems]]&lt;br /&gt;
&lt;br /&gt;
=Port-Power - How to not power an Arduino (via an I/O port)=&lt;br /&gt;
&lt;br /&gt;
I powered up my breadboard circuit, the LED on the Arduino came on - all is well. &lt;br /&gt;
&lt;br /&gt;
Or not, since the Arduino is not connected to power via RAW or ACC. Why then does the Arduino power LED come on? &lt;br /&gt;
&lt;br /&gt;
Turns out GND was connected, and so was 5V to one of the I/O pins. And, there is a path from that pin to ACC: via the internal pullup resistor!&lt;br /&gt;
&lt;br /&gt;
[[Hardware Problems]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Hardware_Problems&amp;diff=251</id>
		<title>Hardware Problems</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Hardware_Problems&amp;diff=251"/>
		<updated>2018-06-24T13:32:43Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* Embedded Hardware Problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Embedded Hardware Problems=&lt;br /&gt;
&lt;br /&gt;
Bugs are not limited to software - plain electricity can be tricky, too! Sometimes it even kills (and I&#039;m referring to Arduinos here).&lt;br /&gt;
&lt;br /&gt;
* [[Sufficient power-supply]] - Some chips suck (power)&lt;br /&gt;
* [[Staying well-grounded]] - Why not everybody can have their own GND (ground)&lt;br /&gt;
* [[Port-Power]] - How to not power an Arduino (via an I/O port)&lt;br /&gt;
* Fun with [[pitfalls-power lan|power LAN]] adapters (don&#039;t plug your fridge into one)&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=ESP8266_AT_Command_Reference&amp;diff=250</id>
		<title>ESP8266 AT Command Reference</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=ESP8266_AT_Command_Reference&amp;diff=250"/>
		<updated>2018-06-24T11:47:28Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Created page with &amp;quot;=ESP8266 AT Command Reference=  ==Basic==  &amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;th&amp;gt;Group&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;AT Command&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Parameters&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Response&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;MQTT-Rel...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=ESP8266 AT Command Reference=&lt;br /&gt;
&lt;br /&gt;
==Basic==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Group&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;AT Command&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Parameters&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Response&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;MQTT-Relevant?&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Test AT startup&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT+RST&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Restart module&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x, for error handling&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT+GMR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;View version info&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;amp;lt;AT version info&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;lt;SDK version info&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;lt;compile time&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x, for issuing the correct commands&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT+GSLP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Enter deep-sleep mode&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;time in millis&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;time&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;ATE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;commands echo or not&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;ATE0, ATE1&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+RESTORE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Factory reset&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+UART&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;UART configuration, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+UART_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;UART current configuration&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;amp;lt;baudrate 110-115200&amp;amp;gt;, &amp;amp;lt;databits 5-8&amp;amp;gt;, &amp;amp;lt;stopbits 1: 1, 2: 1.5, 3: 2&amp;amp;gt;, &amp;amp;lt;parity 0: none, 1: odd, 2: even&amp;amp;gt;, &amp;amp;lt;flow control 0: disable, 1: RTS, 2: CTS, 3: RTS + CTS&amp;amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+UART_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;UART default configuration, save to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;once&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+SLEEP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Sleep mode (station mode only)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;sleep mode 0: disable, 1: light, 2: modem&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
Query:&lt;br /&gt;
&amp;lt;p/&amp;gt;+SLEEP:&amp;amp;lt;sleep mode&amp;amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;Set:&lt;br /&gt;
&amp;lt;p/&amp;gt;OK&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+WAKEUPGPIO&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set a GPIO to wake ESP8266 up from light-sleep mode&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+RFPOWER&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set maximum value of RF TX Power&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;power 0-82&amp;amp;gt; in 0.25dBm&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Basic&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+RFVDD&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set RF TX Power according to VDD33&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==WLAN==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Group&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;AT Command&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Parameters&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Response&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;MQTT-Relevant?&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWMODE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Wi-Fi mode(sta/AP/sta+AP), [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWMODE_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Wi-Fi mode (station/ AP/ station+AP). Settings not updated in flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;mode 1: station, 2: softAP, 3: softAP + station&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWMODE_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Wi-Fi default mode(station/ AP/ station+AP). Save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - what does saving to flash provide?&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWJAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Connect to AP, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWJAP_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Connect to AP, won’t save to flash (station mode only)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;ssid&amp;amp;gt;,&amp;amp;lt;pwd&amp;amp;gt;[, &amp;amp;lt;bssid&amp;amp;gt;]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
Query:&lt;br /&gt;
&amp;lt;p/&amp;gt;+CWJAP_CUR:&amp;amp;lt;ssid&amp;amp;gt;, &amp;amp;lt;bssid&amp;amp;gt;, &amp;amp;lt;channel&amp;amp;gt;, &amp;amp;lt;rssi&amp;amp;gt;&amp;lt;/br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;p/&amp;gt;Set:&lt;br /&gt;
&amp;lt;p/&amp;gt;OK&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;or&lt;br /&gt;
&amp;lt;p/&amp;gt;+CWJAP:&amp;amp;lt;error code 1: connection timeout, 2: wrong password, 3: cannot find target AP, 4: connection failed&amp;amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWJAP_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Connect to AP, save to flash (station mode only)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - what does saving to flash provide?&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWLAPOPT&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set the configuration of command AT+CWLAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;sort enable 0: no sort, 1: sort by rssi&amp;amp;gt;,&amp;amp;lt;mask b0: ECN, b1: SSID, b2: RSSI, b3: MAC, b4: chn, b5: freq offset, b6: freq calibration&amp;amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWLAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Lists available APs&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;ssid&amp;gt;[, &amp;lt;mac&amp;gt;, &amp;lt;ch&amp;gt;]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
+CWLAP:&amp;amp;lt;ecn 0: open, 1: WEP, 2: WPA_PSK, 3: WPA2_PSK, 4: WPA_WPA2_PSK, 5: WPA2_Enterprise&amp;amp;gt;, &amp;amp;lt;ssid&amp;amp;gt;, &amp;amp;lt;rssi&amp;amp;gt;, &amp;amp;lt;mac&amp;amp;gt;, &amp;amp;lt;ch&amp;amp;gt;, &amp;amp;lt;freq offset&amp;amp;gt;, &amp;amp;lt;freq calibration&amp;amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;OK&lt;br /&gt;
&amp;lt;p/&amp;gt;depending on options set with CWLAPOPT&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;maybe, for selecting a WLAN&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWQAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Disconnect from AP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;maybe, for error handling&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set configuration of ESP8266 soft-AP, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSAP_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set current configuration of ESP8266 soft-AP. Settings not updated in flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;amp;lt;ssid&amp;amp;gt;, &amp;amp;lt;pwd&amp;amp;gt;, &amp;amp;lt;chl&amp;amp;gt;, &amp;amp;lt;ecn 0, 2, 3, 4&amp;amp;gt;[, &amp;amp;lt;max conn 1-4&amp;amp;gt;][, &amp;amp;lt;ssid hidden 0: broadcast, 1: don&#039;t broadcast&amp;amp;gt;]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
Query:&lt;br /&gt;
&amp;lt;p/&amp;gt;+CWSAP_CUR:&amp;amp;lt;ssid&amp;amp;gt;, &amp;amp;lt;pwd&amp;amp;gt;, &amp;amp;lt;chl&amp;amp;gt;, &amp;amp;lt;ecn&amp;amp;gt;, &amp;amp;lt;max conn&amp;amp;gt;, &amp;amp;lt;ssid hidden&amp;amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;Set:&lt;br /&gt;
&amp;lt;p/&amp;gt;OK&lt;br /&gt;
&amp;lt;p/&amp;gt;or&lt;br /&gt;
&amp;lt;p/&amp;gt;ERROR&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSAP_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set configuration of ESP8266 soft-AP. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWLIF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Get station IP which is connected to ESP8266 soft-AP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;amp;lt;IP addr&amp;amp;gt;, &amp;amp;lt;mac&amp;amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Enable/Disable DHCP, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCP_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Enable/Disable DHCP, changes not save to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCP_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Enable/Disable DHCP, save changes to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCPS_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP range of DHCP server, changes not save to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWDHCPS_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP range of DHCP server, save changes to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWAUTOCONN&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Connect to AP automatically on power-up&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;enable 0: disable, 1: enable auto-connect on startup&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - quite possibly!&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTAMAC&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 station [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTAMAC_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 station. Changes not save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTAMAC_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 station. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAPMAC&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 soft-AP [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAPMAC_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 soft-AP. Changes not save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAPMAC_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MAC address of ESP8266 soft-AP. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTA&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 station, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTA_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 station. Changes not save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - to query&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTA_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 station. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAP&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 soft-AP, [@deprecated]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAP_CUR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 soft-AP. Changes not save to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPAP_DEF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set IP address of ESP8266 soft-AP. Save changes to flash.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSTARTSMART&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Start SmartConfig (for AirKiss or ESP-TOUCH)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSTOPSMART&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Stop SmartConfig&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSTARTDISCOVER&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Start the mode that ESP8266 can be found by WeChat&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CWSTOPDISCOVER&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Stop the mode that ESP8266 can be found by WeChat&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+WPS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set WPS function&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;WLAN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+MDNS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set MDNS function&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TCP==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Group&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;AT Command&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Parameters&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Response&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;MQTT-Relevant?&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTATUS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Get connection status&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
STATUS:&amp;amp;lt;stat: 2: connected to AP, obtained IP, 3: TCP or UDP connection created, 4: TCP or UDP disconnected, 5: not connected to AP&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
+CIPSTATUS:&amp;amp;lt;link ID 0-4&amp;amp;gt;, &amp;amp;lt;type TCP or UDP&amp;amp;gt;, &amp;amp;lt;remote_IP&amp;amp;gt;, &amp;amp;lt;remote_port&amp;amp;gt;, &amp;amp;lt;local_port&amp;amp;gt;, &amp;amp;lt;tetype 0: client, 1: server&amp;amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPDOMAIN&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;DNS function&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTART&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Establish TCP connection, UDP transmission or SSL connection (only one at the same time, high memory consumption)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;amp;lt;link ID 0-4&amp;amp;gt;,&amp;amp;lt;type TCP, UDP, SSL&amp;amp;gt;, &amp;amp;lt;remote IP&amp;amp;gt;, &amp;amp;lt;remote port&amp;amp;gt;[, &amp;amp;lt;TCP keep alive&amp;amp;gt;]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSSLSIZE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set the size of SSL buffer&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;maybe, SSL would be great&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSEND&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Send data&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;AT+CIPSEND=&amp;amp;lt;link ID&amp;amp;gt;, &amp;amp;lt;length&amp;amp;gt;&lt;br /&gt;
&amp;lt;p/&amp;gt;then receives serial data until length is reached, then&lt;br /&gt;
&amp;lt;p/&amp;gt;ERROR&lt;br /&gt;
&amp;lt;p/&amp;gt;or&lt;br /&gt;
&amp;lt;p/&amp;gt;SEND OK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSENDEX&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Send data, if &amp;lt;length&amp;gt; or &amp;quot;\0&amp;quot; is met, data will be sent&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSENDBUF&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Write data into TCP-send-buffer&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPBUFRESET&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Reset segment ID count&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPBUFSTATUS&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Check status of TCP-send-buffer (not for SSL connections)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPCHECKSEQ&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Check if a specific segment is sent or not&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPCLOSE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Close TCP/UDP/SSL connection &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIFSR&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Get local IP address &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
+ CIFSR:&amp;amp;lt;IP address&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPMUX&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set multiple connections mode&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;x - to select single mode, but do we need single mode?&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSERVER&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Configure as server&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPMODE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set transmission mode&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;- not used so far&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+SAVETRANSLINK&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Save transparent transmission link to flash&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;- I get the impression this creates a TCP connection and after that, serial talks transparently to that connection&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPSTO&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Set timeout when ESP8266 runs as TCP server&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIUPDATE&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Upgrade firmware through network&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+PING&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Function PING &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;IP&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
+&amp;amp;lt;time&amp;amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
OK&lt;br /&gt;
&amp;lt;p/&amp;gt;Or&lt;br /&gt;
&amp;lt;p/&amp;gt;ERROR&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;maybe, for error handling&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;TCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;AT+CIPDINFO&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Show remote IP and remote port with &amp;quot;+IPD&amp;quot; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;-&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=249</id>
		<title>AME Software</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=249"/>
		<updated>2018-06-23T11:20:33Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* AME Stack (Software) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Software)=&lt;br /&gt;
&lt;br /&gt;
[[File:The_AME_Stack_(Software).png|left|thumb|1200px|Class structure (operations incomplete)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction/ Random Thoughts==&lt;br /&gt;
&lt;br /&gt;
Because there is no concurrency on the Arduino platform we have to implement it ourselves. The Arduino standard-loop() is extended through all the classes listed below. loop() is executed as often as possible and gives each class its turn to do &amp;quot;its thing&amp;quot; (in example, detect incoming IP data on the lowest level, or perform and publish a temperature measurement on the highest).&lt;br /&gt;
&lt;br /&gt;
Instances on a higher lever of the stack should not have to know how to configure the instances they use on a lower level. In example, the MQTT level needs TCP connectivity but should not have to know whether this is being provided via Ethernet or WLAN. Because every thing needs a buzzword to market the idea, the concept of providing specific configuration from the outside has been called &amp;quot;Dependency Injection&amp;quot;. In the case of the AME stack, a factory configures instances for each level and plugs them together.&lt;br /&gt;
&lt;br /&gt;
==AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
loop() ensures arriving IP data and chip messages get read and interpreted.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
None; this is the lowest level of the stack.&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
If IP data arrives or the connection was lost it informs the listener.&lt;br /&gt;
&lt;br /&gt;
==AC_TCP_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
loop() just calls loop() on ESP level.&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
See next point.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
If IP data arrives is passes it on to the next higher level.&lt;br /&gt;
&lt;br /&gt;
==AC_MTTQ==&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
loop() checks for the need to ping the broker if there was no recent network activity (to keep the connection alive) and whether the wait for a ping request has timed out. It checks, too, if the TCP connection is working.&lt;br /&gt;
&lt;br /&gt;
It probably would be better design to leave that to the TCP level. Some philosophy is involved here as well: Should the TCP level make sure a created connection is being maintained, or is it better to back-delegate error handling to the caller as requirements for error handling may depend on the use of the TCP API?&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
If a MQTT publication has been received it informs the listener.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
If IP data has been received it decodes the MQTT message.&lt;br /&gt;
&lt;br /&gt;
==AC_IoT/ Devices==&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
loop() re-establishes the MQTT connection if it has been lost. This currently happens on this level as information about device and capabilities is being published when a connection is made (again). It probably would be better design to leave connection maintenance to the MQTT level and just get notified when there was a connection problem and the connection got reestablished.&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
See next point.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
Passes MQTT publications on to capabilities if the topic name matches or the publication is of generic nature.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
===Looping===&lt;br /&gt;
&lt;br /&gt;
Optional. Can be used to in example perform and publish a temperature measurement every 60 seconds.&lt;br /&gt;
&lt;br /&gt;
===Event Production===&lt;br /&gt;
&lt;br /&gt;
May publish messages via MQTT.&lt;br /&gt;
&lt;br /&gt;
===Event Consumption===&lt;br /&gt;
&lt;br /&gt;
May subscribe to MQTT topics.&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
Communications between Arduino and ESP8266 is via serial interface. The timing demands are high as the ESP mercilessly transmits arriving IP data at full speed. SoftwareSerial definitely is &#039;&#039;not&#039;&#039; an option. The hardware serial interface usually is used to program the Arduino, though. I use SPI programming und logging via I2C to free up the hardware interface ([[AC.programmer|details]]). And since we don&#039;t need a bootloader anymore, we gain 2kB of flash memory as well. &lt;br /&gt;
&lt;br /&gt;
To avoid problems I increased the size of the receive buffer from 64 to 256 bytes. This does eat RAM memory, but makes for safer operation. Your mileage may vary: if your messages are short 64 Bytes is just fine.&lt;br /&gt;
&lt;br /&gt;
To adjust the receive buffer size, add the line&lt;br /&gt;
&lt;br /&gt;
  #define SERIAL_RX_BUFFER_SIZE 256&lt;br /&gt;
&lt;br /&gt;
in HardwareSerial.h before the first #if. In newer installations of the Arduino IDE on Windows the file does not reside south of the program folder, but is located in AppData/Local, in example&lt;br /&gt;
&lt;br /&gt;
  C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=248</id>
		<title>AME Software</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=248"/>
		<updated>2018-06-23T10:15:47Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Software)=&lt;br /&gt;
&lt;br /&gt;
[[File:The_AME_Stack_(Software).png|left|thumb|1200px|Class structure (operations incomplete)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess. &lt;br /&gt;
&lt;br /&gt;
==AC_TCP_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
==AC_MTTQ==&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
==AC_IoT/ Devices==&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
Communications between Arduino and ESP8266 is via serial interface. The timing demands are high as the ESP mercilessly transmits arriving IP data at full speed. SoftwareSerial definitely is &#039;&#039;not&#039;&#039; an option. The hardware serial interface usually is used to program the Arduino, though. I use SPI programming und logging via I2C to free up the hardware interface ([[AC.programmer|details]]). And since we don&#039;t need a bootloader anymore, we gain 2kB of flash memory as well. &lt;br /&gt;
&lt;br /&gt;
To avoid problems I increased the size of the receive buffer from 64 to 256 bytes. This does eat RAM memory, but makes for safer operation. Your mileage may vary: if your messages are short 64 Bytes is just fine.&lt;br /&gt;
&lt;br /&gt;
To adjust the receive buffer size, add the line&lt;br /&gt;
&lt;br /&gt;
  #define SERIAL_RX_BUFFER_SIZE 256&lt;br /&gt;
&lt;br /&gt;
in HardwareSerial.h before the first #if. In newer installations of the Arduino IDE on Windows the file does not reside south of the program folder, but is located in AppData/Local, in example&lt;br /&gt;
&lt;br /&gt;
  C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\cores\arduino&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=247</id>
		<title>AME Hardware</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=247"/>
		<updated>2018-06-21T20:35:04Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Hardware)=&lt;br /&gt;
&lt;br /&gt;
[[File:20170802T115833.jpg|left|thumb|600px|Voltage controller (left), Arduino (top right), and ESP8266 (bottom right)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
The Arduino is a computer on a chip - CPU, memory for programs (ROM, flashable), memory for variables (RAM, volatile), memory for data (EPROM, non-volatile, runtime-programmable), counters, timers, I/O pins, and various interfaces (shared with the I/O pins; interrupts, serial, I2C, SPI). Different models offer different amounts of assets.&lt;br /&gt;
&lt;br /&gt;
Cheap versions can be ordered from Chinese suppliers for 2.50€ a piece. I&#039;m using them all the time, and they just work fine (didn&#039;t have a single dud in 20+ Arduinos).&lt;br /&gt;
&lt;br /&gt;
The pins:&lt;br /&gt;
&lt;br /&gt;
* ACC: +5V (if you use the 5V variety of the Arduino, otherwise 3.3V)&lt;br /&gt;
* RAW: This feeds the internal voltage regulator. You may apply a higher voltage then on the ACC pin, supposedly up to 12V, but I would not overdo it. In this case, +5V may be obtained on the ACC pin, but the small regulator can&#039;t supply much.&lt;br /&gt;
* GND: Connect to GND of the ESP8266&lt;br /&gt;
* RST: Reset&lt;br /&gt;
* TXD: Transmit data (another name for I/O pin 0). Connect to RX of the ESP8266 (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* RXD: Receive data (another name for I/O pin 1). Connect to TX of the ESP8266 (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* 2-13: Digital I/O Pins. Pin 13 is connected to the internal LED (which does not hurt if you want to use the pin for your own purposes).&lt;br /&gt;
* A0-A7: Analog I/O Pins (can be used for digital I/O as well)&lt;br /&gt;
&lt;br /&gt;
Some I/O pings have alternative meanings depending whether you use certain interfaces (if you don&#039;t, they&#039;re all yours):&lt;br /&gt;
&lt;br /&gt;
* Serial interface: I/O pins 0, 1 become Transmit Data (TXD), Receive Data (RDX)&lt;br /&gt;
* External interrupts: I/O pins 2, 3&lt;br /&gt;
* Serial Peripheral Interface (SPI): I/O pins 11, 12, 13 become Master Out Slave In (MOSI), Master In Slave Out (MISO), Serial Clock (SCK). This is a serial bidirectional bus with transfer in both directions at the same time. Slaves must be selected using a digital I/O pin, but there is no protocol overhead. Very efficient, but uses a few pins plus one pin for each device.&lt;br /&gt;
* Inter-Integrated Circuit or Two-Wire Interface (I2C or TWI): I/O pins A4, A5 become Serial Data (SDA), Serial Clock (SCL). This is a serial bidirectional bus. Communication partners are selected by using addresses transmitted over the bus using a communications protocol. More talkative, but uses only two pins for any amount of devices.&lt;br /&gt;
&lt;br /&gt;
==ESP8266==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039; &#039;&#039;&#039;Work in progress, stand by. Some information may be plain wrong, so... Last edit 19.06.2018.&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ESP8266 is IP- and WLAN-connectivity on a chip - SSL, TCP, UDP, WLAN; as a client or even as an access point (limited to 4 connections).&lt;br /&gt;
&lt;br /&gt;
The chip supports a number of modes that exclude each other:&lt;br /&gt;
&lt;br /&gt;
* Single/ multiple connection. Determines if only a single connection can be active at the same time, or up to four connections. The mode can only be changed if there currently is no connection. For SSL only single connection mode is supported (I guess SSL is too demanding for multiple connections). Multiple connection mode is required for server mode. Why would you limit yourself to a single connection? I don&#039;t know, but I use single connection mode because I need only one connection (to the MQTT broker), and sending out commands and parsing replies is more complex in multiple connection mode.&lt;br /&gt;
* IP client/ server mode. Determines if the chips opens connections as a client or if it accepts incoming connections as a server. The latter requires multiple connection mode.&lt;br /&gt;
* WLAN station/ AP mode. Determines if the chip acts as a client that logs into an existing WLAN or if the chip acts as a WLAN access points which other clients can connect to. &lt;br /&gt;
&lt;br /&gt;
The pins:&lt;br /&gt;
&lt;br /&gt;
* Vcc: 3.3V (using a voltage converter if you use a 5V power supply). Really recommended to avoid strange behavior: Use a 100uF or larger electrolytic capacitor between Vcc and GND to buffer power spikes the ESP generates during operation (I&#039;m using 1000uF).&lt;br /&gt;
* GND: Connect to GND of the Arduino&lt;br /&gt;
* RST: Reset. Tie to 3.3V (optional, but just to make sure OR connect to Arduino pin for allow for programmable hardware resets).&lt;br /&gt;
* CH-PD: Chip enable. Tie to 3.3V (mandatory, otherwise the chip won&#039;t listen).&lt;br /&gt;
* GPIO0: Digital I/O pin 0. Tie to 3.3V (optional, but just to make sure as this pin is used in conjunction with RST to program the ESP).&lt;br /&gt;
* GPIO2: Digital I/O pin 2. You can use this pin for your own programs; otherwise just don&#039;t connect it.&lt;br /&gt;
* TX: Transmit. Connect to RXD of the Arduino (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* RX: Receive. Connect to TXD of the Arduino (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
&lt;br /&gt;
Regarding the level shifting and voltage conversion: I am using a small COTS board that does both (it&#039;s the larger blue board that the smaller black ESP8266-board is plugged into). That is not a requirement; I&#039;ve been using separate level shifters and voltage converters in some projects. It just means more manual wiring and no cost savings.&lt;br /&gt;
&lt;br /&gt;
=== ESP Troubles===&lt;br /&gt;
&lt;br /&gt;
I have had ESPs that misbehaved a lot, and the chip and the serial connection are prone to problems in general (IMNSHO as I spent many hours on dealing with this).&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;misbehave&amp;quot; I mean:&lt;br /&gt;
&lt;br /&gt;
* Simply not reacting as expected (replying to a command in unexpected ways)&lt;br /&gt;
* Not be able to establish a WLAN or TCP connection&lt;br /&gt;
* Being stuck in some internal odd state that produces gobs of output&lt;br /&gt;
* Random reboots&lt;br /&gt;
&lt;br /&gt;
These problems can all be addressed though. Sometimes a software rest helps (a command sent via the serial interface). Sometime a hardware reset is required. On rarer occasions the power needs to be cycled. My software stack uses software and hardware resets. In order to perform hardware resets I connect an Arduino I/O pin to the ESP reset pin (the library supports this). It would be easy to extend that scheme to cycling the power by using another I/O pin, and a transistor that switches the chip off and on again.&lt;br /&gt;
&lt;br /&gt;
The ESP is its own computer on a chip, just like the Arduino. And it can be programmed by you, just like an Arduino. For why I don&#039;t use it &#039;&#039;instead&#039;&#039; of an Arduino, please see the next section.&lt;br /&gt;
&lt;br /&gt;
==Why not just an ESP8266?==&lt;br /&gt;
&lt;br /&gt;
Good question! Less hardware, more memory, direct function calls instead of serial communications all sound good. But, the Arduino has more I/O pins. I found programming the ESP is slow, and the ESP is less forgiving when it is handled the wrong way, be it hardware or even software. I fried an ESP by just trying to &amp;quot;blink&amp;quot; all I/O pins, to find out which number corresponds to which pin. After that the ESP did not interact with the programmer any more :-(.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=246</id>
		<title>AME Hardware</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=246"/>
		<updated>2018-06-19T23:20:39Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Hardware)=&lt;br /&gt;
&lt;br /&gt;
[[File:20170802T115833.jpg|left|thumb|600px|Voltage controller (left), Arduino (top right), and ESP8266 (bottom right)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
The Arduino is a computer on a chip - CPU, memory for programs (ROM, flashable), memory for variables (RAM, volatile), memory for data (EPROM, non-volatile, runtime-programmable), counters, timers, I/O pins, and various interfaces (shared with the I/O pins; interrupts, serial, I2C, SPI). Different models offer different amounts of assets.&lt;br /&gt;
&lt;br /&gt;
Cheap versions can be ordered from Chinese suppliers for 2.50€ a piece. I&#039;m using them all the time, and they just work fine (didn&#039;t have a single dud in 20+ Arduinos).&lt;br /&gt;
&lt;br /&gt;
The pins:&lt;br /&gt;
&lt;br /&gt;
* ACC: +5V (if you use the 5V variety of the Arduino, otherwise 3.3V)&lt;br /&gt;
* RAW: This feeds the internal voltage regulator. You may apply a higher voltage then on the ACC pin, supposedly up to 12V, but I would not overdo it. In this case, +5V may be obtained on the ACC pin, but the small regulator can&#039;t supply much.&lt;br /&gt;
* GND: Connect to GND of the ESP8266&lt;br /&gt;
* RST: Reset&lt;br /&gt;
* TXD: Transmit data (another name for I/O pin 0). Connect to RX of the ESP8266 (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* RXD: Receive data (another name for I/O pin 1). Connect to TX of the ESP8266 (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* 2-13: Digital I/O Pins. Pin 13 is connected to the internal LED (which does not hurt if you want to use the pin for your own purposes).&lt;br /&gt;
* A0-A7: Analog I/O Pins (can be used for digital I/O as well)&lt;br /&gt;
&lt;br /&gt;
Some I/O pings have alternative meanings depending whether you use certain interfaces (if you don&#039;t, they&#039;re all yours):&lt;br /&gt;
&lt;br /&gt;
* Serial interface: O, 1 become Transmit Data (TXD), Receive Data (RDX)&lt;br /&gt;
* External interrupts: 2, 3&lt;br /&gt;
* Serial Peripheral Interface (SPI): 11, 12, 13 become Master Out Slave In (MOSI), Master In Slave Out (MISO), Serial Clock (SCK). This is a serial bidirectional bus. Slaves must be selected using a digital I/O pin, but there is no protocol overhead.&lt;br /&gt;
* Inter-Integrated Circuit or Two-Wire Interface (I2C or TWI): A4, A5 become Serial Data (SDA), Serial Clock (SCL). This is a serial bidirectional bus. Communication partners are selected by using addresses transmitted over the bus using a communications protocol.&lt;br /&gt;
&lt;br /&gt;
==ESP8266==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039; &#039;&#039;&#039;Work in progress, stand by. Some information may be plain wrong, so... Last edit 19.06.2018.&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ESP8266 is IP- and WLAN-connectivity on a chip - SSL, TCP, UDP, WLAN; as a client or even as an access point (limited to 4 connections).&lt;br /&gt;
&lt;br /&gt;
The chip supports a number of modes that exclude each other:&lt;br /&gt;
&lt;br /&gt;
* Single/ multiple connection. Determines if only a single connection can be active at the same time, or up to four connections. The mode can only be changed if there currently is no connection. For SSL only single connection mode is supported (I guess SSL is too demanding for multiple connections). Multiple connection mode is required for server mode. Why would you limit yourself to a single connection? I don&#039;t know, but I use single connection mode because I need only one connection (to the MQTT broker), and sending out commands and parsing replies is more complex in multiple connection mode.&lt;br /&gt;
* IP client/ server mode. Determines if the chips opens connections as a client or if it accepts incoming connections as a server. The latter requires multiple connection mode.&lt;br /&gt;
* WLAN station/ AP mode. Determines if the chip acts as a client that logs into an existing WLAN or if the chip acts as a WLAN access points which other clients can connect to. &lt;br /&gt;
&lt;br /&gt;
The pins:&lt;br /&gt;
&lt;br /&gt;
* Vcc: 3.3V (using a voltage converter if you use a 5V power supply). Really recommended to avoid strange behavior: Use a 100uF or larger electrolytic capacitor between Vcc and GND to buffer power spikes the ESP generates during operation (I&#039;m using 1000uF).&lt;br /&gt;
* GND: Connect to GND of the Arduino&lt;br /&gt;
* RST: Reset. Tie to 3.3V (optional, but just to make sure OR connect to Arduino pin for allow for programmable hardware resets).&lt;br /&gt;
* CH-PD: Chip enable. Tie to 3.3V (mandatory, otherwise the chip won&#039;t listen).&lt;br /&gt;
* GPIO0: Digital I/O pin 0. Tie to 3.3V (optional, but just to make sure as this pin is used in conjunction with RST to program the ESP).&lt;br /&gt;
* GPIO2: Digital I/O pin 2. You can use this pin for your own programs; otherwise just don&#039;t connect it.&lt;br /&gt;
* TX: Transmit. Connect to RXD of the Arduino (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
* RX: Receive. Connect to TXD of the Arduino (using a level shifter if you use the 5V variety of the Arduino).&lt;br /&gt;
&lt;br /&gt;
Regarding the level shifting and voltage conversion: I am using a small COTS board that does both (it&#039;s the larger blue board that the smaller black ESP8266-board is plugged into). That is not a requirement; I&#039;ve been using separate level shifters and voltage converters in some projects. It just means more manual wiring and no cost savings.&lt;br /&gt;
&lt;br /&gt;
=== ESP Troubles===&lt;br /&gt;
&lt;br /&gt;
I have had ESPs that misbehaved a lot, and the chip and the serial connection are prone to problems in general (IMNSHO as I spent many hours on dealing with this).&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;misbehave&amp;quot; I mean:&lt;br /&gt;
&lt;br /&gt;
* Simply not reacting as expected (replying to a command in unexpected ways)&lt;br /&gt;
* Not be able to establish a WLAN or TCP connection&lt;br /&gt;
* Being stuck in some internal odd state that produces gobs of output&lt;br /&gt;
* Random reboots&lt;br /&gt;
&lt;br /&gt;
These problems can all be addressed though. Sometimes a software rest helps (a command sent via the serial interface). Sometime a hardware reset is required. On rarer occasions the power needs to be cycled. My software stack uses software and hardware resets. In order to perform hardware resets I connect an Arduino I/O pin to the ESP reset pin (the library supports this). It would be easy to extend that scheme to cycling the power by using another I/O pin, and a transistor that switches the chip off and on again.&lt;br /&gt;
&lt;br /&gt;
The ESP is its own computer on a chip, just like the Arduino. And it can be programmed by you, just like an Arduino. For why I don&#039;t use it &#039;&#039;instead&#039;&#039; of an Arduino, please see the next section.&lt;br /&gt;
&lt;br /&gt;
==Why not just an ESP8266?==&lt;br /&gt;
&lt;br /&gt;
Good question! Less hardware, more memory, direct function calls instead of serial communications all sound good. But, the Arduino has more I/O pins. I found programming the ESP is slow, and the ESP is less forgiving when it is handled the wrong way, be it hardware or even software. I fried an ESP by just trying to &amp;quot;blink&amp;quot; all I/O pins, to find out which number corresponds to which pin. After that the ESP did not interact with the programmer any more :-(.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=245</id>
		<title>AME Hardware</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=245"/>
		<updated>2018-06-19T22:33:44Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* ESP8266 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Hardware)=&lt;br /&gt;
&lt;br /&gt;
[[File:20170802T115833.jpg|left|thumb|600px|Voltage controller (left), Arduino (top right), and ESP8266 (bottom right)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
The Arduino is a computer on a chip - CPU, memory for programs (ROM, flashable), memory for variables (RAM, volatile), memory for data (EPROM, non-volatile, runtime-programmable), counters, timers, I/O pins, and various interfaces (shared with the I/O pins; interrupts, serial, I2C, SPI). Different models offer different amounts of assets.&lt;br /&gt;
&lt;br /&gt;
Cheap versions can be ordered from Chinese suppliers for 2.50€ a piece. I&#039;m using them all the time, and they just work fine (didn&#039;t have a single dud in 20+ Arduinos).&lt;br /&gt;
&lt;br /&gt;
==ESP8266==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039; &#039;&#039;&#039;Work in progress, stand by. Some information may be plain wrong, so... Last edit 19.06.2018.&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ESP8266 is IP- and WLAN-connectivity on a chip - SSL, TCP, UDP, WLAN; as a client or even as an access point (limited to 4 connections).&lt;br /&gt;
&lt;br /&gt;
The chip supports a number of modes that exclude each other:&lt;br /&gt;
&lt;br /&gt;
* Single/ multiple connection. Determines if only a single connection can be active at the same time, or up to four connections. The mode can only be changed if there currently is no connection. For SSL only single connection mode is supported (I guess SSL is too demanding for multiple connections). Multiple connection mode is required for server mode. Why would you limit yourself to a single connection? I don&#039;t know, but I use single connection mode because I need only one connection (to the MQTT broker), and sending out commands and parsing replies is more complex in multiple connection mode.&lt;br /&gt;
* IP client/ server mode. Determines if the chips opens connections as a client or if it accepts incoming connections as a server. The latter requires multiple connection mode.&lt;br /&gt;
* WLAN station/ AP mode. Determines if the chip acts as a client that logs into an existing WLAN or if the chip acts as a WLAN access points which other clients can connect to. &lt;br /&gt;
&lt;br /&gt;
I have had ESPs that misbehaved a lot, and the chip and the serial connection are prone to problems in general (IMHO!). With &amp;quot;misbehave&amp;quot; I mean:&lt;br /&gt;
&lt;br /&gt;
* Simply not reacting as expected (replying to a command in unexpected ways)&lt;br /&gt;
* Not be able to establish a WLAN or TCP connection&lt;br /&gt;
* Being stuck in some internal odd state that produces gobs of output&lt;br /&gt;
* Random reboots&lt;br /&gt;
&lt;br /&gt;
These problems can all be addressed though. Sometimes a software rest helps (a command sent via the serial interface). Sometime a hardware reset is required. On rarer occasions the power needs to be cycled. My software stack uses software and hardware resets. In order to perform hardware resets I connect an Arduino I/O pin to the ESP reset pin (the library supports this). It would be easy to extend that scheme to cycling the power by using another I/O pin, and a transistor that switches the chip off and on again.&lt;br /&gt;
&lt;br /&gt;
The ESP is its own computer on a chip, just like the Arduino. And it can be programmed by you, just like an Arduino. For why I don&#039;t use it &#039;&#039;instead&#039;&#039; of an Arduino, please see the next section.&lt;br /&gt;
&lt;br /&gt;
==Why not just an ESP8266?==&lt;br /&gt;
&lt;br /&gt;
Good question! Less hardware, more memory, direct function calls instead of serial communications all sound good. But, the Arduino has more I/O pins. I found programming the ESP is slow, and the ESP is less forgiving when it is handled the wrong way, be it hardware or even software. I fried an ESP by just trying to blink on all I/O pins, to find out which number corresponds to which pin. After the ESP did not interact with the programmer any more.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=244</id>
		<title>AME Hardware</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=244"/>
		<updated>2018-06-19T22:33:04Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Hardware)=&lt;br /&gt;
&lt;br /&gt;
[[File:20170802T115833.jpg|left|thumb|600px|Voltage controller (left), Arduino (top right), and ESP8266 (bottom right)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
The Arduino is a computer on a chip - CPU, memory for programs (ROM, flashable), memory for variables (RAM, volatile), memory for data (EPROM, non-volatile, runtime-programmable), counters, timers, I/O pins, and various interfaces (shared with the I/O pins; interrupts, serial, I2C, SPI). Different models offer different amounts of assets.&lt;br /&gt;
&lt;br /&gt;
Cheap versions can be ordered from Chinese suppliers for 2.50€ a piece. I&#039;m using them all the time, and they just work fine (didn&#039;t have a single dud in 20+ Arduinos).&lt;br /&gt;
&lt;br /&gt;
==ESP8266==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039; &#039;&#039;&#039;Work in progress, stand by. Some information may be plain wrong, so... Last edit 19.06.2018.&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ESP8266 is IP and WLAN on a chip - SSL, TCP, UDP, WLAN, as a client or even as an access point (limited to 4 connections).&lt;br /&gt;
&lt;br /&gt;
The chip supports a number of modes that exclude each other:&lt;br /&gt;
&lt;br /&gt;
* Single/ multiple connection. Determines if only a single connection can be active at the same time, or up to four connections. The mode can only be changed if there currently is no connection. For SSL only single connection mode is supported (I guess SSL is too demanding for multiple connections). Multiple connection mode is required for server mode. Why would you limit yourself to a single connection? I don&#039;t know, but I use single connection mode because I need only one connection (to the MQTT broker), and sending out commands and parsing replies is more complex in multiple connection mode.&lt;br /&gt;
* IP client/ server mode. Determines if the chips opens connections as a client or if it accepts incoming connections as a server. The latter requires multiple connection mode.&lt;br /&gt;
* WLAN station/ AP mode. Determines if the chip acts as a client that logs into an existing WLAN or if the chip acts as a WLAN access points which other clients can connect to. &lt;br /&gt;
&lt;br /&gt;
I have had ESPs that misbehaved a lot, and the chip and the serial connection are prone to problems in general (IMHO!). With &amp;quot;misbehave&amp;quot; I mean:&lt;br /&gt;
&lt;br /&gt;
* Simply not reacting as expected (replying to a command in unexpected ways)&lt;br /&gt;
* Not be able to establish a WLAN or TCP connection&lt;br /&gt;
* Being stuck in some internal odd state that produces gobs of output&lt;br /&gt;
* Random reboots&lt;br /&gt;
&lt;br /&gt;
These problems can all be addressed though. Sometimes a software rest helps (a command sent via the serial interface). Sometime a hardware reset is required. On rarer occasions the power needs to be cycled. My software stack uses software and hardware resets. In order to perform hardware resets I connect an Arduino I/O pin to the ESP reset pin (the library supports this). It would be easy to extend that scheme to cycling the power by using another I/O pin, and a transistor that switches the chip off and on again.&lt;br /&gt;
&lt;br /&gt;
The ESP is its own computer on a chip, just like the Arduino. And it can be programmed by you, just like an Arduino. For why I don&#039;t use it &#039;&#039;instead&#039;&#039; of an Arduino, please see the next section.&lt;br /&gt;
&lt;br /&gt;
==Why not just an ESP8266?==&lt;br /&gt;
&lt;br /&gt;
Good question! Less hardware, more memory, direct function calls instead of serial communications all sound good. But, the Arduino has more I/O pins. I found programming the ESP is slow, and the ESP is less forgiving when it is handled the wrong way, be it hardware or even software. I fried an ESP by just trying to blink on all I/O pins, to find out which number corresponds to which pin. After the ESP did not interact with the programmer any more.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=243</id>
		<title>AME Software</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=243"/>
		<updated>2018-06-19T22:29:50Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Stack (Software)=&lt;br /&gt;
&lt;br /&gt;
[[File:The_AME_Stack_(Software).png|left|thumb|1200px|Class structure (operations incomplete)]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess. &lt;br /&gt;
&lt;br /&gt;
==AC_TCP_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
==AC_MTTQ==&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
==AC_IoT/ Devices==&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=File:The_AME_Stack_(Software).png&amp;diff=242</id>
		<title>File:The AME Stack (Software).png</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=File:The_AME_Stack_(Software).png&amp;diff=242"/>
		<updated>2018-06-19T22:26:20Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=IoT_with_AME&amp;diff=241</id>
		<title>IoT with AME</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=IoT_with_AME&amp;diff=241"/>
		<updated>2018-06-19T22:19:35Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=IoT with AME - The Internet of Things, with Arduino, MQTT, and ESP8266=&lt;br /&gt;
&lt;br /&gt;
[[File:20170802T115833.jpg|thumb|left|300px|Voltage controller (left), status LED (RGB; top), Arduino (top right), ESP8266 (bottom right, on adapter) - My standard hardware stack]] This is work in progress started in June 2017 - I am in the process of typing out my experiences with IoT, Arduino, and ESP8266, as a documentation for myself and as something that might be helpful to others.&lt;br /&gt;
&lt;br /&gt;
* [[The AME Stack]] - A compact software and hardware stack to build MQTT-connected IoT devices&lt;br /&gt;
* [[My IoT projects]] - What I built over time (plenty!)&lt;br /&gt;
* [[MQTT]] - A protocol for connecting IoT devices&lt;br /&gt;
* [[Software Stack|Software]]: Libraries for devices and capabilities, and access on MQTT-, TCP-, WLAN-, and chip level&lt;br /&gt;
* [[Software Problems]]: C++ and very small memory pose diverse challenges&lt;br /&gt;
* [[Hardware Stack|Hardware]]: Arduino, ESP8266, and additional hardware&lt;br /&gt;
* [[Hardware Problems]]: Bugs are not limited to software - plain electricity can be tricky, too!&lt;br /&gt;
* [[Challenges]] - How to overcome hardware and software limitations&lt;br /&gt;
* [[IoT Management]] - How to manage an IoT installation&lt;br /&gt;
* [[To Do]] - What I would like to improve and add in this Wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;Note to self (help on MediaWiki):&lt;br /&gt;
&lt;br /&gt;
* https://www.mediawiki.org/wiki/Manual:FAQ&lt;br /&gt;
* https://en.wikipedia.org/wiki/Help:Wiki_markup&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=240</id>
		<title>AME Hardware</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=240"/>
		<updated>2018-06-19T13:25:48Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* ESP8266 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Hardware=&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
The Arduino is a computer on a chip - CPU, memory for programs (ROM, flashable), memory for variables (RAM, volatile), memory for data (EPROM, non-volatile, runtime-programmable), counters, timers, I/O pins, and various interfaces (shared with the I/O pins; interrupts, serial, I2C, SPI). Different models offer different amounts of assets.&lt;br /&gt;
&lt;br /&gt;
Cheap versions can be ordered from Chinese suppliers for 2.50€ a piece. I&#039;m using them all the time, and they just work fine (didn&#039;t have a single dud in 20+ Arduinos).&lt;br /&gt;
&lt;br /&gt;
==ESP8266==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039; &#039;&#039;&#039;Work in progress, stand by. Some information may be plain wrong, so... Last edit 19.06.2018.&#039;&#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ESP8266 is IP and WLAN on a chip - SSL, TCP, UDP, WLAN, as a client or even as an access point (limited to 4 connections).&lt;br /&gt;
&lt;br /&gt;
The chip supports a number of modes that exclude each other:&lt;br /&gt;
&lt;br /&gt;
* Single/ multiple connection. Determines if only a single connection can be active at the same time, or up to four connections. The mode can only be changed if there currently is no connection. For SSL only single connection mode is supported (I guess SSL is too demanding for multiple connections). Multiple connection mode is required for server mode. Why would you limit yourself to a single connection? I don&#039;t know, but I use single connection mode because I need only one connection (to the MQTT broker), and sending out commands and parsing replies is more complex in multiple connection mode.&lt;br /&gt;
* IP client/ server mode. Determines if the chips opens connections as a client or if it accepts incoming connections as a server. The latter requires multiple connection mode.&lt;br /&gt;
* WLAN station/ AP mode. Determines if the chip acts as a client that logs into an existing WLAN or if the chip acts as a WLAN access points which other clients can connect to. &lt;br /&gt;
&lt;br /&gt;
I have had ESPs that misbehaved a lot, and the chip and the serial connection are prone to problems in general (IMHO!). With &amp;quot;misbehave&amp;quot; I mean:&lt;br /&gt;
&lt;br /&gt;
* Simply not reacting as expected (replying to a command in unexpected ways)&lt;br /&gt;
* Not be able to establish a WLAN or TCP connection&lt;br /&gt;
* Being stuck in some internal odd state that produces gobs of output&lt;br /&gt;
* Random reboots&lt;br /&gt;
&lt;br /&gt;
These problems can all be addressed though. Sometimes a software rest helps (a command sent via the serial interface). Sometime a hardware reset is required. On rarer occasions the power needs to be cycled. My software stack uses software and hardware resets. In order to perform hardware resets I connect an Arduino I/O pin to the ESP reset pin (the library supports this). It would be easy to extend that scheme to cycling the power by using another I/O pin, and a transistor that switches the chip off and on again.&lt;br /&gt;
&lt;br /&gt;
The ESP is its own computer on a chip, just like the Arduino. And it can be programmed by you, just like an Arduino. For why I don&#039;t use it &#039;&#039;instead&#039;&#039; of an Arduino, please see the next section.&lt;br /&gt;
&lt;br /&gt;
==Why not just an ESP8266?==&lt;br /&gt;
&lt;br /&gt;
Good question! Less hardware, more memory, direct function calls instead of serial communications all sound good. But, the Arduino has more I/O pins. I found programming the ESP is slow, and the ESP is less forgiving when it is handled the wrong way, be it hardware or even software. I fried an ESP by just trying to blink on all I/O pins, to find out which number corresponds to which pin. After the ESP did not interact with the programmer any more.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=239</id>
		<title>AME Hardware</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Hardware&amp;diff=239"/>
		<updated>2018-06-19T10:16:21Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Created page with &amp;quot;The AME Stack  =AME Hardware=  ==Arduino==  The Arduino is a computer on a chip - CPU, memory for programs (ROM, flashable), memory for variables (RAM, volatile), memory f...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Hardware=&lt;br /&gt;
&lt;br /&gt;
==Arduino==&lt;br /&gt;
&lt;br /&gt;
The Arduino is a computer on a chip - CPU, memory for programs (ROM, flashable), memory for variables (RAM, volatile), memory for data (EPROM, non-volatile, runtime-programmable), counters, timers, I/O pins, and various interfaces (shared with the I/O pins; interrupts, serial, I2C, SPI). Different models offer different amounts of assets.&lt;br /&gt;
&lt;br /&gt;
Cheap versions can be ordered from Chinese suppliers for 2.50€ a piece. I&#039;m using them all the time, and they just work fine (didn&#039;t have a single dud in 20+ Arduinos).&lt;br /&gt;
&lt;br /&gt;
==ESP8266==&lt;br /&gt;
&lt;br /&gt;
The ESP8266 is IP and WLAN on a chip - SSL, TCP, UDP, WLAN, as a client or even as an access point (limited to 4 connections).&lt;br /&gt;
&lt;br /&gt;
The ESP is its own microcomputer, just like the Arduino. And it can be programmed, just like an Arduino.&lt;br /&gt;
&lt;br /&gt;
==Why not just an ESP8266?==&lt;br /&gt;
&lt;br /&gt;
Good question! Less hardware, more memory, direct function calls instead of serial communications all sound good. But, the Arduino has more I/O pins. I found programming the ESP is slow, and the ESP is less forgiving when it is handled the wrong way, be it hardware or even software. I fried an ESP by just trying to blink on all I/O pins, to find out which number corresponds to which pin. After the ESP did not interact with the programmer any more.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=238</id>
		<title>AME Software</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Software&amp;diff=238"/>
		<updated>2018-06-19T09:33:56Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Created page with &amp;quot;The AME Stack  =AME Software=  ==AC_ESP8266==  AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Software=&lt;br /&gt;
&lt;br /&gt;
==AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess. &lt;br /&gt;
&lt;br /&gt;
==AC_TCP_ESP8266==&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
==AC_MTTQ==&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
==AC_IoT/ Devices==&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=237</id>
		<title>The AME Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=237"/>
		<updated>2018-06-19T09:31:22Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Replaced content with &amp;quot;Home  =The AME Stack=  * Design Goals * Software * Hardware * AME_Status_and_Logging|Status Information...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=The AME Stack=&lt;br /&gt;
&lt;br /&gt;
* [[AME_Goals|Design Goals]]&lt;br /&gt;
* [[AME_Software|Software]]&lt;br /&gt;
* [[AME_Hardware|Hardware]]&lt;br /&gt;
* [[AME_Status_and_Logging|Status Information and Logging]]&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Status_and_Logging&amp;diff=236</id>
		<title>AME Status and Logging</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Status_and_Logging&amp;diff=236"/>
		<updated>2018-06-19T09:29:05Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Created page with &amp;quot;The AME Stack  =AME Status Information and Logging=  Since a whole bunch of components are working together things can get tough when there is a problem.  The AME stack pr...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Status Information and Logging=&lt;br /&gt;
&lt;br /&gt;
Since a whole bunch of components are working together things can get tough when there is a problem.&lt;br /&gt;
&lt;br /&gt;
The AME stack provides logging via I2C and status information via a RGB-LED.&lt;br /&gt;
&lt;br /&gt;
Logging can be switched off in production &lt;br /&gt;
&lt;br /&gt;
* at build time by simply not compiling it in at all (thus saving space as well) or &lt;br /&gt;
* at runtime via switching an I/O pin on or off on Arduino reset&lt;br /&gt;
&lt;br /&gt;
The status LED is programmable and consumes only one Arduino pin. It is able to provide quite a bit of useful information!&lt;br /&gt;
&lt;br /&gt;
* Regarding the WLAN connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* Regarding the TCP connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* When the MQTT connection is in place&lt;br /&gt;
** The LED twitches every second, indicating the Arduino is running and not stuck in an endless loop&lt;br /&gt;
** Every time a message is sent, it flashes in blue, indicating the attempt is being made&lt;br /&gt;
** Every time a message is received, it flashes in ???, indicating a message has been received (the broker did sent it our way)&lt;br /&gt;
** Every time a ping response is received, it changes color (either green or magenta), indicating pings are being sent &#039;&#039;and&#039;&#039; received (the broker replied)&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Goals&amp;diff=235</id>
		<title>AME Goals</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Goals&amp;diff=235"/>
		<updated>2018-06-19T09:27:36Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
=AME Design Goals=&lt;br /&gt;
&lt;br /&gt;
Functional design goals:&lt;br /&gt;
&lt;br /&gt;
* Support deployment of multiple devices of the same kind, without having to change the configuration in multiple files&lt;br /&gt;
* Simply add standard-capabilities like measuring temperature or switching a relay to a device&lt;br /&gt;
* Provide status information for debugging and operations, without consuming too much memory and processing time&lt;br /&gt;
&lt;br /&gt;
Architectural design goals:&lt;br /&gt;
&lt;br /&gt;
* Have MQTT interface with TCP, not with the ESP8266&lt;br /&gt;
* Use streaming instead of a chain of buffers, as buffers are limited and awkward to handle (make them too big and memory is gone; make them too small and you&#039;ll get overruns)&lt;br /&gt;
* I want my code to be readable by humans. And, yes, this can be done. Even in the limited Arduino environment. Without compromising speed and memory consumption.&lt;br /&gt;
&lt;br /&gt;
Hardware design goals:&lt;br /&gt;
&lt;br /&gt;
* As little wiring as possible, as wiring is tiring after when assembling multiple devices&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=234</id>
		<title>The AME Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=234"/>
		<updated>2018-06-19T09:24:43Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=The AME Stack=&lt;br /&gt;
&lt;br /&gt;
* [[AME_Goals|Design Goals]]&lt;br /&gt;
&lt;br /&gt;
===AC_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess. &lt;br /&gt;
&lt;br /&gt;
===AC_TCP_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
===AC_MTTQ===&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
===AC_IoT/ Devices===&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
===Capabilities===&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
==Status Information and Logging==&lt;br /&gt;
&lt;br /&gt;
Since a whole bunch of components are working together things can get tough when there is a problem.&lt;br /&gt;
&lt;br /&gt;
The AME stack provides logging via I2C and status information via a RGB-LED.&lt;br /&gt;
&lt;br /&gt;
Logging can be switched off in production &lt;br /&gt;
&lt;br /&gt;
* at build time by simply not compiling it in at all (thus saving space as well) or &lt;br /&gt;
* at runtime via switching an I/O pin on or off on Arduino reset&lt;br /&gt;
&lt;br /&gt;
The status LED is programmable and consumes only one Arduino pin. It is able to provide quite a bit of useful information!&lt;br /&gt;
&lt;br /&gt;
* Regarding the WLAN connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* Regarding the TCP connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* When the MQTT connection is in place&lt;br /&gt;
** The LED twitches every second, indicating the Arduino is running and not stuck in an endless loop&lt;br /&gt;
** Every time a message is sent, it flashes in blue, indicating the attempt is being made&lt;br /&gt;
** Every time a message is received, it flashes in ???, indicating a message has been received (the broker did sent it our way)&lt;br /&gt;
** Every time a ping response is received, it changes color (either green or magenta), indicating pings are being sent &#039;&#039;and&#039;&#039; received (the broker replied)&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=AME_Goals&amp;diff=233</id>
		<title>AME Goals</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=AME_Goals&amp;diff=233"/>
		<updated>2018-06-19T09:24:39Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Created page with &amp;quot;The AME Stack  Functional design goals:  * Support deployment of multiple devices of the same kind, without having to change the configuration in multiple files * Simply a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The AME Stack]]&lt;br /&gt;
&lt;br /&gt;
Functional design goals:&lt;br /&gt;
&lt;br /&gt;
* Support deployment of multiple devices of the same kind, without having to change the configuration in multiple files&lt;br /&gt;
* Simply add standard-capabilities like measuring temperature or switching a relay to a device&lt;br /&gt;
* Provide status information for debugging and operations, without consuming too much memory and processing time&lt;br /&gt;
&lt;br /&gt;
Architectural design goals:&lt;br /&gt;
&lt;br /&gt;
* Have MQTT interface with TCP, not with the ESP8266&lt;br /&gt;
* Use streaming instead of a chain of buffers, as buffers are limited and awkward to handle (make them too big and memory is gone; make them too small and you&#039;ll get overruns)&lt;br /&gt;
* I want my code to be readable by humans. And, yes, this can be done. Even in the limited Arduino environment. Without compromising speed and memory consumption.&lt;br /&gt;
&lt;br /&gt;
Hardware design goals:&lt;br /&gt;
&lt;br /&gt;
* As little wiring as possible, as wiring is tiring after when assembling multiple devices&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=232</id>
		<title>The AME Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=232"/>
		<updated>2018-06-19T09:14:31Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=The AME Stack=&lt;br /&gt;
&lt;br /&gt;
Functional design goals:&lt;br /&gt;
&lt;br /&gt;
* Support deployment of multiple devices of the same kind, without having to change the configuration in multiple files&lt;br /&gt;
* Simply add standard-capabilities like measuring temperature or switching a relay to a device&lt;br /&gt;
* Provide status information for debugging and operations, without consuming too much memory and processing time&lt;br /&gt;
&lt;br /&gt;
Architectural design goals:&lt;br /&gt;
&lt;br /&gt;
* Have MQTT interface with TCP, not with the ESP8266&lt;br /&gt;
* Use streaming instead of a chain of buffers, as buffers are limited and awkward to handle (make them too big and memory is gone; make them too small and you&#039;ll get overruns)&lt;br /&gt;
* I want my code to be readable by humans. And, yes, this can be done. Even in the limited Arduino environment. Without compromising speed and memory consumption.&lt;br /&gt;
&lt;br /&gt;
Hardware design goals:&lt;br /&gt;
&lt;br /&gt;
* As little wiring as possible, as wiring is tiring after when assembling multiple devices&lt;br /&gt;
&lt;br /&gt;
And thus generation 3 of my MQTT stack was born (and it is still growing up).&lt;br /&gt;
&lt;br /&gt;
===AC_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess. &lt;br /&gt;
&lt;br /&gt;
===AC_TCP_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
===AC_MTTQ===&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
===AC_IoT/ Devices===&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
===Capabilities===&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
==Status Information and Logging==&lt;br /&gt;
&lt;br /&gt;
Since a whole bunch of components are working together things can get tough when there is a problem.&lt;br /&gt;
&lt;br /&gt;
The AME stack provides logging via I2C and status information via a RGB-LED.&lt;br /&gt;
&lt;br /&gt;
Logging can be switched off in production &lt;br /&gt;
&lt;br /&gt;
* at build time by simply not compiling it in at all (thus saving space as well) or &lt;br /&gt;
* at runtime via switching an I/O pin on or off on Arduino reset&lt;br /&gt;
&lt;br /&gt;
The status LED is programmable and consumes only one Arduino pin. It is able to provide quite a bit of useful information!&lt;br /&gt;
&lt;br /&gt;
* Regarding the WLAN connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* Regarding the TCP connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* When the MQTT connection is in place&lt;br /&gt;
** The LED twitches every second, indicating the Arduino is running and not stuck in an endless loop&lt;br /&gt;
** Every time a message is sent, it flashes in blue, indicating the attempt is being made&lt;br /&gt;
** Every time a message is received, it flashes in ???, indicating a message has been received (the broker did sent it our way)&lt;br /&gt;
** Every time a ping response is received, it changes color (either green or magenta), indicating pings are being sent &#039;&#039;and&#039;&#039; received (the broker replied)&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=231</id>
		<title>The AME Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=231"/>
		<updated>2018-06-19T09:00:35Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=The AME Stack=&lt;br /&gt;
&lt;br /&gt;
Functional design goals:&lt;br /&gt;
&lt;br /&gt;
* Support deployment of multiple devices of the same kind, without having to change the configuration in multiple files&lt;br /&gt;
* Simply add standard-capabilities like measuring temperature or switching a relay to a device&lt;br /&gt;
* Provide status information for debugging and operations, without consuming too much memory and processing time&lt;br /&gt;
&lt;br /&gt;
Architectural design goals:&lt;br /&gt;
&lt;br /&gt;
* Have MQTT interface with TCP, not with the ESP8266&lt;br /&gt;
* Use streaming instead of a chain of buffers, as buffers are limited and awkward to handle (make them too big and memory is gone; make them too small and you&#039;ll get overruns)&lt;br /&gt;
* I want my code to be readable by humans. And, yes, this can be done. Even in the limited Arduino environment. Without compromising speed and memory consumption.&lt;br /&gt;
&lt;br /&gt;
Hardware design goals:&lt;br /&gt;
&lt;br /&gt;
* As little wiring as possible, as wiring is tiring after when assembling multiple devices&lt;br /&gt;
&lt;br /&gt;
And thus generation 3 of my MQTT stack was born (and it is still growing up).&lt;br /&gt;
&lt;br /&gt;
===AC_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess. &lt;br /&gt;
&lt;br /&gt;
===AC_TCP_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
===AC_MTTQ===&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
===AC_IoT/ Devices===&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
===Capabilities===&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
==Status Information and Logging==&lt;br /&gt;
&lt;br /&gt;
Since a whole bunch of components are working together things can get tough when there is a problem.&lt;br /&gt;
&lt;br /&gt;
The AME stack provides logging via I2C and status information via a RGB-LED.&lt;br /&gt;
&lt;br /&gt;
Logging can be switched off in production &lt;br /&gt;
&lt;br /&gt;
* at build time by simply not compiling it in at all (thus saving space as well) or &lt;br /&gt;
* at runtime via switching an I/O pin on or off on Arduino reset&lt;br /&gt;
&lt;br /&gt;
The status LED is programmable and consumes only one Arduino pin. It is able to provide quite a bit of useful information!&lt;br /&gt;
&lt;br /&gt;
* Regarding the WLAN connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* Regarding the TCP connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* When the MQTT connection is in place&lt;br /&gt;
** The LED twitches every second, indicating the Arduino is running and not stuck in an endless loop&lt;br /&gt;
** Every time a message is sent, it flashes in blue, indicating the attempt is being made&lt;br /&gt;
** Every time a message is received, it flashes in ???, indicating a message has been received (the broker did sent it our way)&lt;br /&gt;
** Every time a ping response is received, it changes color (either green or magenta), indicating pings are being sent &#039;&#039;and&#039;&#039; received (the broker replied)&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=230</id>
		<title>The AME Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=230"/>
		<updated>2018-06-18T09:02:27Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* The AME Stack */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=The AME Stack=&lt;br /&gt;
&lt;br /&gt;
Functional design goals:&lt;br /&gt;
&lt;br /&gt;
* Support deployment of multiple devices of the same kind, without having to change the configuration in multiple files&lt;br /&gt;
* Simply add standard-capabilities like measuring temperature or switching a relay to a device&lt;br /&gt;
* Provide status information for debugging and operations, without consuming too much memory and processing time&lt;br /&gt;
&lt;br /&gt;
Architectural design goals:&lt;br /&gt;
&lt;br /&gt;
* Have MQTT interface with TCP, not with the ESP8266&lt;br /&gt;
* Use streaming instead of a chain of buffers, as buffers are limited and awkward to handle (make them too big and memory is gone; make them too small and you&#039;ll get overruns)&lt;br /&gt;
* I want my code to be readable by humans. And, yes, this can be done. Even in the limited Arduino environment. Without compromising speed and memory consumption.&lt;br /&gt;
&lt;br /&gt;
Hardware design goals:&lt;br /&gt;
&lt;br /&gt;
* As little wiring as possible, as wiring is tiring after when assembling multiple devices&lt;br /&gt;
&lt;br /&gt;
And thus generation 3 of my MQTT stack was born (and it is still growing up).&lt;br /&gt;
&lt;br /&gt;
===AC_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) clever functions to compose commands and to parse responses based on pattern expansion/ matching. &lt;br /&gt;
&lt;br /&gt;
The buffer used for command assembly and response parsing is the only one in the whole class. Writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
Regarding command assembly and response parsing I think even that could be migrated to streaming mode, though pattern matching would be not that easy, I guess. &lt;br /&gt;
&lt;br /&gt;
===AC_TCP_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity.&lt;br /&gt;
&lt;br /&gt;
It does what is required to get the ESP working again, which, frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP).&lt;br /&gt;
&lt;br /&gt;
If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
===AC_MTTQ===&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1. More honestly QoS &amp;quot;0.5&amp;quot; as it properly produces ACK messages to the broker, but arriving ACKs are discarded and missing ACKs don&#039;t prompt retries).&lt;br /&gt;
&lt;br /&gt;
Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
===AC_IoT/ Devices===&lt;br /&gt;
&lt;br /&gt;
Devices are derived from AC_IoT. AC_IoT provides convenience on device level with concepts such as centrally configured device name and MQTT-ID that get used wherever appropriate.&lt;br /&gt;
&lt;br /&gt;
In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden01&amp;quot; as a prefix for topics in publications and subscriptions of its capabilities.&lt;br /&gt;
&lt;br /&gt;
When the MQTT connection is established AC_IoT reports the version of the IoT framework, the device version, the IP and MAC addresses, and the number of connect attempts.&lt;br /&gt;
&lt;br /&gt;
In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
===Capabilities===&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off).&lt;br /&gt;
&lt;br /&gt;
A capability encapsulates hardware intricacies, possess a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produce publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. &lt;br /&gt;
&lt;br /&gt;
Building on the example above, publications would use the topics&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/pressure&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/temperature&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden01/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden01/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden01/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
==Status Information and Logging==&lt;br /&gt;
&lt;br /&gt;
Since a whole bunch of components are working together things can get tough when there is a problem.&lt;br /&gt;
&lt;br /&gt;
The AME stack provides logging via I2C and status information via a RGB-LED.&lt;br /&gt;
&lt;br /&gt;
Logging can be switched off in production &lt;br /&gt;
&lt;br /&gt;
* at build time by simply not compiling it in at all (thus saving space as well) or &lt;br /&gt;
* at runtime via switching an I/O pin on or off on Arduino reset&lt;br /&gt;
&lt;br /&gt;
The status LED is programmable and consumes only one Arduino pin. It is able to provide quite a bit of useful information!&lt;br /&gt;
&lt;br /&gt;
* Regarding the WLAN connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* Regarding the TCP connection:&lt;br /&gt;
** Description to be done (no connection/ trying/ connected)&lt;br /&gt;
* When the MQTT connection is in place&lt;br /&gt;
** The LED twitches every second, indicating the Arduino is running and not stuck in an endless loop&lt;br /&gt;
** Every time a message is sent, it flashes in blue, indicating the attempt is being made&lt;br /&gt;
** Every time a message is received, it flashes in ???, indicating a message has been received (the broker did sent it our way)&lt;br /&gt;
** Every time a ping response is received, it changes color (either green or magenta), indicating pings are being sent &#039;&#039;and&#039;&#039; received (the broker replied)&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Software_Stack&amp;diff=229</id>
		<title>Software Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Software_Stack&amp;diff=229"/>
		<updated>2018-06-18T08:33:15Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* Software for Building IoT Devices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Software for Building IoT Devices=&lt;br /&gt;
&lt;br /&gt;
==Generation 1: PubSubClient, ESP8266Client, ITEADLIB Arduino WeeESP8266==&lt;br /&gt;
&lt;br /&gt;
This is the stack I used first, and for quite some time:&lt;br /&gt;
&lt;br /&gt;
* MQTT client: PubSubClient. Regarding the data connection it is based on the standard Arduino Client interface.&lt;br /&gt;
* Client: ESP8266Client: This is a library I wrote that provides a Client facade to the ITEADLIB Arduino WeeESP8266 lib. It deals with ESP8266 misbehavior that can&#039;t be handled on the ESP8266 level itself (like, lost TCP or WLAN connectivity).&lt;br /&gt;
* ESP8266: ITEADLIB Arduino WeeESP8266. This library is quite voluminous (in example, because of the use of String) and has a few small bugs&lt;br /&gt;
&lt;br /&gt;
==Generation 2: AC_MQTT &amp;amp; AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
After dealing with various problems and repairing and optimizing things to a degree I finally did what all programmers must do at some point: rewrite the whole damn thing :-) &lt;br /&gt;
&lt;br /&gt;
* MQTT client: AC_MQTT. Compact and easy to understand code implementing MQTT operation for QoS levels 0 and 1. Does not reserve buffers and performs only streaming read and write operations.&lt;br /&gt;
* &amp;quot;Client&amp;quot;: AC_ESP8266Client. This is NOT the Arduino standard Client interface, but a tighter integration between AC_MQTT and AC_ESP8266. While it would have been nice to stick to the Arduino Client interface I found this requires too much of a compromise in terms of excessive memory use and type of access (&amp;quot;Client&amp;quot; is rather serial while the ESP8266 expects reading and writing buffers). It deals with all kinds of problems like WLAN and TCP connection troubles and general ESP8266 misbehavior. Depending on the hardware provided it can even hardware-reset or power-cycle the ESP8266 if necessary. It can even power-cycle a router if so required (yes, sometimes a mobile Internet router deserves and profits from a kick).&lt;br /&gt;
* ESP8266: AC_ESP8266. The library only provides access to ESP functions that are needed for MQTT communications. The code is pretty compact as it does not reserve buffers on its own (though it relies on buffers provided by clients). It provides a callback interface in case some data arrived over an IP connection (no need to poll).&lt;br /&gt;
&lt;br /&gt;
My stack does quite a bit more than the stack above regarding error handling, and it does so with less flash and SRAM memory usage while IMHO being more readable at the same time.&lt;br /&gt;
&lt;br /&gt;
==Generation 3: AC_IoT, AC_MQTT, AC_TCP_ESP8266, AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
And while the generation 2 solution was not bad per se I wanted more.&lt;br /&gt;
&lt;br /&gt;
I found that I wanted to deploy multiple devices of the same kind, but without having to change the configuration in multiple files. And I would like to simply plug in capabilities like measuring temperature or switching a relay. From an architectural standpoint, I prefer MQTT to interface with TCP, not with the ESP8266. As buffers are limited and awkward to handle (make them too big and memory is gone; make them too small and you&#039;ll get overruns), streaming is the preferred mode of data exchange. I want my code to be readable by humans. And, yes, this can be done. Even in the limited Arduino environment.&lt;br /&gt;
&lt;br /&gt;
[[The AME Stack|Follow me]] to the detailed description.&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=228</id>
		<title>The AME Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=The_AME_Stack&amp;diff=228"/>
		<updated>2018-06-18T08:31:52Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Created page with &amp;quot; =The AME Stack==  I found that I wanted to deploy multiple devices of the same kind, but without having to change the configuration in multiple files. And I would like to sim...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=The AME Stack==&lt;br /&gt;
&lt;br /&gt;
I found that I wanted to deploy multiple devices of the same kind, but without having to change the configuration in multiple files. And I would like to simply plug in capabilities like measuring temperature or switching a relay. From an architectural standpoint, I prefer MQTT to interface with TCP, not with the ESP8266. As buffers are limited and awkward to handle (make them too big and memory is gone; make them too small and you&#039;ll get overruns), streaming is the preferred mode of data exchange. I want my code to be readable by humans. And, yes, this can be done. Even in the limited Arduino environment.&lt;br /&gt;
&lt;br /&gt;
And thus generation 3 of my MQTT stack was born (and it is still growing up).&lt;br /&gt;
&lt;br /&gt;
===AC_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) pretty clever functions to compose commands and to parse responses based on pattern expansion/ matching. The buffer used for commands and responses is the only one in the whole class, as writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
===AC_TCP_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity and does what is required to get the ESP working again, which,frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP). If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
===AC_MTTQ===&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1 (or more honestly &amp;quot;0.5&amp;quot; as ACKs message from the broker properly, but arriving ACKs are discarded and missing ACKs dont&#039; prompt retries). Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
===AC_IoT===&lt;br /&gt;
&lt;br /&gt;
AC_IoT provides convenience on device level with concepts such as centrally setting a device name and an MQTT-ID that get used wherever appropriate. In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden&amp;quot; as a prefix for topics in publications and subscriptions.&lt;br /&gt;
&lt;br /&gt;
===Devices===&lt;br /&gt;
&lt;br /&gt;
Devices report the version of the IoT framework, their own version, IP and MAC address, and number of connect attempts when the MQTT connection is established. In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
===Capabilities===&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off). A capability encapsulates hardware intricacies, posses a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produces publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. Building on the example above, publications would use the topic &amp;quot;garden/pressure01/pressure&amp;quot; and &amp;quot;garden/pressure01/temperature&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Software_Stack&amp;diff=227</id>
		<title>Software Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Software_Stack&amp;diff=227"/>
		<updated>2018-06-15T18:09:40Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Software for Building IoT Devices=&lt;br /&gt;
&lt;br /&gt;
==Generation 1: PubSubClient, ESP8266Client, ITEADLIB Arduino WeeESP8266==&lt;br /&gt;
&lt;br /&gt;
This is the stack I used first, and for quite some time:&lt;br /&gt;
&lt;br /&gt;
* MQTT client: PubSubClient. Regarding the data connection it is based on the standard Arduino Client interface.&lt;br /&gt;
* Client: ESP8266Client: This is a library I wrote that provides a Client facade to the ITEADLIB Arduino WeeESP8266 lib. It deals with ESP8266 misbehavior that can&#039;t be handled on the ESP8266 level itself (like, lost TCP or WLAN connectivity).&lt;br /&gt;
* ESP8266: ITEADLIB Arduino WeeESP8266. This library is quite voluminous (in example, because of the use of String) and has a few small bugs&lt;br /&gt;
&lt;br /&gt;
==Generation 2: AC_MQTT &amp;amp; AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
After dealing with various problems and repairing and optimizing things to a degree I finally did what all programmers must do at some point: rewrite the whole damn thing :-) &lt;br /&gt;
&lt;br /&gt;
* MQTT client: AC_MQTT. Compact and easy to understand code implementing MQTT operation for QoS levels 0 and 1. Does not reserve buffers and performs only streaming read and write operations.&lt;br /&gt;
* &amp;quot;Client&amp;quot;: AC_ESP8266Client. This is NOT the Arduino standard Client interface, but a tighter integration between AC_MQTT and AC_ESP8266. While it would have been nice to stick to the Arduino Client interface I found this requires too much of a compromise in terms of excessive memory use and type of access (&amp;quot;Client&amp;quot; is rather serial while the ESP8266 expects reading and writing buffers). It deals with all kinds of problems like WLAN and TCP connection troubles and general ESP8266 misbehavior. Depending on the hardware provided it can even hardware-reset or power-cycle the ESP8266 if necessary. It can even power-cycle a router if so required (yes, sometimes a mobile Internet router deserves and profits from a kick).&lt;br /&gt;
* ESP8266: AC_ESP8266. The library only provides access to ESP functions that are needed for MQTT communications. The code is pretty compact as it does not reserve buffers on its own (though it relies on buffers provided by clients). It provides a callback interface in case some data arrived over an IP connection (no need to poll).&lt;br /&gt;
&lt;br /&gt;
My stack does quite a bit more than the stack above regarding error handling, and it does so with less flash and SRAM memory usage while IMHO being more readable at the same time.&lt;br /&gt;
&lt;br /&gt;
==Generation 3: AC_IoT, AC_MQTT, AC_TCP_ESP8266, AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
And while the generation 2 solution was not bad per se I wanted more. I found that I wanted to deploy multiple devices of the same kind, but without having to change the configuration in multiple files. And I would like to simply plug in capabilities like measuring temperature or switching a relay. From an architectural standpoint, I prefer MQTT to interface with TCP, not with the ESP8266. As buffers are limited and awkward to handle (make them too big and memory is gone; make them too small and you&#039;ll get overruns), streaming is the preferred mode of data exchange. I want my code to be readable by humans. And, yes, this can be done. Even in the limited Arduino environment.&lt;br /&gt;
&lt;br /&gt;
And thus generation 3 of my MQTT stack was born (and it is still growing up).&lt;br /&gt;
&lt;br /&gt;
===AC_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_ESP8266 provides access to the ESP8266 on C++ level, no more, no less. It uses two (blowing my own horn) pretty clever functions to compose commands and to parse responses based on pattern expansion/ matching. The buffer used for commands and responses is the only one in the whole class, as writing and reading IP data is performed streaming. Callbacks announce the arrival of data and loss of connection.&lt;br /&gt;
&lt;br /&gt;
===AC_TCP_ESP8266===&lt;br /&gt;
&lt;br /&gt;
AC_TCP_ESP8266 provides streaming TCP functionality based on - you guessed it - the ESP8266. It deals with loss of TCP and WLAN connectivity and does what is required to get the ESP working again, which,frankly sometimes is not easy and a pain in the back. This includes resetting the chip via software and - optionally - hardware (it uses the reset pin of the ESP). If you want to, it even can turn the ESP off and on again. I think that does exhaust all options available.&lt;br /&gt;
&lt;br /&gt;
===AC_MTTQ===&lt;br /&gt;
&lt;br /&gt;
AC_MTTQ provides standard MQTT functions with QoS 0 or 1 (or more honestly &amp;quot;0.5&amp;quot; as ACKs message from the broker properly, but arriving ACKs are discarded and missing ACKs dont&#039; prompt retries). Unlike other libaries AC_MQTT does not get unhappy if a ping response gets lost while performing publish and subscribe operations.&lt;br /&gt;
&lt;br /&gt;
===AC_IoT===&lt;br /&gt;
&lt;br /&gt;
AC_IoT provides convenience on device level with concepts such as centrally setting a device name and an MQTT-ID that get used wherever appropriate. In example, a device with MQTT-ID &amp;quot;garden01&amp;quot; uses &amp;quot;garden&amp;quot; as a prefix for topics in publications and subscriptions.&lt;br /&gt;
&lt;br /&gt;
===Devices===&lt;br /&gt;
&lt;br /&gt;
Devices report the version of the IoT framework, their own version, IP and MAC address, and number of connect attempts when the MQTT connection is established. In example, the messages&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden/versionIoT 1.038&amp;quot;&lt;br /&gt;
* &amp;quot;garden/version 1.010&amp;quot;&lt;br /&gt;
* &amp;quot;garden/connectAttempts 12&amp;quot;&lt;br /&gt;
* &amp;quot;garden/ip 192.168.2.76&amp;quot;&lt;br /&gt;
* &amp;quot;garden/mac 5d:de:ad:be:ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
would be sent.&lt;br /&gt;
&lt;br /&gt;
===Capabilities===&lt;br /&gt;
&lt;br /&gt;
Capabilities can easily be added to a device. For a gardening system you maybe add capabilities &amp;quot;temperature&amp;quot;, &amp;quot;spoil moisture&amp;quot;, &amp;quot;rain&amp;quot;, and &amp;quot;relay&amp;quot; (ie, to turn an irrigation system on and off). A capability encapsulates hardware intricacies, posses a built-in name, and provides configuration options such as a capability ID (a number), update intervals, I/O pins and so on. &lt;br /&gt;
&lt;br /&gt;
In example, a capability encapsulating a BMP280 air pressure and temperature sensor with the built-in name &amp;quot;pressure&amp;quot; has been assigned capability ID &amp;quot;1&amp;quot;. The capability will produces publications at a configurable interval using the name of the device, the name of the capability, the capability ID, and the attribute name. Building on the example above, publications would use the topic &amp;quot;garden/pressure01/pressure&amp;quot; and &amp;quot;garden/pressure01/temperature&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Additionally, Capabilities report their version and input and output parameters when the MQTT connection is established. In example, the messages &lt;br /&gt;
&lt;br /&gt;
* &amp;quot;garden/pressure01/version 1.001&amp;quot;&lt;br /&gt;
* &amp;quot;garden/pressure01/capa01 &amp;lt;pressure:&amp;lt;d&amp;gt;&amp;quot; and &lt;br /&gt;
* &amp;quot;garden/pressure01/capa02 &amp;lt;temperature:&amp;lt;d&amp;gt;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
would be sent, indicating the production of two output attributes with the names &amp;quot;pressure&amp;quot; and &amp;quot;temperature&amp;quot; with numeric output format.&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Challenges&amp;diff=226</id>
		<title>Challenges</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Challenges&amp;diff=226"/>
		<updated>2018-06-15T17:15:16Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Challenges - How to Overcome Hardware and Software Limitations=&lt;br /&gt;
&lt;br /&gt;
The Arduino hardware is very powerful in the sense of provided functionality and bang for the buck. But, resources are pretty limited.&lt;br /&gt;
&lt;br /&gt;
You get &lt;br /&gt;
&lt;br /&gt;
* 32kB of unmodifiable (at run-time) flash memory for the program&lt;br /&gt;
* 2kB of volatile SRAM memory for variables, and &lt;br /&gt;
* 1kB runtime-programmable, non-volatile EEPROM memory for data&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Pretty much any icon on your Linux, Apple, or Windows desktop is bigger then the Arduino flash memory. This is a challenge already at compile time. It gets potentially worse at run time: Processing network data requires buffers, and buffer sizes may be variable. &lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
Another thing is modifiable configuration (in example, WLAN credentials). If you want do to that without re-programming the chip, you need to use an interface of some kind (wireless, SPI/ I2C, or an SD card).&lt;br /&gt;
&lt;br /&gt;
==Updating the Firmware (OTA or Over the Air)==&lt;br /&gt;
&lt;br /&gt;
The Arduino itself does not provide a means to update its flash memory without some external help. But the ESP8266 or another Arduino (€2.50 from China) could do that.&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Software_Stack&amp;diff=225</id>
		<title>Software Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Software_Stack&amp;diff=225"/>
		<updated>2018-06-15T17:09:17Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Software for Building IoT Devices=&lt;br /&gt;
&lt;br /&gt;
==Generation 1: PubSubClient, ESP8266Client, ITEADLIB Arduino WeeESP8266==&lt;br /&gt;
&lt;br /&gt;
This is the stack I used first, and for quite some time:&lt;br /&gt;
&lt;br /&gt;
* MQTT client: PubSubClient. Regarding the data connection it is based on the standard Arduino Client interface.&lt;br /&gt;
* Client: ESP8266Client: This is a library I wrote that provides a Client facade to the ITEADLIB Arduino WeeESP8266 lib. It deals with ESP8266 misbehavior that can&#039;t be handled on the ESP8266 level itself (like, lost TCP or WLAN connectivity).&lt;br /&gt;
* ESP8266: ITEADLIB Arduino WeeESP8266. This library is quite voluminous (in example, because of the use of String) and has a few small bugs&lt;br /&gt;
&lt;br /&gt;
==Generation 2: AC_MQTT &amp;amp; AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
After dealing with various problems and repairing and optimizing things to a degree I finally did what all programmers must do at some point: rewrite the whole damn thing :-) &lt;br /&gt;
&lt;br /&gt;
* MQTT client: AC_MQTT. Compact and easy to understand code implementing MQTT operation for QoS levels 0 and 1. Does not reserve buffers and performs only streaming read and write operations.&lt;br /&gt;
* &amp;quot;Client&amp;quot;: AC_ESP8266Client. This is NOT the Arduino standard Client interface, but a tighter integration between AC_MQTT and AC_ESP8266. While it would have been nice to stick to the Arduino Client interface I found this requires too much of a compromise in terms of excessive memory use and type of access (&amp;quot;Client&amp;quot; is rather serial while the ESP8266 expects reading and writing buffers). It deals with all kinds of problems like WLAN and TCP connection troubles and general ESP8266 misbehavior. Depending on the hardware provided it can even hardware-reset or power-cycle the ESP8266 if necessary. It can even power-cycle a router if so required (yes, sometimes a mobile Internet router deserves and profits from a kick).&lt;br /&gt;
* ESP8266: AC_ESP8266. The library only provides access to ESP functions that are needed for MQTT communications. The code is pretty compact as it does not reserve buffers on its own (though it relies on buffers provided by clients). It provides a callback interface in case some data arrived over an IP connection (no need to poll).&lt;br /&gt;
&lt;br /&gt;
My stack does quite a bit more than the stack above regarding error handling, and it does so with less flash and SRAM memory usage while IMHO being more readable at the same time.&lt;br /&gt;
&lt;br /&gt;
==Generation 3: AC_IoT, AC_MQTT, AC_TCP_ESP8266, AC_ESP8266==&lt;br /&gt;
&lt;br /&gt;
To be done.&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=IoT_Management&amp;diff=224</id>
		<title>IoT Management</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=IoT_Management&amp;diff=224"/>
		<updated>2018-06-15T17:05:46Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=IoT Management - How to Manage an Installation=&lt;br /&gt;
&lt;br /&gt;
Something that I noticed (even) at home: Once you deployed a number of IoT devices, you&#039;ll notice some things need addressing that haven&#039;t crossed your mind before:&lt;br /&gt;
&lt;br /&gt;
* How do I know a device has a problem?&lt;br /&gt;
* What devices are actually deployed? Where?&lt;br /&gt;
* What software versions are in use (IoT framework, devices, capabilities)?&lt;br /&gt;
* What topics are in use? Who is publishing, who is subscribing? What topics are being published and subscribed to? What are the latest messages?&lt;br /&gt;
* How do I secure the whole thing? Currently I rely on the privacy of my WLAN, but I guess message exchange via SSL would be &amp;quot;really nice&amp;quot; (and require a reworking of my infrastructure)&lt;br /&gt;
&lt;br /&gt;
I came up with the following ingredients to the solution&lt;br /&gt;
&lt;br /&gt;
* [[Tools]] to monitor what is going on in the network&lt;br /&gt;
* [[Naming and Behavioral Conventions]] that allow for systematic collection and analysis of data, and for controlling devices&lt;br /&gt;
&lt;br /&gt;
==Operational Status==&lt;br /&gt;
&lt;br /&gt;
All my devices are reporting their status under topic &amp;quot;&amp;lt;mqttID&amp;gt;/status&amp;quot;. Subscribing to &amp;quot;+/status&amp;quot; gives me an overview about what devices are deployed, and how they are doing connection-wise. &lt;br /&gt;
&lt;br /&gt;
Sometime devices even don&#039;t connect or experience other hangups. My devices use a self-developed logging facility called &amp;quot;Logsury&amp;quot; that, among others things, is able to output logging information via I2C. When I connect my programmer to a device I get logging output displayed on a LCD (note to self: extend to main connector to include A4 and A5; there are enough free pins to use). Of course, any other device capable of receiving I2C transmissions can display that information.&lt;br /&gt;
&lt;br /&gt;
==Network==&lt;br /&gt;
&lt;br /&gt;
Similarly, my devices report their IP and MAC addresses. Once devices are able to connect to more than one WLAN, they should report the SSID in use as well. This helps setting up routers, firewalls, and the like.&lt;br /&gt;
&lt;br /&gt;
Additionally, I use a programmable RGB LED to display the (predominantly network) status of the device in a directly observable fashion. I get information about connecting to the WLAN, connecting to the MQTT broker, pings sent and received, and publications send and received. This actually has often helped me to pin-point troubles.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
My devices report the software version of&lt;br /&gt;
&lt;br /&gt;
* the IoT framework&lt;br /&gt;
* the device (like, &amp;quot;gardener&amp;quot;)&lt;br /&gt;
* each capability (like, &amp;quot;watering&amp;quot;, &amp;quot;temperature&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
This allows me to find devices which need to be, or could be updated.&lt;br /&gt;
&lt;br /&gt;
REM The Arduino/ ESP8266 combination I use does NOT allow for over the air updates. But, all devices have a plug that allows for in-place SPI programming. REM On a second thought - the Arduino could download the update to the ESP, and then the ESP flashes the Arduino. Or two Arduinos (€2.50 from China) flash each other. Hmmm...&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
With enough devices deployed, the MQTT-ID may or may not tell you enough to find out where the device is physically located (maybe it even moves?). It would be nice to save the location as part of the configuration, and have the device report on it on request or when rebooting.&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=IoT_Management&amp;diff=223</id>
		<title>IoT Management</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=IoT_Management&amp;diff=223"/>
		<updated>2018-06-15T13:00:09Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=IoT Management - How to Manage an Installation=&lt;br /&gt;
&lt;br /&gt;
Something that I noticed (even) at home: Once you deployed a number of IoT devices, some questions arise:&lt;br /&gt;
&lt;br /&gt;
* Does a device have a problem?&lt;br /&gt;
* What devices are actually deployed? Where?&lt;br /&gt;
* What software versions are in use (devices, IoT framework, capabilities)?&lt;br /&gt;
* What topics are in use? Who is publishing, who is subscribing? What is being published? How often?&lt;br /&gt;
* Security - currently I rely on the privacy of my WLAN, but I guess message exchange via SSL would be &amp;quot;really nice&amp;quot; (and require a reworking of my infrastructure)&lt;br /&gt;
&lt;br /&gt;
Ingredients to the solution are&lt;br /&gt;
&lt;br /&gt;
* [[Tools]] to monitor what is going on in the network&lt;br /&gt;
* [[Naming and Behavioral Conventions]] that allow for systematic collection and analysis of data, and for controlling devices&lt;br /&gt;
&lt;br /&gt;
==Operational Status==&lt;br /&gt;
&lt;br /&gt;
All my devices are reporting their status under topic &amp;quot;&amp;lt;mqttID&amp;gt;/status&amp;quot;. Subscribing to &amp;quot;+/status&amp;quot; gives me an overview about what devices are deployed, and how they are doing connection-wise. &lt;br /&gt;
&lt;br /&gt;
Sometime devices even don&#039;t connect or experience other hangups. My devices use a self-developed logging facility called &amp;quot;Logsury&amp;quot; that, among others things, is able to output logging information via I2C. When I connect my programmer to a device I get logging output displayed on a LCD (note to self: extend to main connector to include A4 and A5; there are enough free pins to use). Of course, any other device capable of receiving I2C transmissions can display that information.&lt;br /&gt;
&lt;br /&gt;
==Network==&lt;br /&gt;
&lt;br /&gt;
Similarly, my devices report their IP and MAC addresses. Once devices are able to connect to more than one WLAN, they should report the SSID in use as well. This helps setting up routers, firewalls, and the like.&lt;br /&gt;
&lt;br /&gt;
Additionally, I use a programmable RGB LED to display the (predominantly network) status of the device in a directly observable fashion. I get information about connecting to the WLAN, connecting to the MQTT broker, pings sent and received, and publications send and received. This actually has often helped me to pin-point troubles.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
My devices report the software version of&lt;br /&gt;
&lt;br /&gt;
* the device (like, &amp;quot;gardener&amp;quot;)&lt;br /&gt;
* each capability (like, &amp;quot;watering&amp;quot;, &amp;quot;temperature&amp;quot;)&lt;br /&gt;
* the underlying IoT framework&lt;br /&gt;
&lt;br /&gt;
This allows me to find devices which need to be, or could be updated.&lt;br /&gt;
&lt;br /&gt;
REM The Arduino/ ESP8266 combination I use does NOT allow for over the air updates. But, all devices have a plug that allows for in-place SPI programming. REM On a second thought - the Arduino could download the update to the ESP, and then the ESP flashes the Arduino - hmmm...&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
With enough devices deployed, the MQTT-ID may or may not tell you enough to find out where the device is physically located (maybe it even moves?).&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=IoT_Management&amp;diff=222</id>
		<title>IoT Management</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=IoT_Management&amp;diff=222"/>
		<updated>2018-06-15T12:59:10Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: Ctreber moved page Management to IoT Management without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Management - How to manage an IoT installation=&lt;br /&gt;
&lt;br /&gt;
Something that I noticed (even) at home: Once you deployed a number of IoT devices, some questions arise:&lt;br /&gt;
&lt;br /&gt;
* Does a device have a problem?&lt;br /&gt;
* What devices are actually deployed?&lt;br /&gt;
* What software versions are in use (devices, IoT framework, capabilities)?&lt;br /&gt;
* What topics are in use? Who is publishing, who is subscribing? What is being published? How often?&lt;br /&gt;
* Security - currently I rely on the privacy of my WLAN, but I guess message exchange via SSL would be &amp;quot;really nice&amp;quot; (and require a reworking of my infrastructure)&lt;br /&gt;
&lt;br /&gt;
Ingredients to the solution are&lt;br /&gt;
&lt;br /&gt;
* [[Tools]] to monitor what is going on in the network&lt;br /&gt;
* [[Naming and Behavioral Conventions]] that allow for systematic collection and analysis of data, and for controlling devices&lt;br /&gt;
&lt;br /&gt;
==Operational Status==&lt;br /&gt;
&lt;br /&gt;
All my devices are reporting their status under topic &amp;quot;&amp;lt;mqttID&amp;gt;/status&amp;quot;. Subscribing to &amp;quot;+/status&amp;quot; gives me an overview about what devices are deployed, and how they are doing connection-wise. &lt;br /&gt;
&lt;br /&gt;
Sometime devices even don&#039;t connect or experience other hangups. My devices use a self-developed logging facility called &amp;quot;Logsury&amp;quot; that, among others things, is able to output logging information via I2C. When I connect my programmer to a device I get logging output displayed on a LCD (note to self: extend to main connector to include A4 and A5; there are enough free pins to use). Of course, any other device capable of receiving I2C transmissions can display that information.&lt;br /&gt;
&lt;br /&gt;
==Network==&lt;br /&gt;
&lt;br /&gt;
Similarly, my devices report their IP and MAC addresses. Once devices are able to connect to more than one WLAN, they should report the SSID in use as well. This helps setting up routers, firewalls, and the like.&lt;br /&gt;
&lt;br /&gt;
Additionally, I use a programmable RGB LED to display the (predominantly network) status of the device in a directly observable fashion. I get information about connecting to the WLAN, connecting to the MQTT broker, pings sent and received, and publications send and received. This actually has often helped me to pin-point troubles.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
My devices report the software version of&lt;br /&gt;
&lt;br /&gt;
* the device (like, &amp;quot;gardener&amp;quot;)&lt;br /&gt;
* each capability (like, &amp;quot;watering&amp;quot;, &amp;quot;temperature&amp;quot;)&lt;br /&gt;
* the underlying IoT framework&lt;br /&gt;
&lt;br /&gt;
This allows me to find devices which need to be, or could be updated.&lt;br /&gt;
&lt;br /&gt;
REM The Arduino/ ESP8266 combination I use does NOT allow for over the air updates. But, all devices have a plug that allows for in-place SPI programming. REM On a second thought - the Arduino could download the update to the ESP, and then the ESP flashes the Arduino - hmmm...&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
With enough devices deployed, the MQTT-ID may or may not tell you enough to find out where the device is physically located (maybe it even moves?).&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=IoT_with_AME&amp;diff=221</id>
		<title>IoT with AME</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=IoT_with_AME&amp;diff=221"/>
		<updated>2018-06-15T12:58:45Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=IoT with AME - The Internet of Things, with Arduino, MQTT, and ESP8266=&lt;br /&gt;
&lt;br /&gt;
[[File:20170802T115833.jpg|thumb|left|300px|Voltage controller (left), status LED (RGB; top), Arduino (top right), ESP8266 (bottom right, on adapter) - My standard hardware stack]] This is work in progress started in June 2017 - I am in the process of typing out my experiences with IoT, Arduino, and ESP8266, as a documentation for myself and as something that might be helpful to others.&lt;br /&gt;
&lt;br /&gt;
* [[My IoT projects]] - What I built over time (plenty!)&lt;br /&gt;
* [[MQTT]] - A protocol for connecting IoT devices&lt;br /&gt;
* [[Software Stack|Software]]: Libraries for devices and capabilities, and access on MQTT-, TCP-, WLAN-, and chip level&lt;br /&gt;
* [[Software Problems]]: C++ and very small memory pose diverse challenges&lt;br /&gt;
* [[Hardware Stack|Hardware]]: Arduino, ESP8266, and additional hardware&lt;br /&gt;
* [[Hardware Problems]]: Bugs are not limited to software - plain electricity can be tricky, too!&lt;br /&gt;
* [[Challenges]] - How to overcome hardware and software limitations&lt;br /&gt;
* [[IoT Management]] - How to manage an IoT installation&lt;br /&gt;
* [[To Do]] - What I would like to improve and add in this Wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;Note to self (help on MediaWiki):&lt;br /&gt;
&lt;br /&gt;
* https://www.mediawiki.org/wiki/Manual:FAQ&lt;br /&gt;
* https://en.wikipedia.org/wiki/Help:Wiki_markup&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Challenges&amp;diff=220</id>
		<title>Challenges</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Challenges&amp;diff=220"/>
		<updated>2018-06-15T12:58:16Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Challenges - How to Overcome Hardware and Software Limitations=&lt;br /&gt;
&lt;br /&gt;
The Arduino hardware is pretty limited - you get &lt;br /&gt;
&lt;br /&gt;
* 32kB of unmodifiable (at run-time) flash memory for the program&lt;br /&gt;
* 2kB of volatile SRAM memory for variables, and &lt;br /&gt;
* 1kB runtime-programmable, non-volatile EEPROM memory for data&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Pretty much any icon on your Linux, Apple, or Windows desktop consumes more space.&lt;br /&gt;
&lt;br /&gt;
This is a challenge to your software you already have to address at compile time. It gets potentially worse at run time. Processing network data requires buffers, and buffer sizes may be variable. During operations you may want to change the configuration of the device. If you want do to that without re-programming the chip, you need to use an interface of some kind (wireless, SPI/ I2C, or SD card).&lt;br /&gt;
&lt;br /&gt;
* Updating device configuration (ie, MQTT/ WLAN) - ideas: via SD Card (which is enduser-friendly) or via writing config data to EEPROM&lt;br /&gt;
* Updating device code - via ISP, or - ideas - OTA with the Arduino uploading a program to the ESP, followed by the ESP flashing the Arduino&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Flaky_ESP8266_Behavior&amp;diff=219</id>
		<title>Flaky ESP8266 Behavior</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Flaky_ESP8266_Behavior&amp;diff=219"/>
		<updated>2018-06-15T12:49:13Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Hardware Problems]]&lt;br /&gt;
&lt;br /&gt;
=Flaky ESP8266 Behavior=&lt;br /&gt;
&lt;br /&gt;
The EP8266 is great: It gives your IoT device WLAN and IP connectivity for only a few bucks.&lt;br /&gt;
&lt;br /&gt;
On the other hand, the ESP8266 is quite a hand full: It creates power spikes that have negative impact on its own operation and possibly that of your entire circuit, it experiences out-of-the-blue resets that have to be dealt with, and it suffers hang-ups that can only be cured with a hardware reset or uttering &amp;quot;The IT Crowd&amp;quot; mantra (&amp;quot;have you tried turning it off and on again&amp;quot;; https://www.youtube.com/watch?v=nn2FB1P_Mn8). &lt;br /&gt;
&lt;br /&gt;
I have had A LOT of trouble with the ESP8266 before I had a lot of fun. Some problems can be solved with a proper power supply, a bit of hardware, and somewhat sophisticated error handling. Other, more persistent problems can only be addressed with resetting the chip or even cycling its power supply.&lt;br /&gt;
&lt;br /&gt;
My Arduino library uses three levels of measures to straighten out the balking chip:&lt;br /&gt;
&lt;br /&gt;
* Soft-reset, by issuing a &amp;quot;restart&amp;quot; command to the ESP&lt;br /&gt;
* Hard-reset, by connecting an Arduino digital port pin to the reset pin of the ESP. This just requires a piece of cable. And an IO pin.&lt;br /&gt;
* &amp;quot;Turn if off and on again&amp;quot;, by connecting an Arduino digital port pin to a transistor that controls the ESP power supply. That requires a transistor and minor wiring. And another IO pin.&lt;br /&gt;
&lt;br /&gt;
You can&#039;t do more without modifying the ESP8266 firmware. Wait, you can: check out [[Sufficient_power-supply|Sufficient Power Supply]] regarding power spikes.&lt;br /&gt;
&lt;br /&gt;
[[Hardware Problems]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Software_Problems&amp;diff=218</id>
		<title>Software Problems</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Software_Problems&amp;diff=218"/>
		<updated>2018-06-15T12:48:06Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Embedded Software Problems=&lt;br /&gt;
&lt;br /&gt;
C++ and very small memory pose diverse challenges. The Arduino runtime environment has its intricacies as well. &lt;br /&gt;
&lt;br /&gt;
And then there is other people&#039;s software you may not have access to, such as firmware in components. Yes, ESP8266, I&#039;m looking at you! &lt;br /&gt;
&lt;br /&gt;
* [[C++ is not Java]] - C++ can be harsh for people used to Java. Especially memory handling holds a number of surprises.&lt;br /&gt;
* [[Memory Usage]] - The Arduino is small and powerful - and it all needs to fit in 32kB of flash and 2kB of RAM.&lt;br /&gt;
* [[SoftwareSerial]] - Sounds great, causes frustration. Emulation thing that need to happen fast has limits.&lt;br /&gt;
* [[Flaky ESP8266 Behavior]] - It&#039;s not always you, sometime the ESP8266 has it&#039;s own mind&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Software_Problems&amp;diff=217</id>
		<title>Software Problems</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Software_Problems&amp;diff=217"/>
		<updated>2018-06-15T12:47:54Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Embedded Software Problems=&lt;br /&gt;
&lt;br /&gt;
C++ and very small memory pose diverse challenges. The Arduino runtime environment has its intricacies as well. &lt;br /&gt;
&lt;br /&gt;
And then there is other people&#039;s software you may not have access to, such as firmware in components. Yes, ESP8266, I&#039;m looking at you! The EP8266 is great: It gives your IoT device WLAN and IP connectivity for only a few bucks.&lt;br /&gt;
&lt;br /&gt;
On the other hand, the ESP8266 is quite a hand full: It creates power spikes that have negative impact on its own operation and possibly that of your entire circuit, it experiences out-of-the-blue resets that have to be dealt with, and it suffers hang-ups that can only be cured with a hardware reset or uttering &amp;quot;The IT Crowd&amp;quot; mantra (&amp;quot;have you tried turning it off and on again&amp;quot;; https://www.youtube.com/watch?v=nn2FB1P_Mn8). &lt;br /&gt;
&lt;br /&gt;
I have had A LOT of trouble with the ESP8266 before I had a lot of fun. Some problems can be solved with a proper power supply, a bit of hardware, and somewhat sophisticated error handling. Other, more persistent problems can only be addressed with resetting the chip or even cycling its power supply.&lt;br /&gt;
&lt;br /&gt;
* [[C++ is not Java]] - C++ can be harsh for people used to Java. Especially memory handling holds a number of surprises.&lt;br /&gt;
* [[Memory Usage]] - The Arduino is small and powerful - and it all needs to fit in 32kB of flash and 2kB of RAM.&lt;br /&gt;
* [[SoftwareSerial]] - Sounds great, causes frustration. Emulation thing that need to happen fast has limits.&lt;br /&gt;
* [[Flaky ESP8266 Behavior]] - It&#039;s not always you, sometime the ESP8266 has it&#039;s own mind&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Hardware_Problems&amp;diff=216</id>
		<title>Hardware Problems</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Hardware_Problems&amp;diff=216"/>
		<updated>2018-06-15T12:46:31Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Embedded Hardware Problems=&lt;br /&gt;
&lt;br /&gt;
Bugs are not limited to software - plain electricity can be tricky, too! Sometimes it even kills (and I&#039;m referring to Arduinos here).&lt;br /&gt;
&lt;br /&gt;
* [[Sufficient power-supply]] - Some chips suck (power)&lt;br /&gt;
* [[Staying well-grounded]] - Why not everybody can have their own GND (ground)&lt;br /&gt;
* Fun with [[pitfalls-power lan|power LAN]] adapters (don&#039;t plug your fridge into one)&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Software_Problems&amp;diff=215</id>
		<title>Software Problems</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Software_Problems&amp;diff=215"/>
		<updated>2018-06-15T12:43:13Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* Software Problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Embedded Software Problems=&lt;br /&gt;
&lt;br /&gt;
C++ and very small memory pose diverse challenges. The Arduino runtime environment has its intricacies as well.&lt;br /&gt;
&lt;br /&gt;
* [[C++ is not Java]] - C++ can be harsh for people used to Java. Especially memory handling holds a number of surprises.&lt;br /&gt;
* [[Memory Usage]] - The Arduino is small and powerful - and it all needs to fit in 32kB of flash and 2kB of RAM.&lt;br /&gt;
* [[SoftwareSerial]] - Sounds great, causes frustration. Emulation thing that need to happen fast has limits.&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Hardware_Stack&amp;diff=214</id>
		<title>Hardware Stack</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Hardware_Stack&amp;diff=214"/>
		<updated>2018-06-15T12:42:44Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Hardware for Building IoT Devices=&lt;br /&gt;
&lt;br /&gt;
Arduino, ESP8266, and additional Hardware. I have a number of pages on this in German - some work to do.&lt;br /&gt;
&lt;br /&gt;
* [[How to flash the ESP8266]] with new firmware - easy hardware setup, awkward toolkit usage. Is it worth it? Not sure; I get along pretty well with my old and new FW versions. On the con side, I managed to fry one chip while trying to program it.&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=Software_Problems&amp;diff=213</id>
		<title>Software Problems</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=Software_Problems&amp;diff=213"/>
		<updated>2018-06-15T12:42:00Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[IoT with AME|Home]]&lt;br /&gt;
&lt;br /&gt;
=Software Problems=&lt;br /&gt;
&lt;br /&gt;
C++ and very small memory pose diverse challenges. The Arduino runtime environment has its intricacies as well.&lt;br /&gt;
&lt;br /&gt;
* [[C++ is not Java]] - C++ can be harsh for people used to Java. Especially memory handling holds a number of surprises.&lt;br /&gt;
* [[Memory Usage]] - The Arduino is small and powerful - and it all needs to fit in 32kB of flash and 2kB of RAM.&lt;br /&gt;
* [[SoftwareSerial]] - Sounds great, causes frustration. Emulation thing that need to happen fast has limits.&lt;br /&gt;
&lt;br /&gt;
[[IoT with AME|Home]]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
	<entry>
		<id>http://iot.ctreber.com/index.php?title=IoT_with_AME&amp;diff=212</id>
		<title>IoT with AME</title>
		<link rel="alternate" type="text/html" href="http://iot.ctreber.com/index.php?title=IoT_with_AME&amp;diff=212"/>
		<updated>2018-06-15T12:40:08Z</updated>

		<summary type="html">&lt;p&gt;Ctreber: /* IoT with AME - The Internet of Things, with Arduino, MQTT, and ESP8266 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=IoT with AME - The Internet of Things, with Arduino, MQTT, and ESP8266=&lt;br /&gt;
&lt;br /&gt;
[[File:20170802T115833.jpg|thumb|left|300px|Voltage controller (left), status LED (RGB; top), Arduino (top right), ESP8266 (bottom right, on adapter) - My standard hardware stack]] This is work in progress started in June 2017 - I am in the process of typing out my experiences with IoT, Arduino, and ESP8266, as a documentation for myself and as something that might be helpful to others.&lt;br /&gt;
&lt;br /&gt;
* [[My IoT projects]] - What I built over time (plenty!)&lt;br /&gt;
* [[MQTT]] - A protocol for connecting IoT devices&lt;br /&gt;
* [[Software Stack|Software]]: Libraries for devices and capabilities, and access on MQTT-, TCP-, WLAN-, and chip level&lt;br /&gt;
* [[Software Problems]]: C++ and very small memory pose diverse challenges&lt;br /&gt;
* [[Hardware Stack|Hardware]]: Arduino, ESP8266, and additional hardware&lt;br /&gt;
* [[Hardware Problems]]: Bugs are not limited to software - plain electricity can be tricky, too!&lt;br /&gt;
* [[Challenges]] - How to overcome hardware and software limitations&lt;br /&gt;
* [[Management]] - How to manage an IoT installation&lt;br /&gt;
* [[To Do]] - What I would like to improve and add in this Wiki&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;Note to self (help on MediaWiki):&lt;br /&gt;
&lt;br /&gt;
* https://www.mediawiki.org/wiki/Manual:FAQ&lt;br /&gt;
* https://en.wikipedia.org/wiki/Help:Wiki_markup&lt;/div&gt;</summary>
		<author><name>Ctreber</name></author>
	</entry>
</feed>