ESP Witty

A new ESP8266 board has emerged recently, dubbed ESP Witty, which currently sells for $2.60 on AliExpress:

ESPWitty_TopView

ESP Witty top view

The board is produced by a chinese company called GizWits, their website which requires registration has some content in english, but documentation remains scarce.

The novelty of this board vs other ESP8266 boards, is that it is made of two stacked boards:rgb_thermistor_esp8266

  1. a simple lower board holding a CH340G USB/TTL converter, two Flash&Reset push buttons, two transistors and a micro-USB socket:

     

  2. an upper board holding on the top side an ESP12-F,  a RGB LED in 5050 SMD package, a photo resistor, and on the underside, a LM1117 3.3V regulator, another micro-USB socket and one push button:

The board can be powered from either USB sockets, only the underboard one providing USB/COM bridge of course.
The main upper board can operate stand-alone without the lower board, and exposes the useful ESP8266 pins in two breadboardable 1/10″ 8-pin headers.

Built-in I/O wiring:

As found out by sej7278 in this post, the wiring is as follows:

  • Push Button on GPIO04
  • Red LED on GPIO15
  • Green LED on GPIO12
  • Blue LED on GPIO13
  • Photo Resistor on ADC/TOUT/A0 pin

Firmware setup and Control UI:

The board boots with its UART set at 115200 bps, and spits out a ESP SmartConfig sequence, similar as:

mode : sta(5c:cf:7f:11:97:80) + softAP(5e:cf:7f:11:97:80)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.16)bcn 100
SDK version:bcn 0
del if1
mode : sta(5c:cf:7f:11:97:80)
SC version: V2.5.0
f 0, scandone
f 0, scandone
SC_STATUS_FIND_CHANNEL

If the button is pressed, a message button_press_3s! is output too.
The ESP8266 does not put a new SSID up, although I’ve briefly seen a WOWSTAR_something SSID poping up and then going away.

Instead, it uses the TI CC3000 SmartConfig protocol (or hack) which involves sending SSID and PW encoded in UDP packets length, and does not require the chip to be authentified yet on the WPA2 Access Point, but has the side effect of letting anyone listening to SmartConfig traffic know your SSID and its password…

Anyhow, GizWits provides an Android (or iPhone) app that allows to setup the ESP Witty onto your Access Point using SmartConfig, and bidirectional connectivity to the GizWits cloud once setup:

Get the app from http://site.gizwits.com/en/developer/resource/demo_app?protoc=WIFI

Launch it on your tablet or phone, then select Add Device from the menu, this takes you to the AirLink Configuration page. The ESP boots in config mode so just press Next.
The next page should show the current AP’s SSID and ask for the password: ESPWitty_SmartConfig
Select Wifi Module Type ESP, enter the password and click Configure. If you have a COM terminal connected to your ESP, you will see the connection sequence:

SC_STATUS_FIND_CHANNEL
 TYPE: ESPTOUCH
 T|PHONE MAC: bc 72 b1 xx yy zz
 T|AP MAC   : 76 ae b1 xx yy zz
 SC_STATUS_GETTING_SSID_PSWD
 T|pswd: SOMEPASSWORD
 T|ssid: SOMESSID
 SC_STATUS_LINK
 f 0, scandone
 state: 0 -> 2 (b0)
 state: 2 -> 3 (0)
 state: 3 -> 5 (10)
 add 0
 aid 3
 pm open phy_2,type:2 0 0
 cnt
 connected with SOMESSID, channel 1
 dhcp client start...
 ip:192.168.0.25,mask:255.255.255.0,gw:192.168.0.254
 SC_STATUS_LINK_OVER
 Phone ip: 192.168.0.12
 MQTT_InitConnection
 MQTT_InitClient
 TCP: Connect to ip  119.29.42.117:1883
 MQTT: Connected to broker 119.29.42.117:1883
 MQTT: Sending, type: 1, id: 0000
 TCP: Sent
 TCP: data received 4 bytes

You will then have the ability to register the device, and will be directed to a control panel in Chinese with cursors that control the Witty’s IOs, the first one controls the RGB LED brightness, and the 3 others the R,G,B channels:ESPWitty_ControUI

Sliding the bottom cursors will change the RGB light’s color and brightness:

Advertisements

5 thoughts on “ESP Witty

  1. Michael

    Nice work! Now trying to retrieve the data it seems sending to that cloud at 119.29.42.117. I tried to make an ‘regular’ account but that failed….. invalid phonenumber, Anyway, the whole Gizwits exercise gave me inspiration for own projects.

    Reply
    1. Greg Ware Post author

      Also, you can see from the COM trace that the ESP is communicating with the GizWit Cloud over MQTT.
      When I created my account on GizWit, they asked for a phone number, got me wondering why they needed it, it’s probably used as one of the keys or topics on that MQTT broker.
      I don’t remember having had to enter the phone number on the tablet client, but maybe I did at some point.
      It would not be too much of a stretch to connect your own client (e.g. MyMQTT on Android), provided you can find out connection credentials.

      Reply
  2. Alan Lord

    I bought on of these from eBay here in the UK and it arrived this morning (cheap! was only £4.49 inc P&P). After finding this post (thanks) I have re-flashed it and stuck nodeMCU on it and it seems to be working fine. I wasn’t interested in the GizWit cloud stuff or registering for anything.

    Reply
  3. Pingback: Smart Plug

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s