Parking Space Occupancy Detection — Deployment Guide

Preset

IP Cameras + Edge Box

Keep the IP cameras already in your car park and add one edge box on the same network to analyse their pictures. You draw a box around each bay in a web page; the box sends every bay's occupied / free state to your MQTT server.

DevicePurpose
reComputer J30 / J40 (Jetson Orin Nano / Orin NX, JetPack 6.2) or reComputer RK3588 / RK3576Analyses every camera picture and decides whether each bay has a car
IP cameraYour existing cameras, sending an H.264 RTSP stream
MQTT serverReceives the bay states for guidance signs, a parking system or Home Assistant

What you'll get:

  • Draw and name every bay over the live camera picture in a web page
  • Whenever a bay changes, an MQTT message with the latest state of every bay on that camera
  • A visible signal when a camera stream drops (its bays turn unknown)

Requirements: Edge box, cameras and MQTT server on the same LAN · Internet access on the edge box during deployment · An MQTT server (for example Mosquitto)

1

Deploy Bay Detection

Install the bay detection service on the edge box. Enter the camera addresses and the MQTT server; there is no config file to edit.

Prerequisites
  1. With a reComputer J30 / J40: it must be a Jetson Orin Nano or Orin NX module on JetPack 6.2. Other Jetson modules or system versions are stopped at the first deploy step.
  2. With a reComputer RK3588 or RK3576: its system must include Rockchip's AI accelerator (RKNN), video decode (MPP) and RGA libraries.
  3. Every camera's RTSP address has been opened in VLC and shows a picture.
  4. You know the MQTT server's address and port, plus a username and password if it requires login.
  5. Ports 8080 (slot editor) and 8099 (status check) are free on the box. If one is taken, enter a different slot editor port or status port in the form.
Wiring
  1. Mount each camera high and angled down so every bay is clearly visible and not fully hidden by the car next to it.
  2. Connect the cameras and the edge box by Ethernet to the same switch or router (a PoE switch can power the cameras).
  3. In each camera's web settings, set the stream you will use (the sub-stream is enough) to H.264.
  4. Note each camera's RTSP address. For a Hikvision camera: rtsp://user:password@camera-ip:554/Streaming/Channels/102 (102 is the sub-stream).
  5. Fill in the camera addresses (comma-separated for several cameras), the site ID and the MQTT server, then click Deploy.

Each camera starts with one example bay, P-01 (a box in the lower middle of the picture). Delete it or drag it onto a real bay in Step 2.

Troubleshooting
IssueSolution
Deploy stops at "UNSUPPORTED_JETSON_MODULE"This Jetson is not an Orin Nano or Orin NX module. This solution supports reComputer J30 / J40 (Jetson Orin Nano / Orin NX) only
Deploy stops at "UNSUPPORTED_JETPACK" or "UNSUPPORTED_TENSORRT"The system is not JetPack 6.2; reflash JetPack 6.2 and deploy again
The RK3588 / RK3576 check reports "missing …"If a path is printed below it, enter that path in the matching field (for example "RKNN runtime library") and deploy again. If no path is printed, the board lacks that library: install the RKNN runtime (rknpu2), MPP, RGA, gstreamer1.0-plugins-bad and gstreamer1.0-rockchip first
"Not an RTSP address"Camera addresses must start with rtsp://, with commas between addresses
Camera addresses and camera IDs do not match in numberGive one ID per address, or leave the IDs empty to number them automatically
Downloading the detection model failsMake sure the edge box can reach the internet, then deploy again
Deploy stops at "Wait for the parking service to start"On the box, run docker logs edge-parking-occupancy-jetson (RK3588: edge-parking-occupancy-rk3588, RK3576: edge-parking-occupancy-rk3576). The usual cause is port 8080 or 8099 in use: choose another slot editor port or status port
Deployment method

Deploy to a reComputer J30 / J40 (Jetson Orin Nano / Orin NX, JetPack 6.2) over the network (SSH) from this computer.

What you will be asked for(filled in the SenseCraft Solution app)
  • Camera RTSP addresses*

    One address per camera, separated by commas. Open each one in VLC first — a wrong path or password is the most common failure.

  • Camera IDs

    Optional. One short name per address, same order, separated by commas (letters, digits, - and _). Used in the MQTT topic. Leave empty to number them cam-01, cam-02, …

  • Site ID*default my-lot

    First part of the MQTT topic, one per car park (letters, digits, - and _).

  • MQTT server address*

    IP address or hostname of the MQTT server that receives the bay states.

  • MQTT port*default 1883
  • MQTT username

    Leave empty if the server accepts anonymous clients.

  • MQTT password
  • Slot editor port*default 8080

    Port of the web page where you draw the bays. Change it if another service on this box already uses 8080. Use a different port from the status port.

  • Status port*default 8099

    Port for the service status check. Change it only if another program on this box already uses 8099.

After Deployment

The last deploy step waits until bay detection is ready, so a successful deploy means the service is running. Open http://<host-ip>:8080/slots/editor in a browser (or the slot editor port you entered) and you should see the camera picture. Next, draw the bays in Step 2.

2

Draw the Parking Bays

Draw a box around every bay on each camera's picture, give it a bay number, and see each bay's live state.

Wiring
  1. Open the slot editor (http://<edge-box-ip>:8080/slots/editor, or the port you entered when deploying) and pick a camera in the Camera list; the live picture appears.
  2. Deal with the example bay P-01 first: click the ✕ next to it in the list on the right to delete it, or drag its four corners onto a real bay and change P-01 to the real bay number in the list.
  3. Press and drag on an empty area of the picture (outside any bay) to draw a rectangle; releasing the mouse adds a bay.
  4. Drag the bay's four corners onto the four corners of the parking bay in the picture.
  5. In the list on the right, replace the generated number with the bay number (for example B1-023).
  6. Repeat steps 3–5 for every bay this camera can see. To delete a bay, click its ✕ in the list.
  7. Click Save. The message "Saved, applied, kept across restarts" means it is done; the bays apply immediately.
  8. Switch to the next camera in the Camera list and repeat.

Once drawn, each bay is coloured by its live state: red is occupied, green is free, grey is unknown (no camera picture, or just saved and not judged yet). The Occupied and Free tiles under "Live status" count this camera's bays.

When drawing:

  • One box per bay. Drag the four corners along the bay lines; the shape must be convex (no corner pointing inwards).
  • A parked car must cover roughly a third of its box in the picture to count as occupied. A box spanning several bays, or around distant small cars, never turns occupied.
  • If a bay is mostly hidden by cars in front, draw it on a camera with a better angle.
Troubleshooting
IssueSolution
Page does not openCheck the port matches the slot editor port from the deploy step and that this computer can reach the edge box
Picture is black or fails to loadThat camera has no picture yet: wait a few seconds, the picture refreshes every second; if it persists, check the camera's RTSP address
One camera's bays stay unknown (grey)The box cannot reach that camera: open its RTSP address in VLC on the same network and check the address, username, password and encoding (must be H.264)
"Bay … is not convex"One corner points inwards; drag that corner so all four point outwards
"Bay id cannot be empty"Type a bay number for that bay in the list
"Duplicate bay id"Bay numbers must be unique on one camera; choose another
Dragging moves an existing bay instead of drawing a new oneDragging inside a bay moves it; start the drag outside any bay
A car is parked but the bay stays freeThe box is too large or the car too far away to cover a third of it; tighten the box to a single bay
After Deployment

Bay detection is running and every bay you drew reports its state.

Initial Setup

  1. Make sure the example bay P-01 has been deleted or turned into a real bay on every camera.
  2. Subscribe your guidance signs, parking system or Home Assistant to <site-id>/parking/<camera-id>/slots. The camera ID is the one you entered when deploying; if you left it empty they are cam-01, cam-02, …

Quick Verification

  1. On a computer that can reach the MQTT server, run mosquitto_sub -h <mqtt-server-ip> -t '<site-id>/parking/+/slots' -v
  2. Every camera sends messages, with stream_ok set to true.
  3. Drive a car into a bay you drew: about 3 s later that bay turns occupied; about 5 s after it leaves it turns back to free.

Reading the Bay States

Each message covers one camera and carries the current state of every bay on it:

FieldMeaning
camera_idCamera ID
slotsOne entry per bay: id is the bay number, state is occupied, free or unknown
occupied / free / unknownNumber of occupied, free and unknown bays on this camera
changedBays whose state changed in this message; empty when the message comes from a stream dropping, recovering or a bay-list update
stream_okWhether the camera picture is fine. About 10 s after the stream drops it becomes false and the bays turn unknown

Add up free across all cameras to get the free bays for the whole car park.

Next Steps

  • Adjust bays at any time in the slot editor; changes apply on save.
  • To add cameras, run Step 1 again and append the new camera's address at the end (if you entered camera IDs, keep the existing IDs for the existing cameras). Bays you have drawn are kept.