dcsimg
A Flash Developer Resource Site

Page 2 of 5 FirstFirst 12345 LastLast
Results 21 to 40 of 81

Thread: (AS2) Flash to read\listen to serial port?

  1. #21
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,020
    when using 127.0.0.1 in browser you must use that link and include swf in the file path,

    its simple just click add location> browse to the swf file and that's it, its saved and your security settings are fine for that swf.
    you want to make a hypocrite out of everythinggg zomg

  2. #22
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    What if this browser on the RPi never has connection to the internet?

    How can you set that setting?

    The RPi is offline or at least will be when playing this .swf..

    I plan on making several of these.. and outside of this first one.. I would imagine NONE will have an internet connection..

    Does this still apply then?

  3. #23
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,020
    You only need to connect it once for that, if theres no way you can do that once I will try to take the file from there site so you can do it offline.

    Usually when I make a good raspberry pi .img, I put the sd back in my windows machine and save the .img using win32diskimager by clicking "read" and setting a new name for the rp.img os and directory for the os to be saved in.
    Last edited by Alloy Bacon; 01-31-2019 at 11:29 PM.
    you want to make a hypocrite out of everythinggg zomg

  4. #24
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    Finally got around to getting another RPi set-up.. I have everything installed/configured correctly (or so I believe)


    I have an Arduino connected via USB cable to the RPi.. I believe it is enumerating as /dev/ttyUBS0

    *(when I unplug it and check again... I no longer see /dev/ttyUSB0.. when I plug it in again and check its back.. so I led to believe that is the 'port' for the connected Arduino)

    The arduino is just sending serial data out in a loop, over and over..

    I have this in my Flash app:

    Code:
    var server = new XMLSocket();
    server.connect("127.0.0.1", 7777);
    
    server.onConnect = function(result){
    	if(result){
    		//connected
    		state_txt.text = "connected";
    	}else{
    		//not connected
    		state_txt.text = "not connected";
    	}
    
    }
    
    server.onClose = function(){
    	//disconnected
    	state_txt.text = "connection closed";
    }
    
    server.onXML = function(data){
    	//do whatever	
    	incomingData_txt.text += data;
    	
    	//close
    	//server.close();
    }

    But eventually.. in the end, all I get is NOT CONNECTED in the text field..

  5. #25
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I have tried everything I can think of.. I can NOT get flash xml xocket to connect to the RPi/socat (virtual serial port)..

    Always getting the 'not connected' error displayed on the screen...

    Is this a permissions thing? Have you done this on an RPi? Or just on a Windows machine using that .exe file?

  6. #26
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    @Alloy Bacon

    Any suggestions for me here?

    I'm not sure if the SOCAT is not configured correctly?

    Or perhaps its on the FLASH side of things? WHere I might need a crossdomain/security policy in place or something?

    I can -NOT- connect to the port @ 7777.

    I have tried using: 127.0.0.1 as well as 'localhost' ...

    neither changed anything.

  7. #27
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,020
    ok first check if the problem is just flash security, in terminal type:
    PHP Code:
    apt-get install putty 
    find putty installed in your rpi start menu around browsers tab maybe.

    when you start putty

    click "raw", put 127.0.0.1 and 7777 and click open:
    (I would also probably click never close window on exit, you might get some data and not see it and putty closes)


    If you see arduino data coming in, its a flash security issue likely.

    If no data comes in,socat is not configured correctly, so next check if youre even getting serial data without the socat by doing this:
    click "serial" set 9600 and type in your arduino's usb tty, if that's not opening, than you are using the wrong tty for the whole thing.
    Try your ttyusb0 and also try ttys0, you can try ttys1 ttys2 as well.


    anyways please specify which rpi model you have.
    Last edited by Alloy Bacon; 02-05-2019 at 06:36 PM.
    you want to make a hypocrite out of everythinggg zomg

  8. #28
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    Hey! Nice.. you're back! (Thought maybe lost you to being out skating!)

    I'll try that in a few hours.. I'll be off of work and home at that time.

    Thanks!


    Stay tuned!

  9. #29
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    OK.. so to re-cap:

    1.) I am using an RPi 3B

    2.) I tried BOTH Putty configurations you posted above.. and BOTH of the windows populate with the test being sent from my Arduino.

    So that means its a FLASH security issue?

    How can I go about fixing that? Where is it stemming from?

    * is this a missing file that needs to be in place somewhere?
    * is this a setting somewhere?

  10. #30
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,020
    ok so select the location of your swf like so and refresh page to connect, now the security is stored in your computers memory for offline use.
    https://www.macromedia.com/support/d...manager04.html
    you want to make a hypocrite out of everythinggg zomg

  11. #31
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I already did that when you mentioned it previously..

    When adding it on the RPi however.. it does not give the full path.. but:

    ///0/index.swf


    I even edited it to be:

    /var/www/html/index.swf as well

    still can not connect.

  12. #32
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,020
    take the path from opening index.swf from browser search bar, Probably needs a drive letter infront, im going to turn on my pi right now one sec.
    Last edited by Alloy Bacon; 02-06-2019 at 12:11 AM.
    you want to make a hypocrite out of everythinggg zomg

  13. #33
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I already did that when you mentioned it previously..

    When adding it on the RPi however.. it does not give the full path.. but:

    ///0/index.swf


    I even edited it to be:

    /var/www/html/index.swf as well

    still can not connect.


    I boot RPi
    I run this line:
    Code:
    socat -d -d -d -d -x TCP-LISTEN:7777,reuseaddr,fork FILE:/dev/ttyUSB0,b9600,raw
    I then open a browser (Chromium) and go to localhost (or 127.0.0.1).. and my page loads, the flash app loads...the camera starts... and then 'not connected' again displays on the screen.. (instead of connected)..

    I appreciate you helping this far..

    Frustrating to feel like I'm 'close'.. but it just wont work. HAHA

  14. #34
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,020
    ok this is a proper file path if you are logged in as root, im on a orange pi (rpi install would take to long right now)

    put index.swf in your desktop

    file path to desktop logged in as root:

    file:///root/Desktop/index.swf
    Last edited by Alloy Bacon; 02-06-2019 at 12:44 AM.
    you want to make a hypocrite out of everythinggg zomg

  15. #35

  16. #36
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    Quote Originally Posted by Alloy Bacon View Post
    ok this is a proper file path if you are logged in as root, im on a orange pi (rpi install would take to long right now)

    put index.swf in your desktop

    file path to desktop logged in as root:

    file:///root/Desktop/index.swf
    but I need it to be in my LAMP directory to run with PHP and other files..

    Which is currently..
    /var/www/html/index.html


    but if using 'file:/// is valid.. I'll add that as I removed it previously..


    My current desktop path is:

    file:///home/pi/desktop/index.html

  17. #37
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,020
    file:///var/www/html/index.swf
    you want to make a hypocrite out of everythinggg zomg

  18. #38
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,020
    ok tomorrow if I have time I will access my rpi, if the macromedia site wont do, you can always just host a local policy server for port 843 via perl on the same rp.
    you want to make a hypocrite out of everythinggg zomg

  19. #39
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I moved a copy of the .swf and .html file to my desktop..

    added the path of:
    file:///home/pi/desktop/index.html


    to the global security settings/link (Macromeida)..

    refreshed.. and still -not connected- error..

    grrr! I need (want) to wrap up this small step, so I can finish wrapping up the other tasks.. (more code... making several new PCB's. and code for them as well)...

    its like a tease right now! HAHA

    Anyways.. thanks again.

  20. #40
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    Quote Originally Posted by Alloy Bacon View Post
    ok tomorrow if I have time I will access my rpi, if the macromedia site wont do, you can always just host a local policy server for port 843 via perl on the same rp.
    cool.. let me know if you get to it. I'll be messing around until then! LOL

    This is different than needing a crossdomain policy...correct?

    I read a little about the 843 port checking... but didnt quite understand it all...

    I know ZERO % PERL, so I'm hoping to just get this squared away normally

    You didnt have to use a PERL hack to get things going on your RPi did you?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center