Using ESP8266 in Serial Mode on MAC OSX

Esp8266

You can use ESP8266 in serial mode. This is more useful for verify if the ESP8266 module is good or is broken.

For sure if you want use this procedure you do have a serial usb adaptor. The connections between the ESP and the Serial/USB are the follows:

esp8266_connections

Now for serial comunication on Mac OSX you can try to use CoolTerm. CoolTerm is a real good program. Simple, stable and complete. Install CoolTerm, set the Terminal mode like Line Text Mode. Open the correct serial port, and try to write on text line this commands:

AT (enter). The ESP8288’s answer “OK”.

Now you can try to scan your lan. Try to put AT+CWLAP (enter)The ESP8266 respond with a list of Access Points. If respond with “Error”, you can try to put this command:

AT+CWMODE=1 (click enter), after this retype AT+CWLAP, and still the list.

For the connection with your wifi lan you can type:

AT+CWJAP=”SSID”,”Password”. The ESP8266 respond with “OK”.

After you can read your IP address. Type: AT+CIFSR the answer of ESP8266 will be:

+CIFSR:STAIP,”yourIP”
+CIFSR:STAMAC,”yourMACaddress”

I use ESP8266 with Arduino UNO and Cayenne. You can connect the ESP8266 to the Arduino UNO Board, and setting the SoftwareSerial library. Now you can use the Arduino Serial to debug, and the Software Serial to communicate with ESP8266. There is a simple code for connect in 5 minutes an Arduino UNO to internet. An Arduino UNO connected to internet is an IoT hardware. Now you can use this hardware with Cayenne App on your iOS or Android Smartphone.

Others AT commands

Function

AT Command

Response

Working

AT

OK

Restart

AT+RST

OK [System Ready, Vendor:www.ai-thinker.com]

Firmware version

AT+GMR

AT+GMR 0018000902 OK

List Access Points

AT+CWLAP

AT+CWLAP +CWLAP:(4,”RochefortSurLac”,- 38,”70:62:b8:6f:6d:58″,1) +CWLAP:(4,”LiliPad2.4″,-83,”f8:7b:8c:1e:7c:6d”,1) OK

Join Access Point

AT+CWJAP? AT+CWJAP=”SSID”,”Password”

Query AT+CWJAP? +CWJAP:”RochefortSurLac” OK

Quit Access Point

AT+CWQAP=? AT+CWQAP

Query OK

Get IP Address

AT+CIFSR

AT+CIFSR 192.168.0.105 OK

Set Parameters of Access Point

AT+ CWSAP?
AT+ CWSAP= <ssid>,<pwd>,<chl>, <ecn>

Query
ssid, pwd
chl = channel, ecn = encryption

WiFi Mode

AT+CWMODE? AT+CWMODE=1 AT+CWMODE=2 AT+CWMODE=3

Query STA AP BOTH

Set up TCP or UDP connection

AT+CIPSTART=? (CIPMUX=0) AT+CIPSTART = <type>,<addr>,<port> (CIPMUX=1) AT+CIPSTART= <id><type>,<addr>, <port>

Query
id = 0-4, type = TCP/UDP, addr = IP address, port= port

TCP/UDP Connections

AT+ CIPMUX? AT+ CIPMUX=0 AT+ CIPMUX=1

Query Single Multiple

Check join devices’ IP

AT+CWLIF

TCP/IP Connection Status

AT+CIPSTATUS

AT+CIPSTATUS? no this fun

Send TCP/IP data

(CIPMUX=0) AT+CIPSEND=<length>; (CIPMUX=1) AT+CIPSEND= <id>,<length>

Close TCP / UDP connection

AT+CIPCLOSE=<id> or AT+CIPCLOSE

Set as server

AT+ CIPSERVER= <mode>[,<port>]

mode 0 to close server mode; mode 1 to open; port = port

Set the server timeout

AT+CIPSTO? AT+CIPSTO=<time>

Query
<time>0~28800 in seconds

Baud Rate*

AT+CIOBAUD?
Supported: 9600, 19200, 38400, 74880, 115200, 230400, 460800, 921600

Query AT+CIOBAUD? +CIOBAUD:9600 OK

Check IP address

AT+CIFSR

AT+CIFSR 192.168.0.106 OK

Firmware Upgrade (from Cloud)

AT+CIUPDATE

  1. +CIPUPDATE:1
  2. +CIPUPDATE:2
  3. +CIPUPDATE:3
  4. +CIPUPDATE:4

found server connect server got edition start update

Received data

+IPD

(CIPMUX=0): + IPD, <len>: (CIPMUX=1): + IPD, <id>, <len>: <data>

Watchdog Enable*

AT+CSYSWDTENABLE

Watchdog, auto restart when program errors occur: enable

Watchdog Disable*

AT+CSYSWDTDISABLE

Watchdog, auto restart when program errors occur: disable

Ott 19, 2016 | Posted by in Blog | 0 comments

Add Your Comment

Your email address will not be published.

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.

Premium Wordpress Themes by UFO Themes