An open API service indexing awesome lists of open source software.

https://github.com/dride/dride-core-integration


https://github.com/dride/dride-core-integration

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# This document is describing the integration process of dride-core.

`dride-core` is a single executable that create the framework to connect to Dride Fleet and App.

# how to get dride-core?

Please email us the following config information and we will send you a custom build of dride-core

> We've included a demo version of dride-core into this example, it should be used only for testing purposes.

```
VideoDirMain = "/FULL_PATH_HERE/recordings"
VideoDirSub = "/FULL_PATH_HERE/recordings"
VideoDirEMR = "/FULL_PATH_HERErecordingsEMR"
VideoDirSnapshots = "/FULL_PATH_HERE/snapshots"
ConfigPath string = "/FULL_PATH_HERE/config/settings.json"
```

## Prerequisites

- Unit local ip should be 192.168.10.1
- Make sure this packages are installed on your kernel
- /usr/bin/ffmpeg (FFMPEG)
- /usr/bin/ffprobe (FFPROBE)
- /usr/sbin/rtcp (RTCP)
- /usr/sbin/mkfs.ext4 (FORMAT_DISK)
- /usr/sbin/mkfs.exfat (FORMAT_DISK_FAT)
- /sbin/hwclock (HWCLOCK)
- /usr/sbin/rtsp-stream (GO2RTC)
- /usr/bin/ifconfig (IFCONFIG)
- /usr/bin/iwconfig (IWCONFIG)
- /usr/bin/iw (IW)
- /usr/bin/qmicli (QMICLI)
- /usr/bin/lsusb (LSUSB)
- date (DATE)
- Video record should be placed in the following directory structure

```
.
├── dride-core (place in /usr/sbin/dride-core)
├── config (place in /usr/sbin/)
│ └── settings.json
├── recordings
│ ├── 1649970986
│ │ ├── event.json*
│ │ ├── route.geojson
│ │ ├── thumbs*
│ │ │ └── 0.webp
│ │ └── videos
│ │ ├── 0.mp4
│ │ └── 1.mp4
│ ├── 1650459754
│ │ ├── event.json*
│ │ ├── route.geojson
│ │ ├── thumbs*
│ │ │ └── 0.webp
│ │ └── videos
│ │ ├── 0.mp4
│ │ └── 1.mp4
└──── recordingsSub
└── 1650900000
├── event.json*
├── route.csv
├── route.geojson
├── thumbs*
│ └── 0.webp
└── videos
├── 0.mp4
└── 1.mp4

```

- Items marked with '\*' are automatically generated by dride-core

# rc.dride

This file should run upon boot.

```console
# init db with default settings from settings.json
dride-core db init

# will cleanup issue list, they will be populated on each boot
dride-core issues init &

# update setting file on boot
dride-core onBootRefreshSettings

# make sure we enough free space
dride-core cleaner once

# Start Dride Core cleaner (will remove old videos to make room for new ones)
# if you dont have cron in your system you can run dride-core as cron service `/usr/sbin/dride-core cleaner` but for performance reasons it's prefered to use cron.
(crontab -l 2>/dev/null; echo "* * * * * /usr/sbin/dride-core cleaner once") | crontab -

# Start Dride Core event button listener
dride-core buttonListener &

# Start Dride Core ws
/usr/sbin/dride-core ws & /usr/sbin/dride-core monitor $! &

# Ensure emergency video queue is being emptied and transferred to the designated location of emr videos
# if you dont have cron in your system you can run dride-core as cron service `/usr/sbin/dride-core emrVideoTask` but for performance reasons it's prefered
mkdir -p /squashfs/mnt/extsd/recordingsEMR
mkdir -p /squashfs/mnt/extsd/snapshots
(crontab -l 2>/dev/null; echo "*/2 * * * * /usr/sbin/dride-core emrVideoTask once") | crontab -

# Ensure all videos have a thumbnail, this will run every 60 seconds
# if you dont have cron in your system you can run dride-core as cron service `/usr/sbin/dride-core ensureThumbs` but for performance reasons it's prefered to use cron.
(crontab -l 2>/dev/null; echo "* * * * * /usr/sbin/dride-core ensureThumbs once") | crontab -

```