The AutoPi dongle is initially configured to be powered on when the engine of the vehicle is running. When the engine is not running, a sleep timer is created to put the dongle to sleep after 30 minutes or whatever configured.
Behind the scene this works by using engine events (http://docs.autopi.io/events/vehicle/#engine-events). Engine events are triggered based on the RPM values continuously read from the vehicle. For all non BEVs (Battery Electric Vehicle) this is setup automatically as default because they all support readout of engine RPM in exactly the same way according to the OBD-II PID standard (SAE J1979).
Unfortunately this is not as simple for BEVs. Here there is no standard and data is read out in different ways between makes and models. Two approaches are available; 1) if your vehicle is able to respond to PID requests and/or 2) if your car continuously delivers data on a CAN bus.
1A) Setup a PID logger using the
This option can be used if your vehicle is able to respond to PID queries.
Precondition: A PID which on request delivers a RPM value related to the movement of the vehicle. It could be the RPM of an electric motor, a spinning wheel etc. If you do not know of such a PID for your model, you can always check the Community Library on https://my.autopi.io.
Important: The PID must be named ‘RPM’ or else the rpm_motor_event trigger will skip checking the value.
Go to Car Explorer > Loggers > Create > PID. Choose your RPM PID and be sure to select the rpm_motor_event trigger.
After the logger has been synced to your device, and the service has been restarted, you should start seeing motor events below Advanced > Events.
For documentation of motor events see: http://docs.autopi.io/events/vehicle/#motor-events
1B) Setup a PID logger using the
This option can be used if you do not have a PID capable of delivering RPM data, but instead have another arbitrary PID that delivers data when the vehicle is moving or active. The actual content of the PID response is irrelevant for this trigger to function.
Precondition: A PID which on request delivers data when the vehicle is active and no response when the vehicle is inactive. If you do not know any PID to use, you can always check the Community Library on https://my.autopi.io.
Note: There is no restriction on specific naming of the PID.
Go to Car Explorer > Loggers > Create > PID. Choose your arbitrary PID and be sure to select the communication_event trigger.
For documentation of communication events see: http://docs.autopi.io/events/vehicle/#communication-events
Next step is to re-configure the sleep timer functionality to use communication events instead of the default engine/motor events. Go to Settings > Advanced > Power and change the three values:
Sleep Timer > Event Driven > Event Regex:
Sleep Timer > Event Driven > Reason:
Sleep Timer > Suppress > Event Regex:
As shown below:
After all the changes have been synced to your device, and the service has been restarted, you should start seeing communication events and also system/sleep_timer events below Advanced > Events.
1C) Setup a PID logger using a custom trigger
Caution: This option is recommended for expert users only.
Instead of using one of the built-in triggers you can provide your own implementation which also can fire your own custom events. The setup procedure is the same as in the example above except that the trigger used is custom. See how to create a custom triggere here: https://community.autopi.io/t/custom-code-write-custom-trigger-to-play-beep-sound-when-speeding
2A) Setup a CAN logger using the
This option can be used if your vehicle continuously produces data on a CAN bus while active/driving.
Note: At the time of writing this approach can only make use of the
rpm_engine_event trigger and thus produce engine events: http://docs.autopi.io/events/vehicle/#engine-events
Precondition: A CAN message mapping for your specific vehicle which contains a RPM signal. If you do not know any CAN messages for your vehicle, you can always check the Community Library on https://my.autopi.io.
The following example shows how a RPM signal can be found in the Community Library for a Renault Zoe. Go to Car Explorer > Library > Community Library and specify Make and Model:
Click on the RPM signal and in the popup window click on the button Add to my library. You have now added the CAN message to your library and you can use it for logging.
Next step is to setup a CAN logger for the RPM signal. Go to Car Explorer > Loggers > Create > CAN and choose the RPM signal:
Important: The CAN signal must be named ‘RPM’ or else the rpm_engine_event trigger will skip checking the value.
After the logger has been synced to your device, and the service has been restarted, you should start seeing engine events below Advanced > Events.
Check the log file on the device to see if there are warnings and/or errors: https://community.autopi.io/t/guide-how-to-retrieve-logs-from-your-device/