Vision inspection
13 min
a camera inspection cell on a bottling line fill level read from the frame, per bottle, with the inspection running on the edge rather than in a cloud one device and 15 tags, plus the video itself operator view port 4013 protocol server port 5023 devices and tags 1 device, 15 tags litmus edge driver modbus tcp image food beverage vision scenarios a fill anomaly caught per bottle the measurement is made from the picture, bottle by bottle, and published as a tag like any other reading filler drift as a forecast the interesting number is not the bottle that failed but the trend that says the filler will start failing shortly inference on the edge the frames never leave the plant to be measured what travels north is a number, and the picture only if you ask for it overview this is the one solution that uses two data paths, because the picture and the numbers suit different ones inspection readings go to devicehub over modbus tcp , like every other solution here these are the tags the edge polls frames go to litmus edge datahub over nats , which is built for payloads of that size and shape a dropped frame therefore never costs you a measurement, and the tag history is not full of images the nats path is optional leave it unconfigured and the inspection still runs and still publishes its readings what it creates on litmus edge one devicehub device with 15 tags covering the fill measurement, the inspection verdict and the line state a digital twin instance for the cell analytics groups behind the anomaly and drift figures frames land in datahub when nats is configured requirements litmus edge 4 0 x, reachable over https from the host running the solution an api token for that edge, or a username and password, or a client id and secret docker, and docker compose for the compose deployment a network path in both directions the solution reaches the edge's api, and the edge reaches this host on the protocol port deploy the solution ships two ways use the registry if the host can reach google artifact registry, and the downloaded archive if it cannot option 1 pull from the registry requires a read only registry credential, supplied by litmus separately cat key json | docker login u json key password stdin https //us docker pkg dev save this as docker compose yml services food beverage vision image us docker pkg dev/litmus customer facing/litmus solutions/food beverage vision 0 3 0 container name food beverage vision restart unless stopped ports \ target 4013 published 4013 protocol tcp \ target 5023 published 5023 protocol tcp environment \# fill these in edge url "${edge url }" edge api token "${edge api token }" sim host "${sim host auto}" apply on start "${apply on start 1}" edge verify tls "${edge verify tls 0}" http port "4013" modbus port "5023" \# optional frames to datahub nats url "${nats url }" nats token "${nats token }" pub group "${pub group fbvision}" pub layout "${pub layout datahub}" log level "info" edge url=https //10 0 0 5 edge api token=your token sim host=10 0 0 9 docker compose up d open http //localhost 4013 the page stays on its waiting panel until the edge carries this solution's devices that is deliberate the simulation does not tick and no value is shown until litmus edge is verified to hold the devices and poll them, so nothing on screen can be mistaken for data that never made the trip with apply on start at its default of 1 the solution configures the edge itself on startup, which takes 30 to 60 seconds if you set it to 0 , or the apply failed, press apply to edge in the page header this is the largest image of the set, about 219 mb, because it carries the vision libraries the others are around 50 mb option 2 load the downloaded archive download food beverage vision 0 3 0 amd64 tar gz from the solution's page on portal litmus io the archive is the container image, not a source bundle, and needs no registry access docker load i food beverage vision 0 3 0 amd64 tar gz docker load prints the image it added loaded image us docker pkg dev/litmus customer facing/litmus solutions/food beverage vision 0 3 0 that reference is the one the compose file above already names, so the same docker compose yml and env now work offline with no docker login docker compose up d to run it without compose, pass the same three values on the command line docker run d \\ \ name food beverage vision \\ \ restart unless stopped \\ p 4013 4013 \\ p 5023 5023 \\ e edge url=https //10 0 0 5 \\ e edge api token=your token \\ e sim host=10 0 0 9 \\ us docker pkg dev/litmus customer facing/litmus solutions/food beverage vision 0 3 0 configuration variable default what it does edge url unset litmus edge to configure edge api token unset token for that edge or a username and password sim host auto address the edge polls to reach this solution apply on start 1 configure the edge on startup edge verify tls 0 1 checks the edge's certificate nats url unset litmus edge datahub, for frames optional nats token unset a datahub token not the same string as the api token above pub group fbvision topic group frames are published under pub layout datahub topic layout flat matches the upstream frame streamer convention line speed 4 how fast bottles pass the camera when running as an application hosted by litmus edge, nats url is 10 30 50 1 , which is the edge as seen from a container it hosts running beside the edge, it is the edge's own address operator view the camera view with the inspection overlay, the measured fill level per bottle, and the verdict beside it, the trend that the drift forecast is taken from faults let you drift the filler, introduce a fill anomaly, and degrade the image so you can see what the inspection does with a poor frame apply and remove docker compose down use clean up in the solutions provisioner # to remove what it created on the edge support support\@litmus io mailto\ support\@litmus io