Ubidots Community

Send and recive multiple variables from/to Ubidots

Hi, i need to send two variables to Ubidots, and get also two values from Ubidots, i am using an arduino mega as logger and as telemetry unit esp8266, the code that is gave on the example works good for only one variable, I would like to know how to send to variables to Ubidots, and recive another two all at the same time.
Thanks it would be a lot of help

Hi @KarenViviana,

Thank you for sharing with questions with the community.

Please refer to the library to learn how to build the request containing more than one variable. Then, you will have to modify the following command to include a data traffic rate that is greater than one variable.

    sprintf(command, "init#");
    sprintf(command, "%s%s/%s|%s|%s|", command, USER_AGENT, VERSION, METHOD, TOKEN);
    sprintf(command, "%s%s=>", command, DEVICE_LABEL);
    sprintf(command, "%s%s:%s", command, VARIABLE_LABEL, str_sensor1);
    sprintf(command, "%s|end#final", command);

All the best,