I am currently doing project which requires communication from a PC to the device, so far I've decided on socket comms. and have written some code. I am also using ZMQ for ipc on the device itself.
My script works by sending data as text across. I was trying to encode my data to utf-8 so that it can be easily read on the device and displays in a frame and performs the tasks as needed. However, I can't seem to get the encoding working right, I've tried searching for examples or tutorials online but can't seem to find any.
I've tried using socket.send (msg.encode("UTF-8")) to encode my data, and message = socket.recv() to recv & print the data on the server. This works but the server would print out the exact text data which is not what I wanted. I'm unsure whether this is the correct way, and hope that someone could point me in the correct direction for encoding & printing the encoded data without decoding back to text.