<commit_before>/*
	Location Aware Sensor System(LASS) by Linkit ONE

        Vision: We hope location aware sensor data can be easy to provide, share, and become useful to everyone.
        
        Sensor Used as example:
          Sound Sensor: http://www.seeedstudio.com/wiki/Grove_-_Sound_Sensor
          
	Board jumper setting:
            SPI/SD = SPI
            Mass Storage Bootup/Normal Bootup = Normal Bootup
            USB Power Source/Li-Battery Power Source = USB Power Source 
        The circuit:
		Default Output PIN: 
                  ARDUINO_LED_PIN = 13,
                  STORAGE_CHIP_SELECT_PIN = 10 (Reserved)
                Sensor Input PIN:
                  SOUND_SENSOR_PIN = A1
                  DUST_SENSOR_PIN = 8,	cal
                  UV_SENSOR_PIN = A0
                  TEMP-HUMID_SENSOR_PIN = 2
                  BAROMETER_SENSOR_PIN -> I2C
                  LIGHT_SENSOR -> I2C
                Action Output PIN:
                  BUZZER_ALARM_PIN = 3
        LinkItONE:
          Used wifi, gps, flash. Remind wifi/gps antenna needed.
        
        Sensor position definition:
        0-9(System sensor):   reserved for system sensor, should not be modified for individual application purpose.
        10-19(User sensor): user customization purpose, user can freely customize this area
        
        Default system sensor order:
          0: record_id, 1: battery level, 2: battery charging, 3: ground speed ( Km/hour ) 
        Default user sensor order:
          10: dust sensor, 11: UV  sensor, 12: sound sensor 
        Default user sensor order in APP-3 (MAPS):
          10: barometer sensor (high accuracy), 11&12: temperature & humidity sensor pro, 13: digital light sensor

	Default Sensor Type: ( -: void;  0-9: reserved for system sensor;  A-Z: Grove sensors;  a-z: reserved for customized sensors)
		-: unused
		0: record ID
		1: battery level
		2: battery charging
		3: ground speed
		D: dust sensor
		U: UV sensor
		S: sound sensor
		B: barometer sensor (hPa)
		T: temperature sensor (degree C)
		H: humidity sensor (%)
		L: light sensor (LUX)
        
        Original:
          The idea come from here: http://iot-hackseries.s3-website-us-west-2.amazonaws.com/linkitone-setup.html

        Optional sample sensor:
          AP1-SENSOR_ID_DUST: Dust sensor: http://www.seeedstudio.com/depot/Grove-Dust-Sensor-p-1050.html
          AP1-SENSOR_ID_UV: UV sensor: http://www.seeedstudio.com/depot/Grove-UV-Sensor-p-1540.html
          AP1-SENSOR_ID_SOUND: Sound sensor: http://www.seeedstudio.com/depot/Grove-Sound-Sensor-p-752.html
      	  AP2-SENSOR_ID_DUST: Dust sensor http://tw.taobao.com/item/43750623059.htm
          AP3-SENSOR_ID_BAROMETER: Barometer sensor (high accuracy): http://www.seeedstudio.com/wiki/Grove_-_Barometer_(High-Accuracy)
          AP3-SENSOR_ID_TEMPERATURE: Temperture and Humidity sensor pro: http://www.seeedstudio.com/wiki/Grove_-_Temperature_and_Humidity_Sensor_Pro
          AP3-SENSOR_ID_HUMIDITY: Temperture and Humidity sensor pro: http://www.seeedstudio.com/wiki/Grove_-_Temperature_and_Humidity_Sensor_Pro
          AP3-SENSOR_ID_LIGHT: Digital Light sensor: http://www.seeedstudio.com/wiki/Grove_-_Digital_Light_Sensor
        Optional alarm:
          Buzzer : http://www.seeedstudio.com/depot/Grove-Buzzer-p-768.html
        Created 26/06/2015
	By Wuulong

	https://github.com/wuulong/LinkitOneGroup

*/
#define BLYNK_ENABLE 0 // deafult(0) 0: If you don't need to support BLYNK, 1: support BLYNK 
#define ALARM_ENABLE 1 // default(0) 0: disable alarm, 1: enable alarm


// Blynk
#if BLYNK_ENABLE == 1
  #define ARDUINO 150 // to avoid Blynk library use yield() in function run(), without this. system will crash!
  #include <BlynkSimpleLinkItONE.h>
  #define BLYNK_POOLING_TIME 1000 // the blynk pooling loop can't delay too long, quick check is 5000 ms, set is < 5000
#else
  #include <LWiFi.h>
  #include <LWiFiClient.h>
#endif

#include <PubSubClient.h>
#include <Wire.h>
#include <MtkAWSImplementations.h>
#include <LGPS.h>

#define VER_FORMAT "1"
#define FMT_OPT 0 // FMT_OPT : 0: default format with gps, 1: default format but gps is fix data, need to update GPS_FIX_INFOR 
    // ( format is right, but no actual gps information because no gps device exist ) 
#define VER_APP "0.7.1"


#define POLICY_ONLINE_ALWAYS 1
#define POLICY_ONLINE_LESS 2
#define POLICY_ONLINE_DEFAULT 0

#define POLICY_POWER_DONTCARE 0
#define POLICY_POWER_SAVE 1<commit_msg>- update the data format version number from 1 to 2<commit_after>/*
	Location Aware Sensor System(LASS) by Linkit ONE

        Vision: We hope location aware sensor data can be easy to provide, share, and become useful to everyone.
        
        Sensor Used as example:
          Sound Sensor: http://www.seeedstudio.com/wiki/Grove_-_Sound_Sensor
          
	Board jumper setting:
            SPI/SD = SPI
            Mass Storage Bootup/Normal Bootup = Normal Bootup
            USB Power Source/Li-Battery Power Source = USB Power Source 
        The circuit:
		Default Output PIN: 
                  ARDUINO_LED_PIN = 13,
                  STORAGE_CHIP_SELECT_PIN = 10 (Reserved)
                Sensor Input PIN:
                  SOUND_SENSOR_PIN = A1
                  DUST_SENSOR_PIN = 8,	cal
                  UV_SENSOR_PIN = A0
                  TEMP-HUMID_SENSOR_PIN = 2
                  BAROMETER_SENSOR_PIN -> I2C
                  LIGHT_SENSOR -> I2C
                Action Output PIN:
                  BUZZER_ALARM_PIN = 3
        LinkItONE:
          Used wifi, gps, flash. Remind wifi/gps antenna needed.
        
        Sensor position definition:
        0-9(System sensor):   reserved for system sensor, should not be modified for individual application purpose.
        10-19(User sensor): user customization purpose, user can freely customize this area
        
        Default system sensor order:
          0: record_id, 1: battery level, 2: battery charging, 3: ground speed ( Km/hour ) 
        Default user sensor order:
          10: dust sensor, 11: UV  sensor, 12: sound sensor 
        Default user sensor order in APP-3 (MAPS):
          10: barometer sensor (high accuracy), 11&12: temperature & humidity sensor pro, 13: digital light sensor

	Default Sensor Type: ( -: void;  0-9: reserved for system sensor;  A-Z: Grove sensors;  a-z: reserved for customized sensors)
		-: unused
		0: record ID
		1: battery level
		2: battery charging
		3: ground speed
		D: dust sensor
		U: UV sensor
		S: sound sensor
		B: barometer sensor (hPa)
		T: temperature sensor (degree C)
		H: humidity sensor (%)
		L: light sensor (LUX)
        
        Original:
          The idea come from here: http://iot-hackseries.s3-website-us-west-2.amazonaws.com/linkitone-setup.html

        Optional sample sensor:
          AP1-SENSOR_ID_DUST: Dust sensor: http://www.seeedstudio.com/depot/Grove-Dust-Sensor-p-1050.html
          AP1-SENSOR_ID_UV: UV sensor: http://www.seeedstudio.com/depot/Grove-UV-Sensor-p-1540.html
          AP1-SENSOR_ID_SOUND: Sound sensor: http://www.seeedstudio.com/depot/Grove-Sound-Sensor-p-752.html
      	  AP2-SENSOR_ID_DUST: Dust sensor http://tw.taobao.com/item/43750623059.htm
          AP3-SENSOR_ID_BAROMETER: Barometer sensor (high accuracy): http://www.seeedstudio.com/wiki/Grove_-_Barometer_(High-Accuracy)
          AP3-SENSOR_ID_TEMPERATURE: Temperture and Humidity sensor pro: http://www.seeedstudio.com/wiki/Grove_-_Temperature_and_Humidity_Sensor_Pro
          AP3-SENSOR_ID_HUMIDITY: Temperture and Humidity sensor pro: http://www.seeedstudio.com/wiki/Grove_-_Temperature_and_Humidity_Sensor_Pro
          AP3-SENSOR_ID_LIGHT: Digital Light sensor: http://www.seeedstudio.com/wiki/Grove_-_Digital_Light_Sensor
        Optional alarm:
          Buzzer : http://www.seeedstudio.com/depot/Grove-Buzzer-p-768.html
        Created 26/06/2015
	By Wuulong

	https://github.com/wuulong/LinkitOneGroup

*/
#define BLYNK_ENABLE 0 // deafult(0) 0: If you don't need to support BLYNK, 1: support BLYNK 
#define ALARM_ENABLE 1 // default(0) 0: disable alarm, 1: enable alarm


// Blynk
#if BLYNK_ENABLE == 1
  #define ARDUINO 150 // to avoid Blynk library use yield() in function run(), without this. system will crash!
  #include <BlynkSimpleLinkItONE.h>
  #define BLYNK_POOLING_TIME 1000 // the blynk pooling loop can't delay too long, quick check is 5000 ms, set is < 5000
#else
  #include <LWiFi.h>
  #include <LWiFiClient.h>
#endif

#include <PubSubClient.h>
#include <Wire.h>
#include <MtkAWSImplementations.h>
#include <LGPS.h>

#define VER_FORMAT "2"	// version number has been increased to 2 since v0.7.0
#define FMT_OPT 0 // FMT_OPT : 0: default format with gps, 1: default format but gps is fix data, need to update GPS_FIX_INFOR 
    // ( format is right, but no actual gps information because no gps device exist ) 
#define VER_APP "0.7.1"


#define POLICY_ONLINE_ALWAYS 1
#define POLICY_ONLINE_LESS 2
#define POLICY_ONLINE_DEFAULT 0

#define POLICY_POWER_DONTCARE 0
#define POLICY_POWER_SAVE 1
{'fraction_non_alphanumeric': 0.08308374930671104, 'fraction_numerical': 0.027509706045479757, 'mean_word_length': 2.6502024291497976, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 18, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1659477', 'n_tokens_mistral': 3242, 'n_tokens_neox': 2931, 'n_words': 860}