RG Command - Geographic Regions (Polygonal Geofences)
Allows defining geographic zones through polygons of 3 to 32 vertices to implement entry/exit conditions in the event engine.
What is it used for?
- 🗺️ Advanced geofencing — Create irregular-shaped zones (not just circles)
- 🏭 Facility control — Precisely delimit warehouses, plants, customers
- 🚫 Restricted zones — Alert if vehicle enters unauthorized areas
- 📊 Route analysis — Determine time inside/outside specific zones
- 🔒 Vehicle security — Detect if vehicle exits authorized zone
Features
| Property | Value |
|---|---|
| Available regions | 32 (RG00 - RG31) |
| Vertices per region | 3 - 32 points |
| Precision | 1/1000000 of degree |
| Automatic status | Inside/Outside |
| Event usage | Signals with +/- edges |
Commands
Configure region
SRGaab,+LLLLLLLL+XXXXXXXXX,+LLLLLLLL+XXXXXXXXX,...Parameters:
- aa: Region number (00-31)
- b: Block number (for regions >8 points)
- LLLLLLLL: Latitude in 1/1000000 degrees (90000000)
- XXXXXXXXX: Longitude in 1/1000000 degrees (180000000)
Query region
QRGaabResponse:
RRGaab,+LLLLLLLL+XXXXXXXXX,...,EFinal state (E):
- A: Currently inside
- V: Currently outside (void)
Delete all regions
SRG*55AAThis command deletes ALL configured geofences. It is not reversible.
Examples
Simple region (triangle)
>SRG000,-3459418-05842814,-3459500-05842736,-3459423-05842623<
// SRG = Set Region
// 00 = Region number 0
// 0 = Block 0 (first block)
// Each pair: latitude-longitude in 1/1000000 degreesDefines region 00 with 3 vertices forming a triangle.
Complex region (8 points)
>SRG010,-3459160-05840104,-3458912-05839997,-3458750-05839726,-3459177-05839190,-3459248-05839276,-3459386-05839297,-3459343-05839572,-3459290-05839761<Multi-block region (>8 points)
If a region has 11 points:
Block 0 (first 8):
>SRG010,-3459160-05840104,-3458912-05839997,...,(8 points)<Block 1 (remaining 3):
>SRG011,-3459251-05839881,-3459206-05840010,-3459180-05839950<Query status
>QRG000< // Query region 00, block 0
>RRG000,-3459418-05842814,-3459500-05842736,-3459423-05842623,A<
// Response with coordinates and final state
// A = Inside (vehicle inside the region)
// V = Void (vehicle outside the region)RG Signal
| Property | Value |
|---|---|
| Signal | RG |
| Index | 00-31 |
| Conditional use | YES |
| Status | 1 = inside, 0 = outside |
| Edges | + (entry), - (exit) |
Configuration Tool
Rinho provides a web application to design geofences graphically:
The tool automatically generates SRG commands with the correct coordinates.
Coordinate Format
Decimal degrees conversion
GPS coordinates: -34.59418, -58.42814
Multiply by 1,000,000:
- Latitude: -34594180
- Longitude: -58428140
Format for the command:
-3459418-05842814
// No decimal point
// 8 digits latitude + 9 digits longitudeUse 8 digits for latitude (90 degrees) and 9 digits for longitude (180 degrees).
Limitations
- Maximum 32 regions simultaneously
- Maximum 32 vertices per region
- Simple polygons: No self-intersection
- GPS precision: Typical deviation 5-10 meters
- Processing cost: Complex polygons consume more CPU
Compatibility
💾Firmware v1.08.00
SPLegacy
ULLegacy
32 regions
💾Firmware v1.00.00
SP-IOT
SM-IOT
32 regions
See Also
- Region Configurator Tool
- Event Engine - Usage in rules
- Trigger List - RG signals
- LAT/LON Commands
Last updated