Thank you... If I needed to send the reply in binary, would it just be a simple as:
msg.payload = 0x01;
Specifically, here is what I am trying to accomplish:
First, when the module connects to the server, the module sends its IMEI. First comes a short identifying the number of bytes written and then goes IMEI as text (bytes).
For example, IMEI 356307042441013 would be sent as 000F333536333037303432343431303133.
First two bytes denote IMEI length. In this case 0x000F means, that IMEI is 15 bytes long.
After receiving IMEI, server should determine if it would accept data from this module. If yes, server will reply to module 01, if not - 00. Note that confirmation should be sent as binary packet. I.e. 1 byte 0x01 or 0x00.
Then the module starts to send the first AVL data packet. After the server receives a packet and parses it, the server must report to the module number of data received as integer (four bytes).
If sent data number and reported by the server doesn’t match module resends sent data.
Module connects to server and sends IMEI:
Server accepts the module:
Module sends data packet
I am receiving the IMEI and trying to respond with a 01, which should tell the AVL Module to send the remaining data.
Here is my updated flow with the current debugging outputs: