Ring ring

Command Write Configure - GPIO_PIN_MAP

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘W’

‘q’

Infor 1

Infor 2

Infor 3

Infor 4

...

 

Name CFG : GPIO_PIN_MAP

Number of field values : 26

 

 

 

Payload

Index

Type value

Min

Value

Max

Value

Default

Value

Min Length

Max Length

ID_ESPrtk_Pin

map to GPIOx

Unit

PL2

INTEGER

0

25

18

-

-

GPIO 0 ← ID_ESPrtk_Pin

 

PL3

INTEGER

0

25

4

-

-

GPIO 1 ← ID_ESPrtk_Pin

 

PL4

INTEGER

0

25

21

-

-

GPIO 2 ← ID_ESPrtk_Pin

 

PL5

INTEGER

0

25

1

-

-

GPIO 3 ← ID_ESPrtk_Pin

 

PL6

INTEGER

0

25

16

-

-

GPIO 4 ← ID_ESPrtk_Pin

 

PL7

INTEGER

0

25

10

-

-

GPIO 5 ← ID_ESPrtk_Pin

 

PL8

INTEGER

0

25

14

-

-

GPIO 12 ← ID_ESPrtk_Pin

 

PL9

INTEGER

0

25

0

-

-

GPIO 13 ← ID_ESPrtk_Pin

 

PL10

INTEGER

0

25

17

-

-

GPIO 14 ← ID_ESPrtk_Pin

 

PL11

INTEGER

0

25

11

-

-

GPIO 15 ← ID_ESPrtk_Pin

 

PL12

INTEGER

0

25

13

-

-

GPIO 16 ← ID_ESPrtk_Pin

 

PL13

INTEGER

0

25

7

-

-

GPIO 17 ← ID_ESPrtk_Pin

 

PL14

INTEGER

0

25

8

-

-

GPIO 18 ← ID_ESPrtk_Pin

 

PL15

INTEGER

0

25

2

-

-

GPIO 19 ← ID_ESPrtk_Pin

 

PL16

INTEGER

0

25

22

-

-

GPIO 21 ← ID_ESPrtk_Pin

 

PL17

INTEGER

0

25

19

-

-

GPIO 22 ← ID_ESPrtk_Pin

 

PL18

INTEGER

0

25

12

-

-

GPIO 23 ← ID_ESPrtk_Pin

 

PL19

INTEGER

0

25

9

-

-

GPIO 25 ← ID_ESPrtk_Pin

 

PL20

INTEGER

0

25

23

-

-

GPIO 26 ← ID_ESPrtk_Pin

 

PL21

INTEGER

0

25

20

-

-

GPIO 27 ← ID_ESPrtk_Pin

 

PL22

INTEGER

0

25

15

-

-

GPIO 32 ← ID_ESPrtk_Pin

 

PL23

INTEGER

0

25

3

-

-

GPIO 33 ← ID_ESPrtk_Pin

 

PL24

INTEGER

0

25

24

-

-

GPIO 34 ← ID_ESPrtk_Pin

 

PL25

INTEGER

0

25

6

-

-

GPIO 35 ← ID_ESPrtk_Pin

 

PL26

INTEGER

0

25

25

-

-

GPIO 36 ← ID_ESPrtk_Pin

 

PL27

INTEGER

0

25

5

-

-

GPIO 39 ← ID_ESPrtk_Pin

 

 

 

ID_ESPrtk_Pin

Name pin

ID_ESPrtk_Pin

Name pin

0

CWB_Button

13

RX_UART2

1

RX_UART0

14

ERROR_LED

2

MOSI_SD_Card

15

CS_LoRa

3

MOSI_LoRa_Ethe

16

TX_UART2

4

TX_UART0

17

NEOPIXEL_LED

5

MISO_SD_Card

18

CS_Ethernet

6

MISO_LoRa_Ethe

19

SCL_I2C

7

RX_UART1

20

SCL_OLED

8

SCK_SD_Card

21

RST_LoRa_Ethe

9

SCK_LoRa_Ethe

22

SDA_I2C

10

TX_UART1

23

SDA_OLED

11

CONNECT_LED

24

DI0_LoRa

12

CS_SD_Card

25

ESPrtk_IO

 

Example

Example 1

JSON - Message Configure

HOST Send

$ESP_OK|72|W|q|18|4|21|1|16|10|14|0|17|11|13|7|8|2|22|19|12|9|23|20|15|3|24|6|25|5|*3F0B

Default from factory

{

"CWB_Button" : "13" , "RX_UART0" : "3" , "MOSI_SD_Card" : "23" ,

"MOSI_LoRa_Ethe" : "33" , "TX_UART0" : "1" , "MISO_SD_Card" : "39" ,

"MISO_LoRa_Ethe" : "35" , "RX_UART1" : "17" , "SCK_SD_Card" : "18" ,

"SCK_LoRa_Ethe" : "25" , "TX_UART1" : "5" , "CONNECT_LED" : "15" ,

"CS_SD_Card" : "19" , "RX_UART2" : "16" , "ERROR_LED" : "12" ,

"CS_LoRa" : "32" , "TX_UART2" : "4" , "NEOPIXEL_LED" : "14" ,

"CS_Ethernet" : "0" , "SCL_I2C" : "22" , "SCL_OLED" : "27" ,

"RST_LoRa_Ethe" : "2" , "SDA_I2C" : "21" , "SDA_OLED" : "26" ,

"DI0_LoRa" : "34" , "ESPrtk_IO" : "36"

}

Example 2

JSON - Message Configure

HOST Send

$ESP_OK|72|W|q|18|4|5|1|10|9|16|12|8|2|17|11|15|6|23|20|21|14|24|3|22|19|7|13|0|25|*3F4F

Example configure of User

{

"CWB_Button" : "36" , "RX_UART0" : "3" , "MOSI_SD_Card" : "15" ,

"MOSI_LoRa_Ethe" : "27" , "TX_UART0" : "1" , "MISO_SD_Card" : "2" ,

"MISO_LoRa_Ethe" : "19" , "RX_UART1" : "34" , "SCK_SD_Card" : "14" ,

"SCK_LoRa_Ethe" : "5" , "TX_UART1" : "4" , "CONNECT_LED" : "17" ,

"CS_SD_Card" : "13" , "RX_UART2" : "35" , "ERROR_LED" : "25" ,

"CS_LoRa" : "18" , "TX_UART2" : "12" , "NEOPIXEL_LED" : "16" ,

"CS_Ethernet" : "0" , "SCL_I2C" : "33" , "SCL_OLED" : "22" ,

"RST_LoRa_Ethe" : "23" , "SDA_I2C" : "32" , "SDA_OLED" : "21" ,

"DI0_LoRa" : "26" , "ESPrtk_IO" : "39"

}

ACK Respond

$ESP_OK|46|W|q|1|( ID : GPIO_PIN_MAP ) : Saved Success .|*3616

NACK Respond

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

 

ESPrtk Respond

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘q’

STRING

-

-

1

1

ID Configure : GPIO_PIN_MAP

 

 

PL3

INTEGER

0

1

-

-

Status Configure

 

0

Error: Failed to save , please try again

1

OK : Saved configure success

 

PL4

STRING

-

-

-

-

Describe Status Configure in text string format

 

 

 

 

Command Read configure - GPIO_PIN_MAP

ESPrtk Respond

The index / range of values / data types is similar to the index / range of values / data types of payloads when configured.

 

Example

Message :

HOST Send

$ESP_OK|5|R|q||*772D

ACK Respond

$ESP_OK|72|R|q|18|4|21|1|16|10|14|0|17|11|13|7|8|2|22|19|12|9|23|20|15|3|24|6|25|5|*3A0B

NACK Respond

$ESP_ER|… or $ESS_ER|… or $AES_ER|…