[SOLVED] How to send an array of 60 hexadecimal bytes?


Dear Colleagues, I am working in a project using a HCS08 uController connected via UART to the ESP8266. On the HCS08 uC I write my code in C language and communicate to the ESP8266 via AT commands. All the basic WiFi and data send/receive using TCP is working fine.

Now I want to use ubidots, open a TCP connection and send 60 hexadecimal bytes every 10 minutes (for example).

Please, can anyone give some hints on how to do that?
I see a lot of topics here mentioning about Arduino, HTTP, sending one byte each time, etc… But could not find how to send an array of more bytes using TCP with AT commands.

Thanks in advanced.


Greetings @JIGTech, to send multiple values you should build this payload:

  • Endpoint: http://things.ubidots.com/api/v1.6/devices/{LABEL_DEVICE}/{VARIABLE_LABEL}/values
  • Payload: [{"value": 10, "timestamp":1464661369000}, {"value": 12, "timestamp":1464661369999}]

Please keep in mind that as default Ubidots for education does not parse hexadecimal values, so you should convert them to base-10 values before of sending them to the core. Business users have as additional feature a parsers module, with it you may send your values as hexadecimal and convert them using our core.