Files
AI-on-the-edge-device-docs/docs/Demo-Mode.md
2025-03-15 22:10:32 +01:00

4.1 KiB

Demo Mode

For Demo and Testing Purpose, the device can use pre-recorded raw images.

You need to enable it in the configuration (TakeImage > Demo) and also provide the needed files on the SD card.

For each round one image gets used, starting with the first image for the first round.

For the reference image and the alignment also the first image gets used.

Once the last image got reached, it starts again with the first one.

SD Card Structure

demo/
├── 520.8983.jpg
├── 520.9086.jpg
├── 520.9351.jpg
├── ...
└── files.txt
  • The jpg files can have any name

  • The jpg files must be smaller than 30'000 bytes

  • The files.txt must contains a list of those files, eg:

      520.8983.jpg
      520.9086.jpg
      520.9351.jpg
    

Collecting images of your device

There are several ways to collect images from your device:

  1. Use the RawImagesLocation parameter to store them directly onto your SD card, see Parameter RawImagesLocation
  2. Use the Webhook to send the raw image on each round to a dedicated server, see Webhook resp. ../Parameter UploadImg.
  3. Another option is to pull the images periodically from http://<IP>/img_tmp/raw.jpg. Eg. with an external service. Below is a (Linux)-Bash script to do it:
    #!/bin/bash
    while [[ true ]]; do
        echo "fetching value..."
        wget -q http://192.168.1.151/value -O value.txt
    
        value=`cat value.txt`
        echo "Value: $value"
    
        diff=`diff value.txt value_previous.txt`
        changed=$?
        #echo "Diff: $diff"
    
         if [[ $changed -ne 0 ]]; then
             echo "Value changed:"
             echo $diff
             echo "fetching image..."
             wget -q http://192.168.1.151/img_tmp/raw.jpg -O $value.jpg
         else
             echo "Value did not change, skipping image fetching!"
         fi
    
         cp value.txt value_previous.txt
    
         echo "waiting 60s..."
         sleep 60
     done
    

Use prepared images

See the selection below with prepared images.

How does it work

The Demo Mode tries to interfere as less as possible with the normal behavior. Whenever a Cam framebuffer gets taken (esp_camera_fb_get()), it replaces the framebuffer with the image from the SD card.

Example Data of a Water Meter

You can use the following demo images if you want:

530 00688{:style="width:400px"}

It covers a meter range from 530.00688 to 531.85882.

Animation

Animation of the watermeter (77 MB!)

Selection of 84 images

grafik{:style="width:400px"}

Demo_Images_Watermeter_530.00688-532.08243_84_images.zip

Selection of 42 images

grafik{:style="width:400px"}

Demo_Images_Watermeter_530.00688-532.08243_42_images.zip

All images (843 images)

grafik{:style="width:400px"}

Demo_Images_Watermeter_530.00688-532.08243_843_images.zip