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] Web interface #124

Open
Xayer opened this issue May 4, 2023 · 4 comments
Open

[Feature] Web interface #124

Xayer opened this issue May 4, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Xayer
Copy link

Xayer commented May 4, 2023

Describe the solution you'd like

First of all this project looks fantastic, and reminds me alot of Brick Automation Project.

The biggest thing most projects are missing is a web interface.

Similar to the pybricks interface running entirely in a webapp, I was wondering if it made sense to move the application to be based?

The first step would be to watch the websocket connection, or potentially be able to host the actual server on one device, and connect to it via the web interface. This would alleviate the need for seperate build steps.

Describe alternatives you've considered
If possible, export the GUI to Wasm, and make it possible for other clients to only "view" the layout, with no edit permissions.

@Xayer Xayer added the enhancement New feature or request label May 4, 2023
@Novakasa
Copy link
Owner

Novakasa commented May 4, 2023

Thanks for checking out the project!

Overall, I do think that porting brickrail to the web would make the software much more accessible. If the whole software would be contained in the web, many more platforms could be used to run brickrail, and it is something I am thinking about, but the bluetooth situation makes it quite difficult for me.

However, it sounds like you are looking for something slightly different? If I understand correctly you would like to be able to control the trains from the web, from any device, that is not necessarily the device connected via bluetooth to the trains.
To understand the request better, in what way would that help your layout concretely? Are you looking to control the trains via a tablet or phone?

@Xayer
Copy link
Author

Xayer commented May 6, 2023

Thanks for checking out the project!

Overall, I do think that porting brickrail to the web would make the software much more accessible. If the whole software would be contained in the web, many more platforms could be used to run brickrail, and it is something I am thinking about, but the bluetooth situation makes it quite difficult for me.

The Bluetooth protocol should be available in a web browser. However the api can be a bit tedious to work with. I am just looking for ways where users do not need to have their computer turned on, or have a specific OS to run software like this.

However, it sounds like you are looking for something slightly different? If I understand correctly you would like to be able to control the trains from the web, from any device, that is not necessarily the device connected via bluetooth to the trains. To understand the request better, in what way would that help your layout concretely? Are you looking to control the trains via a tablet or phone?

I am looking to broadcast the layout and the train events to other devices that are not necessarily the host. I'm thinking for exhibitions where visitors could scan a QR code and follow the trains around on the track.

It's nothing but an idea at this point, but I think it could be fun. I could of course just sniff the websocket connection and make a web map for now as a proof of concept.

@Novakasa
Copy link
Owner

Novakasa commented May 6, 2023

The Bluetooth protocol should be available in a web browser. However the api can be a bit tedious to work with. I am just looking for ways where users do not need to have their computer turned on, or have a specific OS to run software like this.

Yeah, looking at e.g. the pybricks code webapp, discovering and connecting to hubs there seems to require some actions by the user, whereas brickrail can already do a lot automatically as long as all the hubs are turned on. I do not know the web bluetooth API yet, but my guess is that the user confirmation for every connection is needed due to security reasons.

I am looking to broadcast the layout and the train events to other devices that are not necessarily the host. I'm thinking for exhibitions where visitors could scan a QR code and follow the trains around on the track.

That definitely would be cool. It is however not straightforward to implement, currently the websocket connection only communicates low-level commands between GUI and hubs. So, essentially it contains commands to the trains and sensor feedback from the trains, but nothing concrete about the virtual layout.

For what you describe, it probably would be better to add a new API open to the web that allows getting current info about the virtual layout.

@Xayer
Copy link
Author

Xayer commented May 7, 2023

That definitely would be cool. It is however not straightforward to implement, currently the websocket connection only communicates low-level commands between GUI and hubs. So, essentially it contains commands to the trains and sensor feedback from the trains, but nothing concrete about the virtual layout

For now it'd be alright to het the layout statically, and require the users to reload the page to see new changes.

For what you describe, it probably would be better to add a new API open to the web that allows getting current info about the virtual layout.

Yeah that'd be awesome if possible.

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

2 participants