Understanding Logs

The ESP-IDF code outputs a log continously every second, lets look at what each parameter means.

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

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);
         

ST = System Timer

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

MT= Motion Timer

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

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

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

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.

V = ADC Battery Voltage

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

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.

G = GPSStatus

This variable is indicator of whether GPS Sync is acheived or not.

SW = SOS switch input

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

C = ChargingStatus

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 .

Last updated