Cameras
Cameras allow detection of vehicles on your layout. You can either use them in events, conditions or actions inside your scripts.
Model Train Script supports three different types of cameras.
Local
This means use the camera of the device you are working on. This mode is great for testing your scripts, however not so useful in a permanent layout. In the end you want a fixed position camera in order to have predictable script execution.
Remote
If you have an old iPhone or iPad laying around you can set that device in a remote camera mode in the configuration screen. These cameras are of high quality and the remote device will do the detection of the vehicles offloading that task from the main device running the scripts. This mode will deliver the most reliable results.
Web url
In this mode you Model Train Script will poll the specified url to retrieve an image and afterwards will process it to detect a vehicle on it. You can use this mode for example with a cheap ESP32-CAM module equipped with a camera webserver.
You can for example upload the example "CameraWebServer" to your ESP32-CAM Module via the Arduino IDE. Via the Serial Monitor you can get the ip address. In Model Train Script you can enter the url http://<ip-address>/capture.
Be aware that this mode will have an heavier load on your main device since all processing is done there.
Last updated