soundanalogous / Breakout

Breakout is a javascript library and toolkit for connecting Arduino and other IOBoards to the web
www.breakoutjs.com
MIT License
180 stars 20 forks source link

enabling php with the server ? #64

Closed mohamedpsx closed 8 years ago

mohamedpsx commented 10 years ago

Breakout is cool untill you want something like php scripts along with your htl and js pages, any one did something similar ? or have an idea where to start ?

i think the way to go is php-fpm and routing all the php request to it from the breakout server.

Thank you.

soundanalogous commented 10 years ago

I suggest creating a php version of breakout server and not use the GUI-based breakout server at all. You could start by porting the existing nodeJS version of Breakout server: https://github.com/soundanalogous/Breakout/blob/master/node_server/server.js. You'd have to find a php library that enables you to connect to the serial port and another one that enables websocket communication. Not much too it really.

soundanalogous commented 10 years ago

The other option which is even simpler is to use Breakout Server only for the serial to websocket bridge. You don't actually need to serve your pages from Breakout server at all. Just make sure the IOBoard object points the url and port of BreakoutServer and that you load the website from your php server.

mohamedpsx commented 10 years ago

@soundanalogous thank you very much for your fast reply.

i tested the second option and it does work perfectly so thank you, you saved my night :D

but still a php version of the breakout server is a good idea and it might get popular.and as you said porting it should not be a big problem since there is an existing serial and websocket php library.

i will see what i can do with it and i will keep you in the loop.

thank you again ;)