DUCKPAY Protocol - Version 3
Configulation
- Server
- Staging : mqtt.duckgroup.dev
- Production : mqtt.duckgroup.app
- Certifitcate
- Staging : Download File
- Production : Please connect manager to require
- Port : 8883
1 Device Control
1.1 Registeration (Bootup)
1.2 Command Topic
-- 1.2.1 [DPB28, DPB20]
{
"pType":string,
"pLen": int,
"pList":[]float,
"mode":string,
"param":[]int,
"maMode":{
"active":bool,
"icon": int,
"msg":string
}
}
--
-- 1.2.2 [ENBC5, ENBCX, ENBCT]
{
"menu":[
'name': 'เมนู'string,
'code': [จ่าย,คิดเงิน,กำไร,ต้นทุน]int,
'promotion':[
{
'code': [จ่าย,คิดเงิน,กำไร,ต้นทุน]int
'day' : [1,0,0,1,0,1,0,0]int,
'time': ["HH:mm", "HH:mm"]string,
'range': ['dd/MM/yyyy', 'dd/MM/yyyy']string,
'active': bool,
},
],
],
"maMode":{
"active":bool,
"icon": int,
"msg":string
}
}
---- Example
"cmd": {
"menu":[
{
'name': '5 เหรียญ',
'code : [5, 50, 0, 0],
promotion : [
{
'name': 'คืนพุธ 5 เหรียญ แถม 1 เหรียญ',
'code': [6, 50, -10, 0],
'day' : [0,0,0,1,0,0,0,0],
'time': ["00:00", "03:00"],
'range': ['01/01/1990', '01/01/3990'],
'active': true,
},
{
'name': 'คืนศุกร์ 5 เหรียญ แถม 2 เหรียญ',
'code': [7, 50, -20, 0],
'day' : [0,0,0,0,0,0,1,0],
'time': ["00:00", "03:00"],
'range': ['01/01/1990', '01/01/3990'],
'active': false,
}
]
},
{'name': '100'}
]
}
----
2 Payment
2.1 Request QR
2.2 Payment Success
2.3 Payment by CASH
3 etc. part
3.1 device status
- 'box' → 'aws mqtt'
{
"serialNo": "XXXXXXXXXXX",
"cmdId": "0301"
}
3.2 request upload firmware (OTA)
- 'aws mqtt' → 'box'
{
"serialNo": "XXXXXXXXXXX",
"cmdId": "0302",
"key":"xxxxxxxxxxxxxx"
}
3.3 upload firmware (OTA) status
- 'box' → 'aws mqtt'
{
"serialNo": "XXXXXXXXXXX",
"cmdId": "0302",
"data":{
"msg":"busy|updating|success"
}
}
4 third party part
4.1 machine status
- 'box' → 'aws mqtt'
{
"serialNo": "XXXXXXXXXXX",
"cmdId": "0401",
"data":{
"mName":"mini|sbox|etc",
"msg":"xxx"
}
}
4.1 machine report
- 'box' → 'aws mqtt'
{
"serialNo": "XXXXXXXXXXX",
"cmdId": "0402",
"data":{
"mName":"mini|sbox|etc",
"data":{
"col1":"",
"col2":"",
"col3":"",
"col4":"",
"colx":""
}
}
}