I connected my Raspberry Pi and Arduino together and I'm able to use buttons and AJAX calls on the client side of the browser. The client turns on a button and the system will give information back or let a led turn on on the Arduino.
The problem is that the Client always takes the action and the Arduino is the slave device, now I want to change this. For example if I add a button and press it on my Arduino I can send the information via a serial communication line over to the RaspberryPi. But this wont trigger my PHP page. I know I can active listen to the serial port using Python but how can I then push the data from Python to the clients browser?
I do know about web sockets but I wonder if I send data over from Python to PHP, the PHP page will trigger and then update my browser window? Don't think that's possible. Another option is server-side events, but that no different from long polling (it seems to me). Another problem, if I keep the device open in Python then my PHP page wont be able to use this.
So has anyone experience with this or know how to possibly solve this (with another technology) or something else I really could use some information how to tackle this problem.