The camera address is ip + port + onvif_ctrl (la_mojo builds
http://ip[:port]onvif_ctrl). The web UI broke it for cameras whose ONVIF
interface isn't on port 80.
doCameraOperation.php, CMD 4 (change IP / credentials)
- An address without ":port" set port=NULL. The camera editor showed the
IP without the port, so changing only the credentials moved a camera on
8080 back to port 80. Now "ip:port" sets the port and "ip" keeps the
stored one.
- A port kept inside onvif_ctrl (":8080/onvif/device_service", cameras
added by discovery) is moved to `port`. Once port was set too, la_mojo
built http://ip:8080:8080/onvif/device_service.
doCameraOperation.php, CMD 3 (add camera / check credentials)
- Camera from the DB: the port may also come from onvif_ctrl (it was read
from `port` only, so the check went to port 80 and failed).
- Direct address: "ip:port" or the dialog's Port field (PO) is the ONVIF
port. Discovery stores ip, port and the device service path separately.
Without discovery, onvif_ctrl was the full MEDIA service URL and ip
was "ip:port"; now it is /onvif/device_service, ip and port.
- count() of a string (PHP 8 TypeError, not caught) killed the request
when the snapshot URI was read.
getCameraEditor.php
- The address field shows "ip:port" when the camera has a port.
Tested with PHP 8.3, a SQLite cameras table and a fake ONVIF camera on a
custom port. The old code dropped the port, built ip:8080:8080, stored
"ip:port" + the media URL, and crashed. Now the record and the
credential check are correct.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
PHP ignores the host time zone: without date.timezone in php.ini (the
installer does not set it) it uses UTC, so session labels, event times,
the hour nodes and the live log were shown in UTC while la_mojo names
report folders/files in local time.
- lib/php/host_timezone.php: sets PHP's default time zone from the host
(/etc/localtime as maintained by timedatectl, then /etc/timezone, then
TZ); loaded right after settings.php by ajax_asm, assembler, js_asm,
soap_asm and ui_asm; added to files.list.
- Calendar day key: getHistoryDates returns the host-local noon of each
day and getHistoryDay uses it directly. The old "local midnight +
current UTC offset" (applied twice) only worked east of UTC and could be
off by a day across a DST change.
- Video download file name uses the host-local time from getVideoInfo
instead of the browser's time zone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
la_mojo now writes one report database per local hour into the day
folder (data/reports/YYYY/MM/DD/report_HH.db) instead of a single
report.db. Days recorded earlier keep their report.db; a day during the
upgrade has both.
- lib/php/db/report_files.php (loaded by ajax_asm.php, added to
files.list): lists a day's report files and maps ids. Row ids are per
file, so ids sent to the browser are global:
id = slot * 10000000 + rowid (slot 0..23 = hour, 24 = legacy report.db)
The JavaScript treats ids as opaque, so no JavaScript changes are needed.
Report files are never created by the web UI (existence is checked).
- getHistoryDay: sessions and "Events by Hours" from all files of the day
(legacy file split by hour as before, one node per hourly file).
- getHistoryEvents, getBubbleAnalysis, setPermanentBubbles: BID..EID range
resolved to its file.
- getVideoInfo, getPictureInfo, getFrames: event/video ids resolved to
their file; video ids returned as global ids.
- getStatus (live log): newest hourly file of the newest day; LSID from a
previous hour/day restarts at the beginning of the new file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16