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 after pressing the Insert
key after selecting the object) and is included in the group: " / Communication / Sigfox"
This preconfiguration can be created in the object: PmaFolder
The preconfiguration creates an object of the PmaFolder
type containing three subfolders
and service PmaPanel
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
Main object configured as communication driver of the service. The PmaFolder
object has methods Authenticate
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 PmaSequencer
object including the corresponding parameters. It triggers the onStep
event of the PmaSequencer
object where the HttpRequest
object executes the communication with the service. The data obtained from 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.
Subobjects in this folder are responsible for processing data from the communication and saving corresponding values into trends. For correct functionality it is necessary to define:
- The id parameter that represents device identifier (e.g.: FD826) and the period parameter - time in which the next communication for reading the data will be initiated.
- In the "GetTimeLastRecord" method it can be set the oldest data that will be saved into the trend database when the first communication is initiated.
- In the "ParseData" method it is necessary to modify the script that decodes the received data.
- In subobject PmaTrendGroup
on the "Data
" tab define the corresponding number of variables.
Automatic launch of communication after starting the application can be enabled in the script of the 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 the "GetTimeLastRecord"
method. 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 the Period
parameter. This value defines the number of seconds before next data reading is initiated after the previous data reading is completed.
The folder contains testing panel "TestPanel
" and auxiliary PmaData
object. The panel serves 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 tree of Pma objects. The maximum name length is 30 characters. This is a system name, so it must contain only alphanumeric and must not contain any 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|