Configuration of communication with Sigfox
This preconfiguration can be activated when creating a new object (e.g. by "New object"
in the local object menu or by pressing the Insert
key after selecting the object) and is included in the group: " / Communication / Sigfox"
This preconfiguration can be used with the objects: PmFolder or PmRoot.
The preconfiguration creates main PmFolder
containing three subfolders
and service PmPanel
Commun - allows processing data in requested range from individual devices that are stored in cloud service Sigfox
History - allows reading and local storage of history of selected values from devices registered in the cloud service
Test - creates administration screen that can be used in order to create configuration file for trending selected values
Commun - PmFolder
Main object configured as communication driver of the service. The PmFolder object has methods Authenticate, StartReceiveTypes, StartReceiveDevices, StartReceiveDeviceData and StartReceiveHistoryData that are used to initiate the communication. In the Authenticate method, there are login entries requested for cloud service access. The following methods call the Add method of the PmSequencer object including the corresponding parameters. It triggers the onStep event of the PmSequencer object where the HttpRequest object executes the communication with the service. The data obtained by the communication are then passed to the object that is defined in the last parameter of the method StartReceive.... This object must contain the corresponding method onReceive... that can process the received data.
History - PmFolder
Subobjects in this folder are responsible for processing data from communication and saving corresponding values into trends. For correct functionality it is necessary to define:
- Parameter id
that represents device identifier (e.g.: FD826) and period
- time in which the next communication for reading the data will be initiated.
- In method GetTimeLastRecord it is possible to define the oldest data that will be saved into the trend database when the first communication is initiated.
- In method ParseData it is necessary to modify the script that decodes the received data.
- In subobject PmTrend
on page Data
define the corresponding number of variables.
Automatic launch of communication after application start can be enabled in scriptin event onStart
Once the communication is initiated for the first time, data history will be read (from the cloud). The time period of data to be read is defined in method GetTimeLastRecord
. Based on the quantity of data to be read, the process may take significant amount of time to be completed. Once the data history reading is completed, next data reading is scheduled to time defined in Parameter Period
. This value defines the number of seconds before next data reading is initiated after the previous data reading is completed.
Test - PmFolder
The folder contains testing panel "TestPanel
" and auxiliary object PmData
. The panel can be used for testing and viewing the received data.
These configurators can be set before the preconfiguration is created:
|The name of created object||Name of the object created in the application object tree. This is a system name and must not contain diacritics, empty string, spaces and the first character must not be a number.|
|Login - assigned name of APIACCESS of the Sigfox service account||assigned identification code - Login of APIACCESS account of Sigfox service|
|Password - assigned password of APIACCESS account of Sigfox service||Assigned APIACCESS account login password of Sigfox service|