set geofence
Purpose
Configures a Digi device for use with a Global Positioning System (GPS) and geofencing application. When a GPS device is present and configured for use in the Digi device’s system, up to 16 geofences can be defined. A supported GPS receiver must be configured for use by the device. A geofence is defined by entry and exit radii around a latitude-longitude coordinate pair. GPS geofence options define perimeters around a point such that moving into, out of, or being outside of the perimeter trigger an alarm. Static position options define the latitude and longitude coordinates for the Digi device. Alarms can be configured based on the GPS device’s relative position compared to the geofence: for exiting a fenced area, entering a fenced area, or being located outside of the fenced area. Alarm options set whether alarms will be reported to the Digi device’s event log, an SNMP server, or via SMTP-based e-mail.
Required permissions
For Digi products with two or more users, to use this command, permissions must be set to set permissions s‑gps-geofence=read to display settings, and set permissions s‑gps-geofence=rw to display and configure settings. See set permissions for details on setting user permissions for commands.
Syntax
Configure geofence settings
set geofence [index={1..16}]
[state={enabled|disabled}]
[name=name]
[hdop_max=2.000000-30.000000]
[latitude=-90.000000-90.000000]
[longitude=-180.000000-180.000000]
[entry_radius=10-10000000]
[exit_radius=10-10000000]
[outside_update_interval=30..86400, 0 = disabled]
[email_recipient=email recipient]
[email_ccrecipient=email ccrecipient]
[email_subject=email subject]
[email_body=email body]
[email_from=email from]
[priority={normal|high}]
[primary_smtp_server=primary SMTP server]
[secondary_smtp_server=secondary SMTP server]
[log_entry_event={enabled|disabled}]
[log_exit_event={enabled|disabled}]
[email_entry_event={enabled|disabled}]
[email_exit_event={enabled|disabled}]
[trap_entry_event={enabled|disabled}]
[trap_exit_event={enabled|disabled}]
[log_update_outside={enabled|disabled}]
[email_update_outside={enabled|disabled}]
[trap_update_outside={enabled|disabled}]
[gps_data_in_email_body={enabled|disabled}]
Display current geofence configuration settings
set geofence
Options
index={1..16}
Numeric identifier for the geofence. You can define up to 16 geofences.
state={enabled|disabled}
Indicates whether this geofence configuration should be activated. Setting this option to “enabled” tests the GPS unit’s position against the geofence specified on the index option.
name=name
A name for the geofence; this name appears in geofence alerts, whether they are sent by e‑mail, logged in the event log, or issued as SNMP traps.
hdop_max=2.000000-30.000000
The maximum tolerated horizontal dilution of precision (HDOP), in degrees, that is allowed for reporting a geofence event. When the reported HDOP is greater than this value, fence event log reports, SNMP traps, and e-mail reports will not be sent. HDOP tolerances vary by GPS receiver. A lower number indicates more positional precision.
latitude=-90.000000-90.000000
Defines the latitude component of the geofence center, in degrees.
longitude=-180.000000-180.000000
Defines the longitude component of the geofence center, in degrees.
entry_radius=10-10000000
The entry radius, in meters, is the distance from the center of the fence for entry. That is, if the device is less than this distance from the defined center, an entry event has occurred.
exit_radius=10-10000000
The exit radius, in meters, is the distance from the center of the fence for exit. That is, if the device is more than this distance from the defined center, an exit event has occurred. This is also the distance used to determine if the device is outside of the fence for update events.
outside_update_interval=30..86400, 0 = disabled
The location update interval, in seconds, specifies the amount of time to wait between reporting that the device is outside of the geofence. This interval applies to event log, SNMP, and e-mail reports.
email_recipient=email recipient
The email address of the recipient of the geofence report e-mail.
email_ccrecipient=email ccrecipient
The email address of the carbon copy (CC:) recipient of the geofence report e-mail.
email_subject=email subject
The subject line that will appear on the geofence report e-mail.
email_body=email body
Body text for the e-mail. For example, Device X has left the fenced area.
email_from=email from
The email (return) address of the originator of the geofence report e-mail.
priority={normal|high}
The priority of the e-mail. Normal and high priority can be specified. High priority e‑mails will display differently on some systems.
primary_smtp_server=primary SMTP server
The IPv4 address of the primary SMTP (e-mail) server.
secondary_smtp_server=secondary SMTP server
The IPv4 address of the secondary SMTP server. This server will be used if an e-mail cannot be sent to the primary SMTP server.
log_entry_event={enabled|disabled}
Specifies whether a log entry will be written when device has entered the geofence defined by the geofence center, and entry radius.
log_exit_event={enabled|disabled}
Specifies whether a log entry will be written when the device has left the geofence defined by the geofence center, and exit radius.
email_entry_event={enabled|disabled}
Specifies whether an e-mail will be sent to the defined recipients via the configured SMTP servers when the device has entered the geofence defined by the geofence center and entry radius.
email_exit_event={enabled|disabled}
Specifies whether an e-mail will be sent to the defined recipients via the configured SMTP servers when the device has left the geofence defined by the geofence center and exit radius.
trap_entry_event={enabled|disabled}
Specifies whether an SNMP trap will be sent to the defined SNMP servers when device has entered the geofence defined by the geofence center, and entry radius.
trap_exit_event={enabled|disabled}
Specifies whether an SNMP trap will be sent to the defined SNMP servers when the device has left the geofence defined by the geofence center, and exit radius.
log_update_outside={enabled|disabled}
A log entry will be written when the device is outside of the geofence defined by the geofence center, and exit radius. Log entries will be written at the interval defined by the outside_update_interval option.
email_update_outside={enabled|disabled}
An e-mail will be sent to the defined recipients via the configured SMTP servers when the device is outside of the geofence defined by the geofence center, and exit radius. E-mails will be sent at the interval defined by the outside_update_interval option.
trap_update_outside={enabled|disabled}
Specifies whether an SNMP trap will be sent to the defined SNMP servers when the device is outside of the geofence defined by the geofence center, and exit radius. SNMP traps will be sent at the interval defined by the outside_update_interval option.
gps_data_in_email_body={enabled|disabled}
Specifies whether the current location of the Digi device should be included in the geofence e-mail.Send out the current position in the e-mail, in addition to, or instead of email_body.
Examples
This example writes an entry into the device’s event log when the device leaves the fenced area, 75M from the center of 44.1, -93.5.
#> set geofence index=1 state=enabled name=test_fence hdop_max=30.0 latitude=44.1 longitude=-93.5 entry_radius=50 exit_radius=75 log_exit_event=enabled
See also
- display gps to display the current position of the GPS device and information about the reading.
- revert: The revert geofence command reverts the settings configured by this command.
- set profile
- show: The show geofence command shows the current geofence settings in a Digi device.