Pages: [1] 2 3 ... 7   Go Down
Author Topic: RFID Video Daemon  (Read 3976 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
2b/!2b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Everyone,

I have my Arduino board and RFID reader, they work fine with the code used from the library. Found here: http://www.arduino.cc/playground/Learning/PRFID

What I want to do is run a video when the user hovers a tag over the RFID reader, at the moment it just displays the tag's code being read.

I believe I need to use serproxy to allow communication between the board and computer.

I'm scared to change the code on the board and make the RFID reader stop working.

This all seems rather difficult for such a simple task.

Is there an easier way of producing this result?

Help?
« Last Edit: April 06, 2011, 10:27:23 pm by 4kingrich » Logged

0
Offline Offline
Shannon Member
****
Karma: 117
Posts: 10106
:(){:|:&};: TOX id: fcb8e918bef08581e23f6ddf9d4dba77697c25b217bf372736ed959a95fde36df5b8c5b90fbb
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

in witch video the code is showed? arduino can't support graphics over game-boy like

you don't need serproxy, you can use the serial connection and on the PC a program that read the code and play the right video
Logged

my Arduino code: https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
2b/!2b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lesto, thanks for your reply!

I didn't know arduino would communicate with the PC directly without serproxy to translate the data.


      if(bytesread == 10) {              // if 10 digit read is complete
        Serial.print("TAG code is: ");   // possibly a good TAG
        Serial.println(code);            // print the TAG code
      }


Instead of Serial.println(code); I would like to do something similar to Open.file(video.mpeg);

I hope this makes more sense, I tried using flash as the program that runs the video but it gets very complicated.

Thanks again.

(the board is constantly connected to the PC)
Logged

0
Offline Offline
Shannon Member
****
Karma: 117
Posts: 10106
:(){:|:&};: TOX id: fcb8e918bef08581e23f6ddf9d4dba77697c25b217bf372736ed959a95fde36df5b8c5b90fbb
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry, but the player program is on your pc, so no way..
You have to write a driver (a program) that listen the code from the serial and execute the Open.file(video.mpeg);

at least arduino can send not the code but directly the video's name.

With processing this is very simple
Logged

my Arduino code: https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
2b/!2b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lesto, I understand what you mean but have no idea how to go about doing it.

The arduino returns the video name to the driver that executes the file, would that be right?

Thanks again.
Logged

0
Offline Offline
Shannon Member
****
Karma: 117
Posts: 10106
:(){:|:&};: TOX id: fcb8e918bef08581e23f6ddf9d4dba77697c25b217bf372736ed959a95fde36df5b8c5b90fbb
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, the "driver" is just a little program that run in background listening the serial or whatever... in unix is called "daemon"
Logged

my Arduino code: https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
2b/!2b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the daemon written in?
 
I have been trying to use flash, I have tried using Firmata, I have tried using serproxy, they work to an extent but the thing that I want to do is a lot more basic than the examples that I am finding.

I have been following this tutorial:

http://www.arduino.cc/playground/Interfacing/Flash

As far as I know the serproxy is putting the arduino onto a network to allow communication. The RFID reader prints out when it works and I want flash or any daemon file to recognise that it has printed and play the video.

Why is it so hard?
Logged

0
Offline Offline
Shannon Member
****
Karma: 117
Posts: 10106
:(){:|:&};: TOX id: fcb8e918bef08581e23f6ddf9d4dba77697c25b217bf372736ed959a95fde36df5b8c5b90fbb
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

because flash can't read the serial, you have to use serproxy:
serproxy is a TCP and serial server. It reads the incoming connection from serial and output it in it's TCP stream, and vice-versa.

it IS a complication because a "missing" of flash.

try using java ( RXTX is the library for serial, it's the same used by arduino smiley )
Logged

my Arduino code: https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
2b/!2b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your reply, however still struggling.

Playing a video in java is hard enough, I would have to download and install JMF too?!

I'm not sure how to catch/use the arduino's output, only in the serial monitor.

I want it to graphically look good too.

Really don't understand why it is so complicated.

The ardiuno writes what I want it to over the serial but I dont know how to manipulate that data.
Logged

Portugal
Offline Offline
God Member
*****
Karma: 5
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Use Qt in Windows, Linux and Mac, its C and C++, or use GTK or Visual Studio, use a prgramming language and not that stupid Action Script, and 10 layers of interfaces just to use a serial port.
Logged

0
Offline Offline
Shannon Member
****
Karma: 117
Posts: 10106
:(){:|:&};: TOX id: fcb8e918bef08581e23f6ddf9d4dba77697c25b217bf372736ed959a95fde36df5b8c5b90fbb
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

every things can be done easily in processing: just use the right tool for the right work!!!
phase 1: acquire processing; http://processing.org/ it's gui is the same of arduino (or better, processing it's the father of arduino ide)
phase 2: read the serial http://processing.org/reference/libraries/serial/index.html (the library is included in IDE, so no problem)
phase 3: play the desired movie; http://processing.org/reference/libraries/video/index.html (again the library is included in IDE, so no problem)
phase 4: show your friends!!

@Senso:
I quote for "use a prgramming language and not that stupid Action Script, and 10 layers of interfaces just to use a serial port."
but is not good for a beginner "Use Qt". just my 5 cent
Logged

my Arduino code: https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
2b/!2b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am begginning to doubt this is even possible.

I don't have money to go out and purchase Visual Studio or any other software.

Even if i download qt or gtk i still don't know how to manipulate the signal and open a file.

I thought it was a simple idea but obviously not.

I'm also using windows.

Thanks for your advice, I am going to look for free software, and how to code the daemon.

I'm thinking the arduino uses Serial.Write("video.mpg"); and the Daemon captures it and loads it as a file, but How?

Any further advice would be highly appreciated.

Thank again.
Logged

0
Offline Offline
Shannon Member
****
Karma: 117
Posts: 10106
:(){:|:&};: TOX id: fcb8e918bef08581e23f6ddf9d4dba77697c25b217bf372736ed959a95fde36df5b8c5b90fbb
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

read my last post before surrender, it's really easy!
processing have many tutorial (also for arduino), with a bit of cut-paste and little programming skill it can be done
Logged

my Arduino code: https://github.com/lestofante/arduinoSketch
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
2b/!2b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lesto, your keeping my hopes strong.

I thought processing was arduino!

Some of them programs are difficult but i have used C++ and Java before, just not over serial.

Thank you so much!
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
2b/!2b
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quick update, I like Processing and the Library comes in very handy.

I have coded but haven't tested a program yet, I am exporting and opening the html files because I dont know how to open .jar or .java

There is a lot of duplicate functions that I have combined, not sure if this will ruin the process or not.

Will find out when I get to testing.

Thanks!

Do I still need to use serproxy and firmata with this setup???

The code is as follows: (so far)

Quote

import processing.serial.*;
import processing.video.*;

Serial myPort;
Movie myMovie;

void movieEvent(Movie m) {
  m.read();
}

void setup() {

  println(Serial.list());

  myPort = new Serial(this, Serial.list()[4], 9600);

  size(200, 200);
  myMovie = new Movie(this, "video.mpg");
  myMovie.play();
}

void draw() {
  while (myPort.available() > 0) {
    image(myMovie, 0, 0);
  }
}
Logged

Pages: [1] 2 3 ... 7   Go Up
Jump to: