Search code examples
pythonelasticsearchsshgoogle-coral

Doubts on how to perform telemetry: using a devboard and a laptop


I have a devboard (Google Coral). There are some scripts in there to perform image classification and object detection.

I want the results of those scripts (model, inference_time, score, image, etc) to be sent/indexed into Elasticsearch.

Also, there is a camera (came with the board) that I can use and take photos (there is a script for it too).

My approach so far has been:

  1. I wrote a script using Paramiko to connect to the devboard. (It is in my PC)

  2. Still, using Paramiko, I executed the scripts which are inside the devboard (turn on camera, wait until spacebar to take photo, make classification, send results to a server)

  3. The results are indexed into Elasticsearch (it is installed in my PC).

I would like to know if there is a better way to do what I have done. What confuses me is that I have to connect to the board to execute a script (takes photo and performs classification). But I also have other script (in my PC) which connects to the devboard to give instructions, collect results and index them into Elasticsearch. Should I have put everything inside the devboard? Should I have used a serial communication? Should I have used subprocesses?

@JGK


Solution

  • I guess this is more of a design questions than a technical issue :)

    I'm not sure if this approach will works for you, but if I was to design this:

    1) On the Dev Board, design an http server that is constantly ready to take a GET/image request. If the request is received, take a picture, and return the image + classification results to the client. Here are a couple of similar projects (disclaimer, one is mine): [restor, snowzach/doods, ...]

    Note that those 2 servers were designed for different things than what you're trying to accomplish. They are expecting the client to send the image and then return the result. While in your case, your client is expecting both image and result from the server.

    2) On the client just send a request, and your server should send back the image + results.

    3) On the client side, since you already have the result, send that to elastic search.