Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: HTTP endpoints #46

Closed
mishoboss opened this issue Apr 26, 2022 · 15 comments
Closed

Feature Request: HTTP endpoints #46

mishoboss opened this issue Apr 26, 2022 · 15 comments
Labels
enhancement New feature or request

Comments

@mishoboss
Copy link

A mini HTTP server with at least two HTTP endpoints would be really helpful to create a remote control over the kiosk's content.

  • GET /seturl?url=google.com - loads the given URL to the chromium instance
  • GET /settempurl?url=google.com - loads the given URL to the chromium instance, wait TEMP_URL_WAIT_TIME amount of seconds and then load the previously loaded URL again

Above functionality would be essential to implement scenarios like show camera feed page on ring bell, or show cameras bird view on perimeter alarm trigger, etc.

When these endpoints are hit, the screensaver should go off and show the newly loaded page on the screen.

@Salamek Salamek added the enhancement New feature or request label Apr 26, 2022
@mishoboss
Copy link
Author

Hi Salamek, what are the chances for this one? It would be really awesome to have it, will open a lot of possibilities. :)

@Salamek
Copy link
Owner

Salamek commented Jul 27, 2022

@mishoboss this will get implemented in qiosk most likely as a Websocket endpoint... but i'm not sure when i will have time for it...

@mishoboss
Copy link
Author

Thanks, for the fats reply. Just wondering, why websocket endpoint? IMHO nothing requires real-time communication and it is way harder to interact with websockets from 3rd party software (e.g. Home Assistant). A simple HTTP GET endpoint is more than enough. Just my 2 cents.

@Salamek
Copy link
Owner

Salamek commented Jul 27, 2022

Well mainly two reasons:

  1. REST server in QT is pain in the ass to do, you have to use unmaintained external library or write your custom HTTP 1.1 server implementation...
  2. I can kinda feel the next "Feature Request" from someone that will go like something like this: "I want to trigger a XYZ when home button is pressed/when idle time timeouts/etc"

But i'm not decided yet on how i will implement this, i will see when i start doing it...

@darkol
Copy link

darkol commented Aug 4, 2022

Ok, I have checked the chromium_kiosk.py watch_config and chromium-kiosk-extension/background.ts and I have an idea.

I think I could implement (optional) HTTP(S) endpoint in Python in chromium_kiosk.py watch_config for remote management of the runtime and/or local config. Only from localhost or from remote with basic authentication (preset) token via https?
This way chromium-kiosk-extension websocket client could stay the same.
Maybe qiosk is also served this way?

Additionally I think 'event':'onClientAppReset' could be interesting e.g. for remote reset of the kiosk to homePage (HW Button keypress, some external event etc.) similar to chrome.idle.onStateChanged idle reset. Seems I could add this easily.

@darkol
Copy link

darkol commented Aug 4, 2022

I have created additional Feature Request
#62
from the presented 'event':'onClientAppReset' idea.

@Salamek
Copy link
Owner

Salamek commented Aug 4, 2022

@darkol my idea is that qiosk will be running a websocket server (bind to 127.0.0.1 by default/configurable in config) (so multiple clients can connect) one client can be HTTP API running in chromium-kiosk (python) [and CLI API so it can be controlled from command line] other clients can be custom apps sending/receiving events to implement custom stuff... ?

@mishoboss
Copy link
Author

@Salamek, please excuse me for the push, what are your plans for this feature in the roadmap?

@mishoboss
Copy link
Author

@Salamek, just an alternative idea - maybe even better is MQTT control. Something like those:

@Salamek
Copy link
Owner

Salamek commented Jul 22, 2023

qiosk already supports mqtt chromium debug control... it is just not enabled by default (i had no time to test it)

@Salamek Salamek closed this as completed Jul 22, 2023
@Salamek Salamek reopened this Jul 22, 2023
@mishoboss
Copy link
Author

@Salamek, is there a documentation how to use it? I don't see anything related to MQTT in the qiosk project.

@Salamek
Copy link
Owner

Salamek commented Jul 24, 2023

@mishoboss it is in chromium-kiosk docs... https://github.com/Salamek/chromium-kiosk/tree/master/.docs#configuration

#REMOTE_DEBUGGING: # Set to port number to enable available only when using qiosk browser

so in your /etc/chromium-kiosk/config.yml set:

REMOTE_DEBUGGING: 9988

and reboot... this should open chromium debug port on localhost:9988, you should be able to connect using chromium dev tools and any client library for chromium orchestration using chromium debug port

I wanted to implement some simple client,http server and CLI interface into chromium-kiosk using this debug port to fulfill this issue... but had no time to finish it

@mishoboss
Copy link
Author

mishoboss commented Jul 24, 2023

Probably I miss something here, but Chromium remote debugging has nothing to do with MQTT as messaging system.

P.S. I just realised what you mean. Open the remote debug port and just use this project then - https://github.com/functionpointer/mqtt-chromium-control

@Salamek
Copy link
Owner

Salamek commented Jul 24, 2023

@mishoboss yop, something like that

@Salamek
Copy link
Owner

Salamek commented Jan 22, 2024

Ok this was resolved by adding websocket control see https://github.com/Salamek/qiosk/tree/master/.docs#remote-control

@Salamek Salamek closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants