EPD-132 Development User Manual

From ESS-WIKI
Jump to: navigation, search

DEVELOPMENT YOU OWN CMS SOLUTION WITH EPD-132

This manual will illustrate how do start EPD-132 and communication with EPD-132 board via API command.

Components LIST

Item  Description
1  13.3” EPAPER
2  Mainboard
3  Power adapter and cable
4  ED22 board
5  ED22 micro USB cable
6  10 pin FFC cable x2
7  2.4G Wi-Fi antenna
8  I/O daughter board

  RTENOTITLE

SYSTEM ARCHITECURE

RTENOTITLE

The EPD-132 provide JSON format API to communicate with the MQTT broker via WiFi. The developer need establish a MQTT broker server. Use publish and subscript topic to communicate with EPD-132 service handler.  

  • Publish topic: ESL/IP/Tag/Action, system send command to EPD-132
  • Subscript topic: ESL/Tag/IP/Report, system receive from EPD-132 response

This server also needs to provide a tftp service to transfer images.

        RTENOTITLE

TOOL AND DEVELOPMENT ENVIRONMENT SETUP

2.4G Wi-Fi AP SETTING WITH BLE APP

The EPD-132 needs to join WiFi to connect to MQTT broker. Therefore EPD-132 needs to set SSID and password to join WiFi. EPD-132 would start the "ble-wifi introducer" service that set SSID and password via BLE when it did not join WiFi. You can reference "2.4G Wi-Fi AP SETTING WITH BLE APP"

Connect to Wi-Fi AP

If the connection successful, the EDP-132 obtains the IP address.RTENOTITLE  

Connect to Broker

Then the EDP-132 will try to connect to the broker. If the connection successful, the EDP-132 will publish a register to the broker.RTENOTITLE

EVALUATION KIT HANDS-ON

JSON Format API

The API of JSON format below:

{"Device-Address":string,"Cmd-Type": int, "Transaction-Id":  int(uint_32), "Cmd-Id": int, "Parameter": {P1:P1_value, P2:P2_value, P3:P3_value,….}}

  • Device-Address: EPD-132 MAC address, 16-code. Fill in 0 in front when less than 16-code.
  • Cmd-Type: reference APL list table.
    • ​​​1: EPD-132 initiative report
    • 2: System send to EPD-132
    • 3: EPD-132 response to system
  • Transaction-Id: a transaction number
  • Cmd-Id: reference APL list table
  • Parameter: command parameter
  • Ex: Use "set-alert-status" command and "alert-status"=1
    • mosquitto_pub -h localhost -t ESL/IP/Tag/Action -m {\"Device-Address\":\"0000e04f4302cb46\",\"Cmd-Type\":2,\"Transaction-Id\":12345441,\"Cmd-Id\":828,\"Parameter\":{\"alert-status\":1}}

Category of API

A-Status Report[edit]

B-System Control[edit]

C-Image Control[edit]

API List

Command Name Cmd type Cmd Id Parameter
cmd-receive
3 0x0030 command-error-code
integer
transaction-id
integer
tag-regisration
1 0x0032 tx-level
integer
rssi
integer
fw-version
string
tag-type
string
image-page
integer
image-crc
string
max-image-page
integer
state-report-period
integer
tag-report
1
0x0034 battery
integer
rssi
integer
image-page
integer
image-crc
string
alert-status
integer
power-source
string
emergancy-report
1 0x0035 emergancy-report integer
page-switch-report
1 0x0036 image-page
integer
alert-status-report
1 0x0037 alert-status
integer
re-register
2 0x0331 NULL
image-update 2 0x0332 image-name
string
image-crc
string
image-page
integer
image-refresh
boolean
start-x
integer
start-y
integer
image-width
integer
image-height
integer
image-update-rsp
3 0x0332 image-error-code
integer
transaction-id
integer
get-image-stack
2 0x0333 NULL
get-image-stack-rsp
3 0x0333 image-array
JsonArray
transaction-id
integer
refresh-image
2 0x0334 image-page
integer
start-x
integer
start-y
integer
image-width
integer
image-height
integer
refresh-image-rsp
3 0x0334 image-error-code
integer
transaction-id
integer
fw-update
2 0x0335 fw-name
string
fw-version
string
fw-crc
string
fw-update-rsp
3 0x0335 fw-update-error-code
integer
transaction-id
integer
reboot
2 0x0336 NULL
reset-to-default
2 0x0337 NULL
set-state-report-period
2 0x0338 state-report-period
integer
set-next-wakeup-time
2 0x0339 next-wakeup-time
integer
set-ssid-pw
2 0x033a ssid
string
password
string
reboot
integer
get-ssid-pw
2 0x033b NULL
get-ssid-pw-rsp
3 0x033b ssid
string
password
string
transaction-id
integer
set-alert-status
2 0x033c alert-status
integer
set-carousel-mode
2 0x033d carousel-mode
integer
page-start
integer
page-end
integer
time-second
integer
get-carousel-mode
2 0x033e NULL
get-carousel-mode-rsp
3 0x033e carousel-mode
integer
page-start
integer
page-end
integer
time-second
integer
transaction-id
integer

API Description

cmd-receive

EPD-132 report "cmd-receive" when it receive command from system.

[cmd-receive] output parameters

  1. command-error-code:
  • 0: Success
  • 1: Not Support Cmd Error
  • 2: Cmd Parameter Error
  • 3: Cmd Error
  • 4: Cmd Timeout
  • 5: EPD-132 is busying
  1. transaction-id: Same as the transaction number sent by the system to EPD-132 "Transaction-Id" field.

tag-regisration

When the EPD-132 is not registered, the EPD-132 actively reports the "tag-register" to the system. The system can also send a "re-register" command to request EPD-132 registration.

[tag-regisration] output parameters

  1. tx-level: RF tx level
  2. rssi: WiFi rssi value
  3. fw-version: EPD-132 fw version
  4. tag-type: EPD type, "EPD-132" for this model
  5. image-page: the current image page displayed
  6. image-crc: the current image crc value
  7. max-image-page: Maximum amount of storaged images
  8. state-report-period: EPD-132 status reporting period (unit: second)

tag-report

EPD-132 will report status regularly. The period is set by the "set-state-report-period" command.

[tag-report] output parameters

  1. battery: battery capacity.
  2. rssi: WiFi rssi value.
  3. image-page: image page on ePaper.
  4. image-crc: image crc-code on ePaper.
  5. alert-status: Non-zero represent the EPD-132 is in an alarm state. The alarm indicator (red led) will light. To use "set-alert-status" command to  set/reset the alarm status.

emergancy-report

page-switch-report

When an alert is not set, the user can press the button to switch to the next image. The EPD-132 will report the page number.

[page-switch-report] output parameters

        image-page: image page on ePaper.

alert-status-report

When an alert is set, the user can press the button to reset the alert. The EPD-132 will report the alert reset.

[alert-status-report] output parameters

        alert-status: alert-status: 0: reset, otherwise: set

re-register

Upon receipt of this command, the EPD-132 will resend the tag-register information.

image-update & image-update-rsp

Update the image saved on the specified page in flash. The user can set "image-refresh" and area to refresh immediately.

[image-update] input parameters

  1. image-name: image filename
  2. image-crc: image crc-code
  3. image-page: image storage page
  4. image-refresh: whether to image refresh immediately, 0: false, 1: true
  5. start-x: X-coordinate of image refresh
  6. start-y: Y-coordinate of image refresh
  7. image-width: width of image refresh
  8. image-height: height of image refresh

[image-update-rsp] output parameters

  1. image-error-code: 
  • 0: Success
  • 0x201: not find the image name on tftp server
  • 0x202: image crc-code error
  • 0x203: ePaper error
  • 0x250: tftp server error
  • 0x251: image page error
  • 0x252: transmission start error
  • 0x253: traffic crc error
  • 0x254: timeout
  1. transaction-id: Same as the transaction number sent by the system to EPD-132 "Transaction-Id" field.

get-image-stack & get-image-stack-rsp

Report crc-code of all images.

[get-image-stack] input parameters

        NULL.

[get-image-stack-rsp] output parameters

  1. image-array: Output an array of images crc-code.
  2. transaction-id: Same as the transaction number sent by the system to EPD-132 "Transaction-Id" field.

refresh-image & refresh-image-rsp

Refresh the ePaper image.

[refresh-image] input parameters

  1. image-page: page of image refreshed
  2. start-x: X-coordinate of image refreshed
  3. start-y: Y-coordinate of image refreshed
  4. image-width: width of image refreshed
  5. image-height: height of image refreshed

[refresh-image-rsp] output parameters

  1. image-error-code: 
  • 0x202: image crc-code error
  • 0x203: ePaper error
  • 0x251: image page error
  • 0x254: timeout
  1. transaction-id: Same as the transaction number sent by the system to EPD-132 "Transaction-Id" field.

fw-update & fw-update-rsp

Update EPD-132 firmware.

[image-update] input parameters

  1. fw-name: new fw filename
  2. fw-version: new fw version
  3. fw-crc: new fw crc-code

[image-update-rsp] output parameters

  1. fw-update-error-code: 
    • 0: Success
    • 0x301: fw crc-code error
    • 0x302: bootloader error
    • 0x303: fw version is the same
  2. transaction-id: Same as the transaction number sent by the system to EPD-132 "Transaction-Id" field.

reboot

Restart EPD-132.

[reboot] input parameters

        NULL.

reset-to-default

Restore the EPD-132 to its default state.

[reset-to-default] input parameters

        NULL.

set-state-report-period

Set the EPD-132 regular reporting time.

[set-state-report-period] input parameters

        state-report-period: regular reporting time(unit: minute).

set-next-wakeup-time

Upon receipt of this command, the EPD-132 will into sleep mode. The system must set wake-up time.

[set-next-wakeup-time] input parameters

        next-wakeup-time: wake-up time (unit: minute)

set-ssid-pw

Set SSID and password to join wifi.

[set-ssid-pw] input parameters

  1. ssid: new SSID
  2. password: new password
  3. reboot: whether to reboot after setting, 0: false, 1: true

get-ssid-pw & get-ssid-pw-rsp

Get SSID and password.

[get-ssid-pw] input parameters

        NULL.

[get-ssid-pw-rsp] output parameters

  1. ssid: current SSID
  2. password: current password
  3. transaction-id: Same as the transaction number sent by the system to EPD-132 "Transaction-Id" field.

set-alert-status

Set the EPD-132 alert status.

set-alert-status] input parameters

        alert-status: 0: reset, otherwise: set

set-carousel-mode

Set the EPD-132 to the carousel mode.

[set-carousel-mode] input parameters

  1. carousel-mode: 0: disable carousel mode, otherwise: enable carousel mode
  2. page-start: start page of carousel
  3. page-end: end page of carousel
  4. time-second: switch page interval(unit: second)

get-carousel-mode & get-carousel-mode-rsp

Get the carousel mode information.

[get-carousel-mode] input parameters

        NULL.

[get-carousel-mode-rsp] output parameters

  1. carousel-mode: 0: disable carousel mode, otherwise: enable carousel mode
  2. page-start: start page of carousel
  3. page-end: end page of carousel
  4. time-second: switch page interval(unit: second)
  5. transaction-id: Same as the transaction number sent by the system to EPD-132 "Transaction-Id" field.

EPD-132 Firmware Update

  • step 1: Download and unzip update tool
  • step 2: Copy and replace new binary(separately available) folder to tool diectory
  • step 3: Setup EPD-132 to develop mode, reference link
  • step 4: Click Adv.ESL_Tag-BNEPD_132R.bat
  • step 5: After the firmware update is complete, the EPD-132 will reboot.                RTENOTITLE