Arduino >> (Adobe) Flash communication (non-polling?) (serproxy/tinkerproxy?)

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.

^bump..

anyone use serproxy or tinkerproxy before? and can give some general breakdown on how it all works?

Wondering if this is the ONLY solution out there? (just not clear on what the .exe is for? (JAVA app?).. and why its needed? And how that gets executed? Manual install? And how it may apply when used on a RPi?)

  • How to get output from an Arduino to an Adobe Flash app? (preferred a non-polling type of solution as there is no telling when the Arduino might send out an update.)..
  • dont want to (prefer not to) have the flash app constantly loading a text file or call a php script that queries some database..

  • if I go the above route.. then that means the output from the main Arduino needs to send this data to a php script to either 'save/update' a text file or save to a database so the above 'polling' approach can happen.

Bear in mind that Flash in browsers is deprecated, will be end-of-lifed in a year or two, after all the browsers remove it.

I 100% know/understand that.. (I was an AS2 developer for many years.. and never learned AS3 because I saw the writing on the wall back then even)

However this is for a specific project.. so the question(s) still stand.

This is not something that needs to be or even will be 'on-line' for any public use... so the current browser support or lack there of is not a concern.

It current works and runs fine in Chromium.. (with some 'on-line' tests... meaning with some .swf's I posted on my personal domain and checked out.... however this will be hosted locally on the RPi once completed.. so I still need to install a self signed certificate on the local LAMP install for the camera portion to work)..

So 'thumbs up here'... as I'm not asking for approval of using Flash.. I'm asking if people can provide some feedback (at the very least about the tinkerproxy stuff..etc if they have used it).. or maybe even some other approach would be better! :slight_smile:

Since you brought up the 'browser' issue.. it made me think about what would happen if the project was exported to a .exe file? (usually packaged with the flashplayer I believe... been a while)

I wonder if it runs locally (no browser).. if I still need this 'proxy junk'?

My main concern/question is about the .exe I see? Is that some JAVA app? IS that needed for a linux based system like the RPi?

As to .swf files - that is what VLC is for. :grinning:

xl97:
How can I BEST get data from my Arduino >> Flash app?

I don't use PHP (or Flash) and what I am going to say is not intended to rule out PHP - it may be that you can do the same sort of thing with it.

If I was doing that sort of project I would use Python and the Bottle web framework. That allows me to have a "normal" PC program in charge of the interface with the Arduino (and generally controlling the project) coupled with the ability to interact with the browser.

If there is no user input from the Browser you will need to establish some system that allows it to get updates - for example some Javacript on the browser could make periodic calls to the Bottle server. (For all I know Flash can be responsible for the calls to the server).

The overall point of my comment is the idea that there is a PC program in charge of the project and not just the browser.

...R

Thanks @Robin2

I dont know any Python, but I'm gonna read up on the Bottle web framework you linked to anyways.,

see if it yields any ideas.. or maybe convinces em to tackle some Python solution. :slight_smile:

There may NOT be a good solution in the end.. (I'm not clear if those serproxy/tinkerproxy approaches also need some sort of 'polling' approach to keep checking the 'socket' or what..... and if thats the case.. I might as well just use a 'text file' type of approach...(or DB..etc).. you get the idea)

Thanks again.

It's a long time since I wrote it but this EzScrn demo uses Bottle and may give you some ideas.

It is a a little more complicated because if uses some code from CherryPy to give some server features that the simple server in Bottle does not provide - IIRC it is the ability to have multiple browser requests in parallel.

...R