Shop OBEX P1 Docs P2 Docs Learn Events
How to connect ONE comport to another one port — Parallax Forums

How to connect ONE comport to another one port

KingtutsKingtuts Posts: 6
edited 2014-04-17 08:52 in General Discussion
Hi I have a problem, I have an RFID USB version and I am trying to connect it with a Parallax BS2 rev J module/ micrcontroller. Of course this cant be done very easily, unless some one knows a cheap method (besides buying an Serial RFID version). I was told that one could connect these two devices with the proper USB host, which at the moment is my laptop. But in order for this to work I need to connect the com ports. I downloaded Com Port Redirector. 4.3.0.3 by Lantronix, and Im not sure what to do next. Some guidance would be appreciated.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-16 14:22
    Which RFID reader do you have? Is it this one? You might be able to use use your laptop as a bridge to the BS2 but I'll need to let someone else help you with how to do this.

    Whoever is going to help you will need to know which reader you're using.

    Edit: I just noticed you also asked this question in the Basic Stamp forum. It's against forum rules to cross post.
  • KingtutsKingtuts Posts: 6
    edited 2014-04-16 14:44
    Yes its that one, and thanks for getting someone to help me. Oh yeah sorry about the cross posting, didnt know.
  • Mike GMike G Posts: 2,702
    edited 2014-04-16 15:04
    I'm not familiar with COM Port redirector but the product brief implies the software is designed for serial to Ethernet. I did not see anything that mentioned serial port to serial port redirection which is what you need to connect the BS2 to the RFID reader through a laptop.

    However, you could create your own COM port redirector in the language of your choice. I'd start with the VB.NET sample application referenced in the RFID manual. Get the VB.NET/PC wired up to the RFID and verified. Then modify the VB.NET app to accept commands from the COM port rather than the GUI.
  • GenetixGenetix Posts: 1,754
    edited 2014-04-16 15:53
    Save yourself the trouble and try exchanging your USB module for a Serial module.
    If you can't exchange it then try getting a refund so you can purchase the Serial module.
    Where did you purchase it from and do you still have your receipt?
  • Mike GMike G Posts: 2,702
    edited 2014-04-16 16:05
    Agreed, a serial RFID reader is a better match for a BS2. It's certainly possible to use a laptop as a pass-through but that makes for a bulky complex setup.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-16 16:13
    I'm a big fan of Parallax and Joe Grand is one of my idols but if you're going to buy a new RFID reader, you might want to check out the inexpensive MIFARE readers on ebay.

    Still give Parallax money but instead of buying the RFID reader buy a Propeller board and use it to read from the inexpensive RFID readers.

    You could even have the Propeller send the data over serial to the BS2 if you wanted it to (I know someone who could help you with the Propeller code).
  • KingtutsKingtuts Posts: 6
    edited 2014-04-16 16:59
    Unfortunately I need to get this RFID working with my microntroller ASAP, my deadline is tomorrow morning. Threre are no local vendors that have the serial RFIDs available. Even one day shipping isnt an option for several of the companies I contacted. As of right now Im still downloading the Visual Basic Software(wifi was down), and still am not too sure how to modify the program to my specifications for having the USB RFID and Microntoller communicate with each other.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-04-16 19:42
    If you are out of time, I would consider figuring out how to do what Mike G mentioned in post #4.
  • xanaduxanadu Posts: 3,347
    edited 2014-04-16 20:46
    Lol, I never thought I'd say this again, but you need a null modem. http://com0com.sourceforge.net/
  • KingtutsKingtuts Posts: 6
    edited 2014-04-16 20:59
    " I'd start with the VB.NET sample application referenced in the RFID manual. Get the VB.NET/PC wired up to the RFID and verified. Then modify the VB.NET app to accept commands from the COM port rather than the GUI." is the null modem needed to execute this (above)?

  • GenetixGenetix Posts: 1,754
    edited 2014-04-16 22:13
    Null modems are used to connect serial devices together.
  • xanaduxanadu Posts: 3,347
    edited 2014-04-16 22:20
    They are all ways to create a virtual com port, if you dig into one long enough it should work fine.
  • xanaduxanadu Posts: 3,347
    edited 2014-04-16 22:27
    What OS are you using?

    Pleas post it here, others may benefit from this, which is what keeps the forum wheel turning. I can get you past the driver signing issues.
  • xanaduxanadu Posts: 3,347
    edited 2014-04-16 22:44
    I'm prepping a night dive, I'll check in tomorrow.
  • Mike GMike G Posts: 2,702
    edited 2014-04-17 03:41
    The null modem emulator, as described in the link on post #10, looks like it would work.
    Unfortunately I need to get this RFID working with my microntroller ASAP, my deadline is tomorrow morning.
    This project is in my wheelhouse and I'd have a pretty hard time putting together a proof of concept in a single evening. I hope you got it working...
  • KingtutsKingtuts Posts: 6
    edited 2014-04-17 04:30
    Well I thought the null modem emulator would work, but the two ports (COM4 &5) I want to bridge cant be bridged. I get this message " The port name COM4 is already logged as "in use" in the COM port data base". I get the same message for COM5 as well. I am using WIndows 8.
  • KingtutsKingtuts Posts: 6
    edited 2014-04-17 04:36
    I went to this site, when half way into the process my computer wouldnt give me full control permission of the FTDIBUS.


    http://www.ftdichip.com/Support/Documents/AppNotes/AN_132_Re-Assigning_COM_Port_Numbers_Using_Registry.pdf
  • Mike GMike G Posts: 2,702
    edited 2014-04-17 05:59
    IMO, it's would be a lot easier to either bolt a serial port on the VB app as suggested in post 4 or build your own serial port pass-through.

    In .NET world instantiate two serial ports, 4 and 5, using a console application. In the Data_Received event of COM4 do a write to COM5. On Data_Received in COM 5 to a write to COM4. I imagine it's no more than 20 lines of code if even that. This solution depends on the BS2 code functioning properly and the USB RFID and Serial RFID use the same protocol.
  • Mike GreenMike Green Posts: 23,101
    edited 2014-04-17 08:52
    I don't think Com Port Redirector will do what you want. It's designed to let you access a com port on one PC from another PC via the internet and make that remote com port look like a local virtual com port (one not attached directly to hardware). You would need to write a program in some language (Visual Basic would do) that simply opens two com ports, one for the RFID and one for the BS2, and copies data from each to the other as the data arrives. I don't know of any ready-made program to do this and I don't have a Windows PC. Perhaps someone else might help you there.

    If you had one on hand, you could use Parallax's Memory Stick Datalogger to act as a USB host for the RFID reader and that could be controlled by the BS2.
Sign In or Register to comment.