![]() ![]() ![]() tMethod(TYPE_TCP) //Set to TCP the way to send data Ubidots.add("Data0", value0) // Change for your variable name If ( (topLoop - lastvalues) >= Sendvalues) tDebug(true) //Uncomment this line for printing debug messages While ( Serial1.available( ) & data!='\n' ) While (Serial1.available( ) & data !='A') // check for A Void waitForString() // store the string received for external MCU Unsigned long lastvalues // Global initialize to 0 #define TOKEN "A1E-aqMXpkP85LiFUJWtmHuTLRID5X9eTc" // Put here your Ubidots TOKEN This example is to save multiple variables to the Ubidots API with TCP method This example is to get the last value of a variable from the Ubidots API Her is the code, and if you have some suggestion it is gonna be welcome. If you can give me some clue about the dashboard freeze and if this is related with the code I will appreciate very much. The external MCU send that string every 5 seconds so that when is time to send data to Ubidots dashboard, there are updated reading values. The variables are unparsed, converted to float type and send to Ubidots Dashboard. I am posting the code here and to your convenience, I refreshing the code’s job. There is an issue I would like to comment and it is that everything runs well for 2 or 3 hours.Īfter that time period, the dashboard page freeze and you need to refresh it. I’m sending 8 variables to dashboard every 60 seconds. I am excited about getting my code running with the educational version. Thank you for some I hope you spent a great weekend. *But NOT the followings ones, so it starts to throw errors: The point is that the compiler only accepts the following statement: Then I assume I can convert those values to float, in such way that they can be sent to Ubidots dashboard. Using strtok I am recovering each of those temperatures like string values I am wondering why Ubidots libraries don’t let me compile the function strtok.? If you rephrase this, probably I can answer your doubt. I do not quite understand this questions, Ubidots does not ‘define’ char arrays, Ubidots just receives your data through TCP, UDP, HTTP or MQTT. On the other hand how Ubidots define an array of characters? Your dots are stored in RAW variables, but you can use synthetic variables as well to process data if you need it. What type of variable should I use with Ubidots platform? For sending several values in bulk, please refer to our REST API. If you wish to send several values for the same variable, aka temperature you will have to set the timestamp to store per each value, if not, there is no way that Ubidots know what date to use for your stored value. Ubidots stores values as time series where each value is related with a specific Unix timestamp: How to send each one of those variables to be displayed through gauges or tables in the dashboard. That string includes 8 temperature values which can be recovered and stored on 8 char variable ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |