forked from Atos-Research-and-Innovation/IoTagent-LoRaWAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
150 lines (130 loc) · 4.5 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
* Copyright 2018 Atos Spain S.A
*
* This file is part of iotagent-lora
*
* iotagent-lora is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* iotagent-lora is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with iotagent-lora.
* If not, seehttp://www.gnu.org/licenses/.
*
*/
var config = {};
config.iota = {
/**
* Configures the log level. Appropriate values are: FATAL, ERROR, INFO, WARN and DEBUG.
*/
logLevel: 'DEBUG',
/**
* When this flag is active, the IoTAgent will add the TimeInstant attribute to every entity created, as well
* as a TimeInstant metadata to each attribute, with the current timestamp.
*/
timestamp: true,
/**
* Context Broker configuration. Defines the connection information to the instance of the Context Broker where
* the IoT Agent will send the device data.
*/
contextBroker: {
/**
* Host where the Context Broker is located.
*/
host: 'localhost',
/**
* Port where the Context Broker is listening.
*/
port: '1026',
/**
* Version of NGSI
*/
ngsiVersion: 'v2'
},
/**
* Configuration of the Northbound server of the IoT Agent.
*/
server: {
/**
* Port where the IoT Agent will be listening for requests.
*/
port: 4061
},
/**
* Default resource of the IoT Agent. This value must be different for every IoT Agent connecting to the IoT
* Manager.
*/
defaultResource: '/iot/d',
/**
* Defines the configuration for the Device Registry, where all the information about devices and configuration
* groups will be stored. There are currently just two types of registries allowed:
*
* - 'memory': transient memory-based repository for testing purposes. All the information in the repository is
* wiped out when the process is restarted.
*
* - 'mongodb': persistent MongoDB storage repository. All the details for the MongoDB configuration will be read
* from the 'mongoDb' configuration property.
*/
deviceRegistry: {
type: 'mongodb'
},
/**
* Mongo DB configuration section. This section will only be used if the deviceRegistry property has the type
* 'mongodb'.
*/
mongodb: {
/**
* Host where MongoDB is located. If the MongoDB used is a replicaSet, this property will contain a
* comma-separated list of the instance names or IPs.
*/
host: 'localhost',
/**
* Port where MongoDB is listening. In the case of a replicaSet, all the instances are supposed to be listening
* in the same port.
*/
port: '27017',
/**
* Name of the Mongo database that will be created to store IOTAgent data.
*/
db: 'iotagentlora'
/**
* Name of the set in case the Mongo database is configured as a Replica Set. Optional otherwise.
*/
// replicaSet: ''
},
/**
* Types array for static configuration of services. Check documentation in the IoTAgent Library for Node.js for
* further details:
*
* https://github.com/telefonicaid/iotagent-node-lib#type-configuration
*/
types: {},
/**
* Default service, for IOTA installations that won't require preregistration.
*/
service: 'howtoService',
/**
* Default subservice, for IOTA installations that won't require preregistration.
*/
subservice: '/howto',
/**
* URL Where the IOTA Will listen for incoming updateContext and queryContext requests (for commands and passive
* attributes). This URL will be sent in the Context Registration requests.
*/
providerUrl: 'http://localhost:4061',
/**
* Default maximum expire date for device registrations.
*/
deviceRegistrationDuration: 'P1Y',
/**
* Default type, for IOTA installations that won't require preregistration.
*/
defaultType: 'Thing'
};
module.exports = config;