Install RBT: Parking
OPTIONAL
Parking occupancy service
Finds the free parking spaces of every camera whose parking configuration (the "Parking" tab of the camera form) is ready and enabled, from the vehicle footprints (the projections of the detected vehicles onto the ground) found by FALPRS. Results are shown on the "Result" view of the same tab.
Requires FALPRS 1.2.0 or later: the service uses its detectVehicleFootprints method.
The service needs no npm dependencies (Node.js 20.10 or later).
-
Make the config file and edit it
shell cd /opt/rbt/server/services/parking cp config.sample.json config.jsonapi.internal- internal API of the server, asapi.internalof the server configfalprs.url- LPRS API of FALPRS,falprs.authToken- its token if FALPRS requires one,falprs.timeout- secondslisten- address the service serves the processed frames to FALPRS and processing requests to the server on, 127.0.0.1 by default: set an external address only when FALPRS runs on another host; the server reaches it atserviceof theparkingsection of the server config (see below), keep them in syncframeBaseUrl- how FALPRS reaches that addresscamerasRefresh- how often the list of cameras to process is refreshed, seconds (300)cameraTimeout- timeout of requests to the internal API, seconds
The processing interval of cameras (
interval,minInterval) and the storage of the processed frames (storage: tmpfs or gridfs; tmpfs by default when thetmpfsbackend is configured, gridfs otherwise) are set in theparkingsection of the server config.Camera frames may be JPEG, PNG, BMP or WebP. The service sends every processed frame to
api.internalas base64 in the request body, so the request is a third larger than the frame: a 1920x1080 PNG takes several megabytes, a 4K one up to 20. Make sure the server accepts such requests, otherwise processing fails withparking/result answered 413(nginx) or400(PHP drops the body):- nginx:
client_max_body_sizeof the server or oflocation = /internal.phpat least20M(the sampleinstall/nginx/rbtsets100M) - PHP-FPM:
post_max_sizeat least20Min/etc/php/8.3/fpm/php.ini, thensystemctl restart php8.3-fpm
To let users process a camera right now with the "Process now" button of the "Result" view, set
serviceof theparkingsection of the server config to the URL the server reaches the service at (itslistenaddress, e.g.http://127.0.0.1:5081). The service answersPOST /process/:cameraIdon that address, so whenlistenis an external address, restrict access to it to the server and FALPRS. -
Add user and group (if not yet):
shell groupadd rbt useradd -g rbt -s /bin/true -d /dev/null rbt -
Make logging dir:
shell mkdir -p /var/log/rbt_parking_service/ chown -R rbt:rbt /var/log/rbt_parking_service/ -
Make logrotate:
shell echo '/var/log/rbt_parking_service/*.log { daily missingok rotate 7 compress notifempty copytruncate dateext dateformat -%Y-%m-%d }' | tee /etc/logrotate.d/rbt_parking -
Install and start the systemd unit:
shell ln -sf /opt/rbt/server/services/parking/parking.service /etc/systemd/system/rbt_parking.service systemctl daemon-reload systemctl enable --now rbt_parking