A
A
Andrey Sedelnikov2016-12-22 23:07:46
linux
Andrey Sedelnikov, 2016-12-22 23:07:46

One serial port and multiple web connections - how (php, python, ..)?

Colleagues,
I have a small web server on a mini device (OpenWRT Linux, Carambola2) that needs to read from (and write to) the serial port. There is only one port, but several clients (via a browser) can be connected. This means that it is necessary to make sure that the changes recorded by one client are automatically displayed for the others, as well as that there are no collisions when reading-writing from the port. php or python are seen as the environment. Both have components for working with the port, but for some reason there are no ready-made solutions for such multithreading.
Where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2016-12-23
@leahch

Organize a command queue. Notify clients via websocket. All this can be easily done on twisted + cyclone.io for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question