# Understanding Logs

Here is the code which outputs the logs, the values are self explanatory

{% code overflow="wrap" %}

```c
ESP_LOGE(TAG," ST = %d, MT= %d, FT = %d, INT1 = %d, SE = %d, V = %0.2f, HT/LT = %d/%d, G = %c, SW = %d, C = %d",
         SystemTimer,MotionTimer,FrontPanelTimer,INT1,SleepModeEnabled,ADCBatteryVoltage,HeadIndex,TailIndex,GPSStatus,SOS,ChargingStatus);
         
```

{% endcode %}

**ST =  System Timer** &#x20;

Starts incrementing every second after boot and keeps doing so until next power cycle.

**MT= Motion Timer**&#x20;

Start incrementing on initialization and gets reset whenever INT1 interrupt from motion sensor goes low. Whenever INT1 or movement is detected InitAccelerometer function is called and MT is reset to 0. \
Motion Timer is checked at different stages to check if TIME\_TO\_SLEEP value has reached. If it has reached then device enters sleep mode if other conditions are satisfied. \
\
\
**FT = Front Panel Timer** &#x20;

This timer starts incrementing on boot and when it reaches 120 seconds LED are turned OFF. its just a counter for turning off LED to save power. \
\
**INT1 = INT1**&#x20;

This is Interrupt output of accelerometer which is configured to go low when movement threshold is crossed or shock is detected. Its a GPIO input which is polled continously.

**SE = SleepModeEnabled**&#x20;

This variable is just for debugging, it indicates if sleep mode variable is set or reset. It controls whether device has to enter sleep mode or not.&#x20;

\
**V = ADC Battery Voltage**&#x20;

The device main battery source is connected to ADC input of MCU which is read and converted and stored in this variable. (Main battery source is 12V input for VTS & 3.7V input for V4MFW)\
\
**HT/LT = Head Index & Tail Index**&#x20;

These values are circular buffer counters which are used to see how many packets are to be sent, if both are equal then nothing to be transmitted.&#x20;

**G = GPSStatus**&#x20;

This variable is indicator of whether GPS Sync is acheived or not.&#x20;

**SW = SOS switch input**&#x20;

This variable indicates the value read from the SOS pin. A switch is connected to this pin.&#x20;

**C = ChargingStatus**&#x20;

This variable is a GPIO input read from the Charger. It indicates whether the USB is plugged in or removed incase of the V4MFW USB tracker. Not used in VTS application .
