Power management

This page has been updated on the 28 April 2010

This document will help you, at first, to configure the wake up and shutdown conditions of a device.
We will then explain how to see on the server which event triggered the boot or the shutdown of your devices.

The wake up and the shutdown condition.

Wake up trigger

The wake up conditions are set in the component boot and the parameter you need to set is coproc_wakeup_events. In this field, each bit represent an event.

Here is the list of the available events.

bit Comments Value
0 input 1 1
1 input 2 2
2 input 3 4
3 input 4 8
4 input 5 16
5 input 6 32
6 input 7 64
7 input 8 128
8 input 9 256
9 ignition 512
10 alarm 1024
11 accelerometers 2048
12 external power 4096
13 touchpad 8192
14 keypad 16384
15 button 32768
16 modem ring 65536
17 rtc 131072
22 Serial port 4194304
23 Usb 8388608

Example:

If you want to wake up on ignition, accelerometers and modem rig. You need to activate the bits 9, 11 and 16.
So the value of the field will be:
2^9+2^11+2^16 = 512 + 2048 + 65536 = 68096

So you should have boot.coproc_wakeup_events=68096.

You can use this little excel file to calculate the correct value: wakeup_condition_2.3.xls.

Shutdown trigger

You can trigger the shutdown of the device in different ways, for example you can use the accelerometer, the GPS or the ignition. You can also define the shutdown type; idle or complete switch off.

Using the ignition.

To trigger the shutdown when the ignition is off, you need to configure the power manager.

You need to set different parameters of the power manager:

  • iginitionManager: this parameter sets which type of shutdown you want to use.
    Here are the different types:
    • 0: none
    • 1: reset
    • 2: shutdown
    • 3: idle
  • ignitionTimeout: this parameter sets the time between the ignition turns off and the moment this devices shuts down. This time is in second and the minimum is 10 seconds.

Using the GPS

With the GPS, the shutdown is triggered when no more movements are detected.

The different parameters to configure are:

  • gpsMovementManagement: this parameter sets which type of shutdown you want to use.
    Here are the different types:
    • 0: none
    • 1: reset
    • 2: shutdown
    • 3: idle
  • gpsMovementTimeout: this parameter sets the time between the ignition turns off and the moment this devices shuts down. This time is in second and the minimum is 10 seconds.

Using the accelerometers

With the accelerometers, the shutdown is triggered when no more movements are detected.

The different parameters to configure are:

  • accelerometersMovementManagement: this parameter sets which type of shutdown you want to use.
    Here are the different types:
    • 0: none
    • 1: reset
    • 2: shutdown
    • 3: idle
  • accelerometersMovementTimeout: this parameter sets the time between the ignition turns off and the moment this devices shuts down. This time is in second and the minimum is 10 seconds.

Other parameters to set

  • minimumWakeTime: This represents the minimum time between two shutdowns. The minimum is 180seconds, but by defaults this value is set to 300 seconds
  • maximumSleepTime: This represents the maximum time that the device can stay in sleep.

Check the boot and the shutdown reasons

The boot and shutdown reasons are saved in field 127 of the dataRecorder.

Boot reason

For the boot reason, the content of the field 127 has a special syntax, which is: B: value

Each bit defines a possible boot reason, here the list of all the boot reasons:

Boot Reason Bit Value
Power ON 0 1
Ignition 1 2
External power supply plugged 2 4
Accelerometer movement detection 3 8
Modem Ring (SMS or Call) 4 16
Digital Inputs (1 or 2) 5 32
Alarm input 6 64
RTC 7 128
Watchdog 8 256
Watchdog 9 512
Touchpad 10 1024
Button 11 2048

You can use the file Boot_Event_2.3.xls to calculate the value you are expecting.

Shutdown reason

The shutdown reason are also saved into the field 127. This time the syntax changes a little.
It is: S: type-codes
So the type and the code are two figures, which represent:

  • type: it is the mode of the last shutdown, it can be either a reset, either a sleep.
  • code: it is the component and the reason why the shutdown was triggered.

The types

Type Reason
0 Emergency reset
1 Normal reset
2 Normal shutdown
3 Idle
4 Suspend

The codes

The code depends on the component activating the shutdown.

Watchdog [ 0- 9 ]
Code Reason
0 manual trigger
1 Component timeout trigger
Modem [ 10-19 ]
Code Reason
10 Modem blocked
11 Bad PPP PID
PwrManager critical reasons [ 20-39 ]
Code Reason
30 Critical low internal battery
CommandManager [ 40-49 ]
Code Reason
40 command ‘apnset’
41 command ‘restore’
43 command ‘reset’
User tools [ 80-99 ]
Code Reason
80 console manual reset
81 config.txt detected at boot
82 config.txt contains reset command
90 GPRS update reset
NetMonitoring [ 150-154 ]
Code Reason
150 No network activity for a long period
MUI [ 155-159 ]
Code Reason
155 Auto idle
PwrManager special reasons [180-199]
Code Reason
180 Maximum uptime reached
181 Low internal battery
182 Manual trigger
183 Daily reset
PwrManager normal reasons [ 200-263 ]

This value is calculated like that: 200 + a mask of the reasons that provoked the action

Each bit defines a possible shutdown reason.

Shutdown Reason Bit Value
Accelerometers movement absence 0 1
GPS movement absence 1 2
Ignition (can be absence or pulse) 2 4
Digital Input 1 absence 3 8
Digital Input 2 absence 4 16
External battery absence 5 32

You can use Use the file Shutdown_Event_2.3.xls to calculate the correct value.