meldCX
Smart HUB
Firmware version 3.30
4th of October 2023
Command Set
Revision 0.1
Packet Definition
The format of data packet
bytes | 0~3 | 4 | 5 | 6 | 7 |
Name | Header | Command | Port | Data | Footer |
Value | 0x4D534248 | 0x01 ~ 0xFF | 0x01 ~ 0x09 | 0x0 ~ 0xFF | 0x04 |
Header (fixed value)
Description | Header |
Value | ‘meld’ 0x4D534248 |
Command set
Description | Command |
Value | Hexadecimal values |
Port Number (USB, GPIO, I2C port number)
Description | Channel # |
USB Ports | 0x01 – 0x02 – 0x03 – 0x04 – 0x05 – 0x06 – 0x07 – 0x08 – 0x09 |
GPIO Ports | 0x01 – 0x02 – 0x03 |
I2C Ports | 0x01 – 0x02 – 0x03 |
Data (general use parameter)
Description | Data |
Value | 0x0 to 0xFF |
Footer (fixed value)
Description | Footer |
Value | 0x04 |
Serial Protocol Configuration
Description | Value |
Baud Rate | 57600 |
Data Bits | 8 |
Parity | None |
Stop Bit | 1 |
Flow Control | None |
Smart Board Layout
Commands List
# | Command | Value |
1 | Reset board | 0x20 |
2 | Get board information | 0x30 |
3 | Read GPIO port | 0x40 |
4 | Turn USB port power on/off | 0x50 |
5 | Read USB port power status | 0x51 |
6 | Read proximity sensor (I2C port 1) | 0x60 |
7 | Read input voltage current | 0x70 |
8 | Using RealTerm | |
9 | Firmware Upload |
Status Code
# | Description | Code |
1 | Successfully | 0xD0 |
2 | Invalid Port | 0xD1 |
3 | Invalid Data | 0xD2 |
4 | Invalid Command | 0xD3 |
5 | Invalid Header | 0xD4 |
Sending HEX command to serial port
Use REALTERM serial terminal software to send the HEX commands to the serial port.
For more details, please see how to use realterm to send HEX serial commands.
Commands Description
-
Reset board – 0x20
Packet send
Header | Command | Port | Data | Footer | |
Value | 4D534248 | cmd | blank | blank | 04 |
cmd: 0x20
blank: 0x0
Packet Receive
Bytes | Value | Description |
1 byte | 0x01 | SOH - Start of Heading |
1 byte | (0xd0, 0xd1, 0xd2, 0xd3 0xd4) | See Status code table |
1 byte | 0x04 | EOT - End of Transmission |
Default Values:
Description | Strip Color |
USB Port 1 Power | On |
USB Port 2 Power | On |
USB Port 3 Power | On |
USB Port 4 Power | On |
USB Port 5 Power | On |
USB Port 6 Power | On |
USB Port 7 Power | On |
USB Port 8 Power | On |
USB Port 9 Power | On |
GPIO Port 1 | Pulled up high |
GPIO Port 2 | Pulled up high |
GPIO Port 3 | Pulled up high |
I2C Port 1 | Proximity Sensor TOF200 |
Example:
Packet out: 0x4d 0x53 0x42 0x48 0x20 0x00 0x00 0x04
Packet in: 0x01 0xd0 0x04
-
Get bored information – 0x30
Packet send
Header | Command | Port | Data | Footer | |
Value | 4D534248 | cmd | blank | blank | 04 |
cmd: 0x30
blank: 0x0
Packet Receive
Bytes | Value | Description |
1 byte | 0x01 | SOH - Start of Heading |
83 bytes | ASCII String | Board Information (ASCII format) |
1 byte | (0xd0, 0xd1, 0xd2, 0xd3 0xd4) | See Status code table |
1 byte | 0x04 | EOT - End of Transmission |
Example:
Packet out: 0x4d 0x53 0x42 0x48 0x30 0x00 0x00 0x04
Packet in: 0x01 0x46 0x69 0x72 0x6D 0x77 0x61 0x72 0x65 0x20 0x56 0x65 0x72 0x73 0x69 0x6F 0x6E 0x3A 0x20 0x33 0x2E 0x33 0x30 0x0D 0x0A 0x46 0x69 0x72 0x6D 0x77 0x61 0x72 0x65 0x20 0x44 0x61 0x74 0x65 0x3A 0x20 0x30 0x33 0x2F 0x31 0x30 0x2F 0x32 0x30 0x32 0x33 0x0D 0x0A 0x50 0x72 0x6F 0x64 0x75 0x63 0x74 0x20 0x4E 0x61 0x6D 0x65 0x3A 0x20 0x6D 0x65 0x6C 0x64 0x43 0x58 0x20 0x53 0x6D 0x61 0x72 0x74 0x20 0x48 0x55 0x42 0x0D 0x0A 0xD0 0x04
-
Read GPIO Port – 0x40
Packet send
Header | Command | Port | Data | Footer | |
Value | 4D534248 | cmd | port | blank | 04 |
cmd: 0x40
port: (0x1, 0x2, 0x3) – GPIO port number
blank: 0x0
Packet Receive
Bytes | Value | Description |
1 byte | 0x01 | SOH - Start of Heading |
1 byte | 0x00 – 0x01 | 0x00 low – 0x01 high |
1 byte | (0xd0, 0xd1, 0xd2, 0xd3 0xd4) | See Status code table |
1 byte | 0x04 | EOT - End of Transmission |
Example:
Packet out: 0x4d 0x53 0x42 0x48 0x40 0x01 0x00 0x04
Packet in: 0x01 0x01 0xd0 0x04
-
Turn USB port power on/off – 0x50
Packet send
Header | Command | Port | Data | Footer | |
Value | 4D534248 | Cmd | port | data | 04 |
cmd: 0x50
port: (0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9) – USB port number
data: (0x00 – 0x01) – 0x00 off – 0x01 on
Packet Receive
Bytes | Value | Description |
1 byte | 0x01 | SOH - Start of Heading |
1 byte | (0xd0, 0xd1, 0xd2, 0xd3 0xd4) | See Status code table |
1 byte | 0x04 | EOT - End of Transmission |
Example:
Packet out: 0x4d 0x53 0x42 0x48 0x40 0x01 0x00 0x04
Packet in: 0x01 0xd0 0x04
-
Read USB port power status – 0x51
Packet send
Header | Command | Port | Data | Footer | |
Value | 4D534248 | cmd | port | blank | 04 |
cmd: 0x51
port: (0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9) – USB port number
blank: 0x0
Packet Receive
Bytes | Value | Description |
1 byte | 0x01 | SOH - Start of Heading |
1 byte | 0x00 – 0x01 | 0x00 off – 0x01 on |
1 byte | (0xd0, 0xd1, 0xd2, 0xd3 0xd4) | See Status code table |
1 byte | 0x04 | EOT - End of Transmission |
Example:
Packet out: 0x4d 0x53 0x42 0x48 0x51 0x1 0x0 0x4
Packet in: 0x01 0x01 0xd0 0x04
-
Read Proximity Sensor (I2C port 1) – 0x60
Packet send
Header | Command | Port | Data | Footer | |
Value | 4D534248 | cmd | blank | blank | 04 |
cmd: 0x60
blank: 0x0
Packet Receive
Bytes | Value | Description |
1 byte | 0x01 | SOH - Start of Heading |
5 to 8 bytes | ASCII String | Object Distance |
1 byte | (0xd0, 0xd1, 0xd2, 0xd3 0xd4) | See Status code table |
1 byte | 0x04 | EOT - End of Transmission |
Example:
Packet out: 0x4d 0x53 0x42 0x48 0x60 0x0 0x0 0x4
Packet in: 0x01 0x31 0x36 0x33 0x38 0x33 0x2e 0x37 0x35 0xd0 0x04
-
Read input voltage current – 0x70
Packet send
Header | Command | Port | Data | Footer | |
Value | 4D534248 | cmd | blank | blank | 04 |
cmd: 0x60
blank: 0x0
Packet Receive
Bytes | Value | Description |
1 byte | 0x01 | SOH - Start of Heading |
4 to 5 bytes | ASCII String | input voltage current |
1 byte | (0xd0, 0xd1, 0xd2, 0xd3 0xd4) | See Status code table |
1 byte | 0x04 | EOT - End of Transmission |
Example:
Packet out: 0x4d 0x53 0x42 0x48 0x70 0x0 0x0 0x4
Packet in: 0x01 0x30 0x2e 0x30 0x31 0xd0 0x04
Using RealTerm
- Download RealTerm from the following link:
https://realterm.sourceforge.io/
- Install RealTerm on your windows based computer
- Open RealTerm, click on Display tab and select ASCII
- Click on Port tab and select the Smart board com port then set the following:
Baud: 57600
Parity: none
DataBits: 8
Stop Bit: 1
Hardware flow control: none
Then click on Open twice
- Open the Smart board Command set documentation and copy the command you want to test
In this example, we are going to copy “get board information”
- Go back to RealTerm and click on Send tab then paste the command you copped in step 5 on the left of Send Numbers (as showed in the following screen capture)
- Click on Send Numbers, You should receive the firmware version in ASCII format.
- If you need to show the results in HEX format; Click on Display tab then select:
Hexadecimal [space]
- Click on Send tab, the click on Send Number.
You will get the firmware displayed in hexadecimal [space] format
Firmware Upload
1. You will need to use windows-10 operating system.
2. Disconnect all usb devices on your computer.
3. Connect the the smart board to your PC USB port.
4. run CMD as administrator.
5. unzip the attached file boot-loader zip file
6. type fw-update.bat then press enter.
Example
D: \ boot-loader-folder-name>fw-update
Comments
0 comments
Please sign in to leave a comment.