Remote Writing IoT Data to Influx-DB over HTTP-API.
Fork of AvnetATT_shape_hackathon by
config_me.h@37:bb05aebd6139, 2017-10-10 (annotated)
- Committer:
- fenar
- Date:
- Tue Oct 10 15:56:54 2017 +0000
- Revision:
- 37:bb05aebd6139
- Parent:
- 35:4a5d307b9692
Minor Updates.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JMF | 2:0e2ef866af95 | 1 | #ifndef __CONFIG_ME_H_ |
JMF | 2:0e2ef866af95 | 2 | #define __CONFIG_ME_H_ |
JMF | 2:0e2ef866af95 | 3 | |
JMF | 2:0e2ef866af95 | 4 | // User must set these for own context: |
fkellermavnet | 21:d0038d14ee7c | 5 | |
fkellermavnet | 21:d0038d14ee7c | 6 | // This is the server's base URL name. Example "www.google.com" |
stefanrousseau | 24:bd480d2aade4 | 7 | // Note that when you Fork a FLOW, it will typically assign either |
fenar | 35:4a5d307b9692 | 8 | //static const char * MY_SERVER_URL = "influxdb.io"; |
fenar | 35:4a5d307b9692 | 9 | static const char * MY_SERVER_URL = "172.27.140.140"; |
fkellermavnet | 21:d0038d14ee7c | 10 | |
stefanrousseau | 24:bd480d2aade4 | 11 | // These are FLOW fields from the Endpoints tab: |
fenar | 35:4a5d307b9692 | 12 | #define FLOW_BASE_URL "/" |
fenar | 35:4a5d307b9692 | 13 | #define FLOW_INPUT_NAME "write" |
fenar | 35:4a5d307b9692 | 14 | |
fkellermavnet | 21:d0038d14ee7c | 15 | |
stefanrousseau | 24:bd480d2aade4 | 16 | // Unless you want to use a different protocol, this field should be left as is: |
stefanrousseau | 12:7c94ec5069dc | 17 | #define FLOW_URL_TYPE " HTTP/1.1\r\nHost: " |
stefanrousseau | 12:7c94ec5069dc | 18 | |
stefanrousseau | 24:bd480d2aade4 | 19 | // This identifier specifies with which FLOW device you are communicating. |
stefanrousseau | 24:bd480d2aade4 | 20 | // If you only have one devive there then you can just leave this as is. |
stefanrousseau | 24:bd480d2aade4 | 21 | // Once your FLOW device has been initialized (Virtual Device Initialize clicked), |
stefanrousseau | 24:bd480d2aade4 | 22 | // the Virtual Device will show up in M2X. This is its "DEVICE SERIAL" field |
fenar | 35:4a5d307b9692 | 23 | // https://runm-central.att.io/7112dfcbd9ae0/921b0008500b/b2f385c14622519/in/flow |
fenar | 37:bb05aebd6139 | 24 | #define FLOW_DEVICE_NAME "starterkit001" |
fkellermavnet | 21:d0038d14ee7c | 25 | |
stefanrousseau | 24:bd480d2aade4 | 26 | // This constant defines how often sensors are read and sent up to FLOW |
stefanrousseau | 24:bd480d2aade4 | 27 | #define SENSOR_UPDATE_INTERVAL_MS 5000; //5 seconds |
stefanrousseau | 24:bd480d2aade4 | 28 | |
stefanrousseau | 24:bd480d2aade4 | 29 | // Specify here how many sensor parameters you want reported to FLOW. |
stefanrousseau | 24:bd480d2aade4 | 30 | // You can use only the temperature and humidity from the shield HTS221 |
stefanrousseau | 24:bd480d2aade4 | 31 | // or you can add the reading of the FXO8700CQ motion sensor on the FRDM-K64F board |
stefanrousseau | 24:bd480d2aade4 | 32 | // or if you have a SiLabs PMOD plugged into the shield, you can add its proximity sensor, |
stefanrousseau | 24:bd480d2aade4 | 33 | // UV light, visible ambient light and infrared ambient light readings |
stefanrousseau | 12:7c94ec5069dc | 34 | #define TEMP_HUMIDITY_ONLY 1 |
stefanrousseau | 12:7c94ec5069dc | 35 | #define TEMP_HUMIDITY_ACCELEROMETER 2 |
stefanrousseau | 12:7c94ec5069dc | 36 | #define TEMP_HUMIDITY_ACCELEROMETER_PMODSENSORS 3 |
stefanrousseau | 31:d7c386d2e95a | 37 | static int iSensorsToReport = TEMP_HUMIDITY_ONLY; //modify this to change your selection |
stefanrousseau | 12:7c94ec5069dc | 38 | |
fenar | 35:4a5d307b9692 | 39 | // This is the APN name for the cellular network |
fenar | 35:4a5d307b9692 | 40 | static const char * MY_APN_STR = "default"; |
fkellermavnet | 21:d0038d14ee7c | 41 | |
fkellermavnet | 21:d0038d14ee7c | 42 | //This is for normal HTTP. If you want to use TCP to a specific port, change that here: |
fenar | 35:4a5d307b9692 | 43 | static const char * MY_PORT_STR = "8086"; |
JMF | 2:0e2ef866af95 | 44 | |
JMF | 2:0e2ef866af95 | 45 | #endif |