DRV Command
The DRV module keeps a single driver per device. That driver goes in the iButton field of Wialon reports (which Wialon and Traccar use to assign the driver), in the 'DRV' token of report templates, in the trip of the TRIP module and in the DRV signals of the event engine.
Previously, the last key read, the IC session and the trip code were three separate things. With DRV you configure once where the driver comes from, and the rest of the device uses it.
What is it for?
- 🪪 Assign the driver on the platform without rules: Wialon and Traccar take it from the iButton field.
- 📋 Accept only authorized drivers using the ICL code list.
- ⏱️ Close the session automatically some time after the engine is turned off.
- 🚚 Link each trip to its driver in the TRIP module.
- 🚨 Require a driver on ignition: warning with a buzzer or light, and cut if nobody identifies, without writing rules.
- ⚙️ Trigger rules on login, logout or an unauthorized code.
Configuration: SCXDRV
>SCXDRV<origen>,<lista>,<retención>,<ventana>,<aviso>,<corte>,<vel corte>,<rpt login>,<rpt logout>,<rpt inválido>,<rpt sin chofer>,<dst>,<xp ok><
>QCXDRV< -> >RCXDRV<the 13 fields><| Field | Values | Default | What it does |
|---|---|---|---|
origen | 0 off · 1 iButton · 2 IC session · 3 manual only · 4 tachograph | 1 | Where the driver comes from |
lista | 0 · 1 | 0 | 1 = only codes in the ICL list |
retención | 0-65535 s | 0 | Logout after this time with the ignition off; 0 = never |
ventana | 0-3600 s | 0 | Time to identify after ignition on; 0 = no driver required |
aviso | 0-2 · - | - | Output activated while the window runs |
corte | 0-2 · G · H0-H2 · - | - | What is activated if the window expires: an output, the gradual cut or nothing. With H, the output enables the vehicle only with a driver (see below) |
vel corte | 0-255 km/h | 3 | The output cut is only applied below this speed |
rpt login | report · - | - | Report to send on each login (see Automatic reports) |
rpt logout | report · - | - | Report to send on each logout |
rpt inválido | report · - | - | Report to send on an unauthorized code |
rpt sin chofer | report · - | - | Report to send when the window expires with no driver |
dst | GP WI BT TR BGP BWI LOG BACK ALL | GP | Destination of those reports (the same names as SCXDTC) |
xp ok | 0-2 · - | - | Output activated for 2 s on each login: a beep or an LED to confirm to the driver |
- Fields are positional and an empty field keeps its value:
>SCXDRV,,120<only changes the retention. - Everything is validated before saving. With an invalid value nothing is saved and the response names the field:
RCXDRV,ERR,ORIGEN,LISTA,RETENCION,VENTANA,AVISO,CORTE,VELCORTE,RPTLOGIN,RPTLOGOUT,RPTINVALIDO,RPTSINCHOFER,DST,XPOK. - Changing the origin logs out the current driver.
Origins
| Origin | The driver is… | How they identify |
|---|---|---|
0 off | always none | — (the Wialon field is NA) |
1 iButton | the last key read | iButton key (Spider/Smart) or SDRV |
2 IC session | the driver session (IC) | iButton key, RF433 remote, SIC/SDRV, or a serial reader with CXXB + SDA |
3 manual only | whatever was loaded with SDRV | Only SDRV (keys are ignored) |
4 tachograph | the driver 1 card in the tachograph | The card in the tachograph (CAN J1939) or SDRV |
Origin 4: tachograph
Only on devices with CAN (on the others SCXDRV4 answers RCXDRV,ERR,ORIGEN). The device reads from the J1939 bus:
- DI (PGN 65131): the card numbers of driver 1 and driver 2. The device driver is driver 1; driver 2 goes in the
'DRV2'token. - TCO1 (PGN 65132): whether each card is inserted and the working state of each driver (
'TCO'token).
| Tachograph event | Device driver |
|---|---|
| Driver 1 card is inserted | Login with the card number (source T) |
| Driver 1 card is removed | Logout |
| Driver 1 card changes | The new one replaces the previous one |
- The code is the card number in uppercase, without spaces, up to 16 characters (16 in the EU).
- A
CDRVwith the card inserted removes the driver until the next change in the tachograph (another card, or removing it and inserting it again). - A driver loaded with
SDRVis not removed by the tachograph. lista=1also applies: a card outside the code list does not log in and firesDRV03.
Not all trucks put DI on the bus: in many of them the tachograph only sends it through the FMS interface. Before configuring origin 4, check with a bus scan that PGN 65131 arrives.
The last login wins: if there is a driver and another one identifies, the new one replaces the previous one.
With origin 2 and lista=0, any valid code opens the IC session even if it is not in the code list. With lista=1 it behaves as always: only codes in the list open it.
Code list (lista=1)
- A code that is not in the list does not change the driver and fires the
DRV03signal. - A code loaded with
$in the list is recognized, but it is not a driver: it does not change the driver and does not fireDRV03either (it still fires itsICLnn).
Driver codes are 1 to 16 alphanumeric characters: letters and digits, without spaces, hyphens or underscores. To add to the list use SICL+ CODIGO, with a space after the +.
Requiring a driver: window, warning and cut
- Ignition ON with no driver and
ventanagreater than 0: the window starts and theavisooutput is activated. State3. - The driver identifies within the window: the warning turns off.
- The window expires (
DRV04signal) or an unauthorized code is presented (DRV03): the warning turns off and the cut is applied.- Output: activated only with GPS fix and below
vel corte. If the vehicle is going faster, it stays pending until it slows down (state4). G: the gradual cut is activated, with the ramp configured withSGC. It does not wait for the speed to drop: the ramp is already gradual (state5).
- Output: activated only with GPS fix and below
- Ignition OFF: the warning and the window turn off. The cut is not released when the ignition is turned off.
A valid login releases the cut, and only the cut set by DRV. Since v1.09.28 the cut is also released immediately if the configuration no longer backs it: ventana set to 0, corte changed (to -, to another output or to another mode) or the module turned off (origen = 0, >SCXDRV0<). Turning the module off while the window is running also turns the warning off. Rewriting the same configuration (for example, when saving from the configurator) or a reboot does not release it. If the cut was activated by something else (a jamming rule, SGCA from the platform), the login does not touch it. From the platform it can still be released with SGCS or by turning the output off.
To use G, the gradual cut must be enabled with SGCE. If it is not, nothing is cut when the window expires.
The warning pattern (steady, blinking) is whatever that output has configured with SCXXP. The window and cut state is saved: if the device restarts in the middle of a cut, it stays cut until a login (or until the configuration is changed, see above).
// Key from the list; 2 min to identify; buzzer on XP2; cut on XP1 with the vehicle stopped
>SCXDRV1,1,0,120,2,1,3<
// IC session from the list; logout 60 s after ignition off; gradual cut
>SCXDRV2,1,60,120,2,G<Enable the vehicle only with a driver (H)
With corte = H plus the output number, that output enables the vehicle: it is active only while there is an identified driver. It is wired to a relay that enables the starter, the pump or the ignition: with no driver the vehicle does not start, also with the ignition off.
| Situation | Enable output |
|---|---|
| A driver identifies | Activated immediately |
| Logout with the ignition off | Turned off immediately |
Logout with the ignition on and the vehicle stopped (GPS with fix, below vel corte) | Turned off |
| Logout while moving or without GPS fix | Stays active (state 4, pending) until the vehicle stops or the ignition is turned off |
| Device restart | Restored according to the saved driver |
- It never disables a moving vehicle. A
CDRVfrom the platform while the vehicle is moving is only applied when it stops or the ignition is turned off. - The platform can force the output (for example, enable a vehicle with no driver with
SSSXP): DRV does not touch it again until the next login or logout. - The window and the warning can still be used (for example, to sound the buzzer while nobody identifies); when the window expires nothing else is cut: the vehicle is already disabled.
- The warning and
xp okcannot be on the enable output: the response isRCXDRV,ERR,AVISOorRCXDRV,ERR,XPOK. Since T60 the warning cannot be on the output used for the output cut either.
For the vehicle to stay disabled also if the device loses power, use a relay that enables when the output is active (normally open in the starter or pump circuit).
// Key from the list; the vehicle only starts with a driver (XP0 enables)
>SCXDRV1,1,0,0,-,H0,3<
// IC session from the list; logout 5 min after ignition off; buzzer on XP2 while nobody identifies
>SCXDRV2,1,300,30,2,H0,3<Automatic reports
On each event the configured report is sent to dst, the same as if a rule did G<report>;@<dst>, but without writing rules. The report is written like the G action without the G: type, number in hexadecimal and priority (U101H is the user report with template SUC01, number 01, high priority).
| Field | Event | Signal |
|---|---|---|
rpt login | Login (also the driver who comes in when replacing another one) | DRV01 |
rpt logout | Logout: CDRV, retention expired, driver change | DRV02 |
rpt inválido | Unauthorized code | DRV03 |
rpt sin chofer | The window expired with no driver | DRV04 |
- The report date and time are those of the event, even if it goes out up to one second later.
- In the report template,
'DRV'is the driver of the event: the one who came in on login, the one who left on logout, and the rejected code on an unauthorized code. On the expired window report it is empty (orNAwith'DRV::NA'). - On a driver change both are sent: first the logout of the previous driver and then the login of the new one.
// Template 1: the driver of the event
>SUC01 $CHOFER='DRV::NA'<
// The 4 events with template 1, numbers 01 to 04, to the log
>SCXDRV,,,,,,,U101H,U102H,U103H,U104H,LOG<xp ok cannot be the corte output: the login releases the cut and the beep would activate it again. With gradual cut (G), if xp ok is the gradual cut output, the beep is not done.
Bluetooth driver: SCXDRVB
The driver identifies with an iBeacon or Eddystone-UID beacon that they carry or leave in the vehicle. It relies on a BSW slot: the filter (UUID, major/minor, distance) and the absence time are configured there.
>SCXDRVB<slot>,<modo>,<id>,<toggle><
>QCXDRVB< -> >RCXDRVB<slot|->,<modo>,<id>,<toggle><| Field | Values | Default | What it does |
|---|---|---|---|
slot | 0-3 · - | - | BSW slot that feeds the driver; - turns it off |
modo | P · B | P | P presence, B button |
id | M · I | M | Driver code: M the MAC (12 hex), I the iBeacon major+minor (8 hex) or the Eddystone-UID instance (12 hex) |
toggle | 0 · 1 | 0 | Mode B: pressing again logs out |
Presence (P) | Button (B) | |
|---|---|---|
| Login | BSW catches the beacon and sees it again 2 s later | Every time BSW catches the beacon again |
| Logout | BSW releases it (its timeout is the absence time) | Another login, the retention, CDRV or pressing again with toggle=1 |
| Does it replace another driver? | No: it only logs in if there is no driver, and only removes the driver it set | Yes |
- Button mode: iBeacon and Eddystone have no button field. It works with beacons that only advertise when pressed; BSW must have a short timeout (5-10 s) to release the beacon between presses.
- If the login fails (code outside the list) or another source removes the driver later (
CDRV, the retention), the beacon has to leave and come back for a new attempt. - Works with origin
1and2. With origin3(manual only) it is ignored. - Only on devices with Bluetooth Low Energy. On the others it answers
RCXDRVB,ERR,NOBLE. - Errors:
RCXDRVB,ERR,SLOT,MODO,ID,TOGGLE,CAMPOS.
BSW catches the first beacon it sees, not the closest one. Filter by UUID and distance, and if possible use lista=1. With id=M, a beacon that rotates its MAC changes code: prefer I.
// Slot 1: iBeacon with that UUID, closer than 2 m, absence 30 s
>SBSW01E,FF,E2C56DB5DFFB48D2B060D0F5A71096E0,,,30,2<
// Presence; the code is major+minor
>SCXDRVB1,P,I<Actions: QDRV / SDRV / CDRV
// Query the driver
>QDRV<
>RDRV <código|NA>,<fuente>,<desde>,<estado><
// Manual login (answers like QDRV)
>SDRV <código><
// Logout (answers like QDRV, with NA)
>CDRV<| Source | Meaning |
|---|---|
N | iButton key |
R | RF433 remote |
S | Manual (SDRV or SIC) |
B | Bluetooth |
T | Tachograph |
- | No driver |
| State | Meaning |
|---|---|
0 | No driver |
1 | Driver logged in |
2 | Driver logged in, ignition off, counting the retention |
3 | Waiting for identification (window running, warning active) |
4 | Output cut active, or pending until the speed drops. With H: no driver, vehicle disabled or about to be disabled |
5 | Gradual cut in progress or complete |
State diagram
What the diagram does not show:
- From 3 it goes to 4 if
corteis an output and to 5 if it isG; with no cut configured, it returns to 0 when the window expires. State 2 is only reached withretencióngreater than 0. - In 4 the output is only activated with GPS fix and below
vel corte; meanwhile the cut stays pending, in the same state. - The cut is not released when the ignition is turned off: only a valid login leaves 4 and 5. If something else releases the cut (
SGCS, the output by hand), DRV no longer considers it its own and returns to 0. - A login with another driver from 1 or 2 is a logout of the previous driver plus a login of the new one: the state stays at 1.
- With
ventanaat 0, states 3, 4 and 5 do not exist. Withretenciónat 0, the driver stays when the ignition is turned off (state 1).
SDRV errors:
| Response | Cause |
|---|---|
RDRV,ERR,CODIGO | The code does not have 1 to 16 alphanumeric characters |
RDRV,ERR,LISTA | lista=1 and the code is not in the list, or it is a $ code |
RDRV,ERR,ORIGEN | The origin is 0 (module off) |
With origin 2, SDRV <código> is equivalent to SIC <código>,S and CDRV is equivalent to SIC*.
The driver is saved in non-volatile memory only on login and logout: it survives a restart in the middle of a trip without wearing out the flash. If the device restarts with the ignition off, the retention starts counting again from boot.
Signals for rules
| Signal | Type | Meaning |
|---|---|---|
DRV00 | level | There is a driver |
DRV01 | pulse | Login |
DRV02 | pulse | Logout (also when a driver is replaced by another one) |
DRV03 | pulse | Unauthorized code (with lista=1) |
DRV04 | pulse | The window expired with no driver |
In EVAL: DRV(n), for example 'DRV(0)' is 1 with a driver.
The signals exist on all models, even if the device has no iButton reader.
// Report on each login
>SRL10E;TRG=DRV01+;ACC={GCP01H}<
// Activates output XP01 on an unauthorized key
>SRL11E;TRG=DRV03+;ACC={SSSXP0111}<'DRV' token
In report templates (UC), SDA and QDA:
| Token | With driver | With no driver |
|---|---|---|
'DRV' | the code | empty |
'DRV::NA' | the code | NA |
'DRV2' | origin 4: the driver 2 card | empty |
'TCO' | origin 4: working states <driver 1>,<driver 2> from the tachograph | empty (no TCO1 in the last 10 s) |
'TCO' states: 0 rest · 1 available · 2 work · 3 driving · 6 error · 7 not available.
>SUC05 $CHOFER='DRV::NA'<Wialon and Traccar
In Wialon IPS mode, the iButton field of the #D# packet carries the driver code, or NA with no driver.
- Wialon: create a driver assignment sensor on the iButton parameter in the unit, and load the same code, with the same case, in each driver. If the drivers are loaded with the number engraved on the key (CRC first), configure the device with
SCXOW,,1so the code comes out in that order. - Traccar: the field arrives as
driverUniqueId; each change generates thedriverChangedevent.
With the default configuration (SCXDRV1,0,0), the only thing that changes after updating is that the Wialon iButton field goes from NA to the last key read. Wialon only uses it if the unit has the driver assignment sensor configured.
TRIP module
STPSTARTwithout a code takes the current driver.- If the trip started with no driver, it takes the first login during the trip.
- A driver change in the middle of the trip does not change the trip driver. To split trips by driver:
>SRL12E;TRG=DRV01+;ACC={STPSTOP}{STPSTART}<- A code loaded by hand (
STPSTART,<código>,STPDRV,<código>) takes priority.
Examples
// iButton, any key, no retention (default)
>SCXDRV1,0,0<
// IC session, only the list, logout 60 s after ignition off
>SCXDRV2,1,60<
// Manual loading only (platform or SMS)
>SCXDRV3,0,0<
// Manual login
>SDRV JPEREZ01<
// Query: driver JPEREZ01, loaded by hand, driver logged in (state 1)
>QDRV<
>RDRV JPEREZ01,S,111026143022,1<
// Logout
>CDRV<
>RDRV NA,-,000000000000,0<Available from version 1.09.28 T53; the window, warning and cut from T54; automatic reports and driver confirmation from T56; the Bluetooth driver from T57; the tachograph from T58; the enable output (H) from T60.