4ch1m/pixoo-rest

Defaults to server's IP

ishtangli opened this issue · 3 comments

Fresh install of Ubuntu 20
Followed instructions
Set .env variables
Ran docker-compose up

Site is accessible but when I try to run a command, the IP it uses is the server's IP, not PIXOO_HOST

4ch1m commented

Works for me.
Relevant parts are here...

environment:
- PIXOO_HOST=${PIXOO_HOST:-pixoo}

... here ...
pixoo_host = os.environ.get('PIXOO_HOST', 'Pixoo64')

... and here:

pixoo-rest/app.py

Lines 33 to 37 in 652bc90

pixoo = Pixoo(
pixoo_host,
int(os.environ.get('PIXOO_SCREEN_SIZE', 64)),
pixoo_debug
)

Can't help you any further with the little information you provide.

Sorry for the lack of information.

I installed Ubuntu 20 to a vm with a static IP of X.X.X.115. The Pixoo has an IP of X.X.X.225.

When I try to send text to the Pixoo, the curl script shows it tried to send it to X.X.X.115 which is the server's IP.

I confirmed that X.X.X.225 was set as PIXOO_HOST on the .env file.

Also tried to hard code the server's IP onto app.py and docker-compose.yml but it still pushes the payload to X.X.X.115.

Server is named pixoo-server if that matters.

Is 5000 the default port on the pixoo for pushing commands? Examples on the documentation uses 80.

4ch1m commented

When I try to send text to the Pixoo, the curl script shows it tried to send it to X.X.X.115 which is the server's IP.

This is the intended behaviour.
The (Swagger-)UI (and/or the generated curl-request) points to the locally running Python app/server. This app/server will then use the Pixoo Library to send the actual commands to the Pixoo device.

In other words: The (Swagger-)UI itself does not directly talk to the Pixoo-device.