I'm looking for some communication on my project to 'talk things out'.. and get some sort of direction in my head..
1.) I have done projects where a Flash App (front end) is using PHP to send data to connected Arduino to change 'whatever' (an RGB led for example)..
This was a Windows project..
This was a easy enough because the data being sent was 'user driven'.. (ie: Flash app/webpage is used as GUI.. user sets some values.. hits send...blah blah blah).. I posted everything to share YEARS ago..
2.) I recently worked on another project where I used an RPi, with LAMP installed to host a webpage (no flash, straight HTML/CSS/AJAX & PHP)... that was more or less a MENU with item/options..
User clicks selection.. page submits.. data is sent to PHP script.. that in turn sends this data out to a connected Arduino over serial port... Arduino parses this data... performs its actions.. and then returns some data back to this webpage via the same PHP script that sent the data.. and a 'listening' AJAX routine in the HTML (javascript) markup..
After finally getting some RPi/serial port permission issues.. this works flawlessly..
I just wanted to give some background on my knowledge and past projects.. (not a pro.. just a hobbyist!.. and I like to play around with different projects)
Here is why I am posting.. and what I'm looking to chit-chat about.. and learn more and have better 'key words' to research about.
Project details:
- RPi with LAMP installed
- RPi hosts a webpage with an embedded Flash app in it, and HDMI display
- This hosted webpage has no 'interface'.. its purely just a 'display' (ie: there are no buttons/links to interact with,, its not a form where you enter in data and submit it anywhere..etc).. that is there to 'display' incoming data.
Here is where my question(s) come into play...
How can I BEST get data from my Arduino >> Flash app?
** There is no telling when the Arduino will send data to RPi/webpage (whenever one of the scenarios is met/sensors does something.. it will send an update out)
** I'm -not- really keen on some sort of inefficient/polling type of solution..
In theory.. I might be able to just use a PHP script and open up the COMM port and 'wait' for a reply.. parse/handle it.. and the go back to opening the COM port again to wait for any future data being sent..
But that doesnt really get me the 'full package' where as I still need to get this data in the FLASH App.....
I could use the PHP script to save this data to a text file or database.. but inside the Flash app.. I'd still need to keep 'polling' (either a text file which can be loaded directly.... or calling another PHP script that queries the database.. and returns the 'info')..
I have read about some things called serproxy and tinyproxy (I think)... but when I gave it a quick glance.. seems to talk about JAVA (not javascript).. and some .exe files..etc..
Not only am I not clear on that approach...... I'm not sure how that would work on an RPi?
I am fluent in AS2 ... but not so much in AS3...
Is there some sort of SOCKET approach I can use? So that the flash app is just listening to the COM port at all times? Awaiting any possible update/data being sent?
Thanks for all suggestions/communication.