To display the image get from http with Python3.9 in groov view?

I know how to display an image file get from http using Python in groov view.
Please teach me the directory where I can access the groov view or how to browse the home directory from groov view.

Can I just get a little better understanding what are you looking to do here please?

I think you are saying that you have a Python script that is getting an image from some where and you want to show that image in groov View using the Video Gadget?

EDIT: If where you are getting the image from has a web address, you can just add that to the groov View video gadget.
You can read about how to use the video gadget here in this blog I wrote in 2015… Still applies today.

I think you are saying that you have a Python script that is getting an image from some where and you want to show that image in groov View using the Video Gadget?

Yes, I have the Python script and store image files in my EPIC home directory.
I want to display these files on groovView.

I hope you read the blog I linked.
You can see that in order to display the image in groov View, the image needs to be hosted on a web server such that you can use a URL to view the image.
EPIC does not have such a web server that the shell user can access, so we need to make one, we will use Python to create a small web server for the image.

From shell copy paste each of the following lines (one at a time).
Do not proceed if any line causes an error.

Update the EPIC repo, install python-pip (you may have this already, I don’t know. Tip: do not update PIP, ignore the warning) and then install the module http which is the python web server:

sudo apt-get update
sudo apt-get install python-pip
sudo pip install http

Now we create the bash script that will use Python to make the webserver:

nano web.sh

Copy the following into the editor, save with ctrl+o, enter, then ctrl+x

#!/bin/sh

# The image path needs to be explicit.
# Image must be a JPG, BMP, PNG or GIF.
# In this example, the image is called epic.png

~/epic.png
reass=$!

killer(){
    kill $reass
    exit
}
trap killer INT

python -m SimpleHTTPServer 8888

kill $reass

Now make the script executable.

chmod 766 web.sh

Lastly, run the script:

nohup ./web.sh &

Open groov View, go into build mode, add a video gadget and add the URL for the image like this:

image

Swap out ‘lcben’ for your EPIC host name.

Please note the following VERY IMPORTANT things.

  1. DO NOT open port 8888 on the EPIC firewall. You do not want to expose this webs server outside of the EPIC.
  2. DO NOT update the image very fast. You will wear out the EPIC disk drive.
  3. You will need to run the web server script when the EPIC starts up, look at using crontab to do this.
  4. You will need to backup and restore all this work when you update the firmware on the EPIC.

Please report back how this works for you.

2 Likes