I’m trying to send data to my Device variable. Problem is that while the data does go in, it goes to a newly created device called “GPRS”. I want the data to go to an already existing variable in my already existing device.
The Ubidots library assign “GPRS” as device label by default, that’s means if you don’t have one created with the same device label it will created a new one.
If your desire to send data to an already existing device, you have to assign the device label manually into the code adding the line below in the setup of your code, you can reference to the README for more information:
Take in count that is the device is already created you will not able to set the device name using the method of the library. In this case, you have to modify the name manually as is shown in the article above.
Thanks for the Help. It worked. I used setDeviceLabel(), and that solved it.
When I was still struggling with it, I actually went into the library itself and changed the_device_label = "GPRS" to _device_label = "myDeviceLabel", that had solved it, but it was not what I wanted. I wanted to change it in code.
I’m a little embarrassed that I didn’t notice the variable value I was changing belonged to _device_label and not _device_name. That would have given me a clue as to which function I should use in my code.
Anyway, the library has been returned to its normal state and setDeviceLabel() is the solution.
Thank you very much.