Skip to content

Instantly share code, notes, and snippets.

@sehraf
Last active May 24, 2023 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sehraf/7f47eb3eab09001855b33c8c9821ab79 to your computer and use it in GitHub Desktop.
Save sehraf/7f47eb3eab09001855b33c8c9821ab79 to your computer and use it in GitHub Desktop.
DIY 8x8x8 LED Cube WiFi Module communication

baurate: 57600
every line is terminated with \r\n

commands send by the MCU:

AT+CWMODE=3
AT+RST
AT+CIPMUX=1
AT+CIPSERVER=1

these are send without caring for an answer, i guess it's simply hardcoded


i never received the fitting ESP01 so i tried to reverse things ...

(stock) ESP AT firmware reponse would reponde with OK
Connection and commands sent by the (assumably) "light cube app"
using python script to talk to the ESP AT module, see <<< and >>>, after AT+GMR everything that is sent by the ESP is simply printed

opening...
/dev/ttyUSB0
<<< AT
>>> OK
<<< AT+CWMODE=3
>>> OK
<<< AT+RST
>>> OK
<<< AT+CIPMUX=1
>>> OK
<<< AT+CIPSERVER=1
>>> OK
<<< AT+GMR
>>> SDK version:qa-test-v4.3.3-20220423
compile time(67966ba):Aug 26 2022 07:46:13
Bin version:2.4.2(MINI-1)

OK

everything below is sent the app and formwarded by the ESP

b'+STA_CONNECTED:"f0:<some mac>:e6"\r\n'
b'+DIST_STA_IP:"f0:<some mac>:e6","192.168.<some ip>"\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:\xf3\xf3\xf3\r\n'  	-- animation mode
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x01\r\n'		-- animation 1
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:555\r\n'			-- animation faster / +
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:666\r\n'			-- animation slower / -
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:666\r\n'
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:555\r\n'
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:555\r\n'
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:555\r\n'
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x02\r\n'		-- animation 2
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x03\r\n'		-- animation 3
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x04\r\n'		-- animation 4
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x05\r\n'		-- animation 5
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x06\r\n'		-- animation 6
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:\xf4\xf4\xf4\r\n'	  -- music mode
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x01\r\n'		-- audio 1
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x02\r\n'		-- audio 2
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x03\r\n'		-- audio 3
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x04\r\n'		-- audio 4
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x05\r\n'
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x06\r\n'
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x07\r\n'
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x12\r\n'		-- audio mixed
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:\x11\r\n'
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,3:\xf3\xf3\xf3\r\n'	  -- animation mode
b'0,CLOSED\r\n'
b'0,CONNECT\r\n'
b'\r\n'
b'+IPD,0,1:b\r\n'			  -- animation loop
b'0,CLOSED\r\n'

My cube doesn't react to anything though


snipped for ESPHome

uart:
  baud_rate: 57600
  tx_pin: GPIO1
  rx_pin: GPIO3

button:
  - platform: template
    name: "animation mode"
    on_press:
      - uart.write: "+IPD,0,3:\xf3\xf3\xf3\r\n"
  - platform: template
    name: "music mode"
    on_press:
      - uart.write: "+IPD,0,3:\xf4\xf4\xf4\r\n"
  - platform: template
    name: "animation faster"
    on_press:
      - uart.write: "+IPD,0,3:555\r\n"
  - platform: template
    name: "animation slower"
    on_press:
      - uart.write: "+IPD,0,3:666\r\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment