CE-COM2 Using BASE64 Encoding
Written by Gary Brindley
Updated at December 29th, 2025
Question:
Does communicating with a device connected to a CE-COM2 require using BASE64 encoding?
Answer:
Yes, communicating with a device connected to a CE-COM2 requires BASE64 encoding.
A CE-COM2 utilizes JSON packets when communicating information between a control system and a CE-COM2. In order to transfer byte data that flows through the serial ports, that data is required to be converted using BASE64 encoding before being used in a JSON packet.
The following HControl command utilizes a JSON packet to send the word "Hello" out of serial port number one:
exec {"path":"/serial/1", "command":"send","arguments":{"data":"SGVsbG8="}}
Notice that the word "Hello" has been converted to "SGVsbG8=".
When receving strings from the CE-COM2's serial ports, that data also comes in using BASE64 encoding. Here is the same word "Hello" being received in an HControl event from a CE-COM2:
event {"path":"/serial/1/receive","arguments":{"data":"SGVsbG8="}}
In order to parse the actual string being received, you will need to decode the "data" string back to its original byte data.