setup()function or any other function that is executed just one time in the program source code.
thing.handle()instruction must be included in the
loop()function or in the main recurrent execution function of the program source code.
delay()or any other locking instructions when coding for IoT purposes. Using it will make your device losing the connection with the network, which will result in continuous reconnection processes. If the program requires timing functionalities, it is possible to use non-locking structures for example:
thing.handle()instruction could be helpful to guarantee the connection.
thing.write_bucket, that has been implemented to send asynchronous communications to the server. It is important to be careful when using these instructions in a non-controlled way or create polling situations that will decrease the efficiency of the infrastructure. Next example code shows how to properly call to an asynchronous call just when an event is detected by the device code:
pson.is_empty()function and an auxiliary Pson to save the proper status of the resource (Arduino framework is being used):
Serialcommunication, as all the debugging information is displayed over Serial.