Linuxcnc controlled by smart phone or other device running a webbrowser

More
07 Oct 2024 19:54 #311522 by Grotius
Hi all.

I am almost ready with a project to communicate from and to linuxcnc trough websockets
to exchange realtime io.

In other words, interact with a running linuxcnc machine from a remote webbrowser.
Linuxcnc can be controlled remote by any device like a android phone, i-phone, tablet etc, you name it as
long it has a webbrowser on it.

You can connect multiple phones at the same time to one linuxcnc machine, no problem. So your employees can
even monitor the linuxcnc machines during lunch time over multiple machines.

You can connect to multiple running linuxcnc machines on the local network from one phone, or multiple phones.

It's already working, very responsive, but i want to expand the controls for the web browser gui.

The setup:
There is a fresh linuxcnc repository hosted on codeberg, i added 2 cmake directories in the top dir.
1. nml_websocket_server
2. nml_websocket_client

In a later post i will add a readme how to install and run the project on your phone or tablet.

Running on my pc:

Running 2 androids:


How its done in a nutshell:
1. The nml_websocket_server connects to the linuxcnc nml server as a new client.
The nml_websocket_server has mapped 95% off the entire nml status & command channels.
When a new nml_websocket_client connects, the server sends the status, and recieves the commands from the client,
where the client can be a smart-phone.
For info the websocket_server starts a python server once linuxcnc has started to provide the client with the .html, .js, wasm files. So the client has no files on it.

2. The nml_websocket_client has no files on the device (phone). To retrieve the files we must connect to the python server of the linuxcnc machine.
On the device open a web browser and type in the ip & port of the linuxcnc machine. This is a fixed ip adres of the cnc machine.
Then the phone can select the index.html file, and the app will start running webassembly. (wasm)
When the app run's it only using the websockets for realtime data traffic. The python server is then obsolete
Attachments:
The following user(s) said Thank You: akb1212, tommylight, onceloved

Please Log in or Create an account to join the conversation.

More
08 Oct 2024 11:28 #311560 by tommylight
Using webassembly, nice! :)
There was something similar here a while back, probably using LinuxCNCrsh, a bit fuzzy on it as it was probably a few years back, but it went quiet. Interface was quite clunky and had some lag, so what is the lag now?
Should be better with wasm, hepefully.
Thank you for everything.
The following user(s) said Thank You: Grotius

Please Log in or Create an account to join the conversation.

More
08 Oct 2024 14:13 - 08 Oct 2024 14:15 #311573 by Grotius
Hi Tommy,

Thanks for your responce.

I have also seen a linuxcnc web interface. It's years ago. I think on youtube.

Using wasm is just a outcome of trying out different approaches.
It's quite hard to get started with wasm, the installing on qt-creator costed me half a day to find out.

But once you are off. It's easy.

Ok i now have a mobile phone that interacts trough a webbrowser with the linuxcnc nml server.
I have modified the gui a little bit. Even the combined xy moves are working.

It's very responsive and stable.

Picture:
 

Video:
www.youtube.com/shorts/IDJHTxdfp6Y

Codeberg is updated with this version of code.

Thank you for everything.
You are welcome. I heard there was a water flooding in your country. Are you involved?
Attachments:
Last edit: 08 Oct 2024 14:15 by Grotius.
The following user(s) said Thank You: akb1212, tommylight, Aciera

Please Log in or Create an account to join the conversation.

More
08 Oct 2024 14:40 #311577 by tommylight
This seems much more responsive than i what i recall from the other web app, nice! :)
-
Yes we had some flooding, not tragic, both my shops were flooded, luckily i was in the shop when the water started entering in so i moved everything on the tables, and an EOD tank on top of some rubber flooring, by the time i moved everything i could, there were 15cm of water inside, so i ran to the other shop and got terrified as there was nearly half a meter of water running through there, the gutters were clogged with leafs so all the water was coming in, could not move anything as the water was also pouring all over the power box so i just left, was not feeling like being electrocuted as the power was still on, went back, turned power off to both shops from the main power distribution and went home to shower as i was completely and utterly wet! :)
Luckily, no major damage, good weather after so everything was dry in 2-3 days.
The following user(s) said Thank You: Grotius

Please Log in or Create an account to join the conversation.

More
08 Oct 2024 17:53 - 08 Oct 2024 17:54 #311596 by Grotius
@Tommy,

I don't know what to say. I hope your shops will recover from this disaster.
Last week i showed a mechatronic master student the forum and your name. He lives in
Kroatie and visits Kosovo a few times a year.
Last edit: 08 Oct 2024 17:54 by Grotius.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 1.803 seconds
Powered by Kunena Forum