Shop OBEX P1 Docs P2 Docs Learn Events
Help! Cannot see com1 — Parallax Forums

Help! Cannot see com1

hacktorioushacktorious Posts: 72
edited 2008-01-05 05:37 in Robotics
I have connected my boe-bot to my PC via a USB to Serial Adapter:
parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/List/1/ProductID/378/Default.aspx?txtSearch=usb+to+serial+adapter&SortField=ProductName%2cProductName

I am attempting to run some java code to communicate with my boe-bot. However, it appears as I don't have a comport installed. It does show up in the device manager in windows.

I am running windows vista.

Here is the java code:

package robot;

import java.util.Enumeration;

import javax.comm.CommPort;
import javax.comm.CommPortIdentifier;
import javax.comm.PortInUseException;

public class ListOpenPorts {

private CommPortIdentifier portId;
private Enumeration portList;

public ListOpenPorts() {
portList = CommPortIdentifier.getPortIdentifiers();
}

public void list() throws InterruptedException, PortInUseException {

while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
System.out.print("Serial Port = ");
}
if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
System.out.print("Parallel Port = ");
}
System.out.print(portId.getName() + ", ");

CommPort port = portId.open("OpenTest", 20);
Thread.sleep(250);
System.out.println("Opened." + portId.getCurrentOwner());
port.close();
}
}

public static void main(String[noparse]/noparse args) {

try {
ListOpenPorts openPorts = new ListOpenPorts();
openPorts.list();
} catch (InterruptedException ie) {
System.out.println("Unable to sleep.");
} catch (PortInUseException pe) {
System.out.println("Failed. Port In Use.");
}

}
}

I am not getting an error; the print statements are not printing data. This tells me something isn't right with the adapter.

Has anyone in this forum had issues with this? Does anyone have some advice on how I can go about troubleshooting this issue? Thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Scott
If man made it, don't eat it!
Never under estimate the wisdom of nature!
www.POISONINGaNATION.com

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-01-04 05:00
    Hi Scott, did you install the latest FTDI drivers.

    Jeff T.
  • hacktorioushacktorious Posts: 72
    edited 2008-01-04 05:06
    yes

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Scott
    If man made it, don't eat it!
    Never under estimate the wisdom of nature!
    www.POISONINGaNATION.com
  • Paul Sr.Paul Sr. Posts: 435
    edited 2008-01-04 13:27
    Does the Stamp Editor recognize the Stamp?
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-01-04 15:11
    Better yet, on which PORT does the IDE recognize the stamp?
  • Paul Sr.Paul Sr. Posts: 435
    edited 2008-01-04 17:32
    allanlane5 said...
    Better yet, on which PORT does the IDE recognize the stamp?

    One step at a time!!
  • hacktorioushacktorious Posts: 72
    edited 2008-01-05 02:01
    Yes, it sees it on COM1.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Scott
    If man made it, don't eat it!
    Never under estimate the wisdom of nature!
    www.POISONINGaNATION.com
  • FranklinFranklin Posts: 4,747
    edited 2008-01-05 02:30
    So, did that solve your problem? (can't see com1)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • hacktorioushacktorious Posts: 72
    edited 2008-01-05 02:37
    Nope!

    I am reviewing the java comm installation for windows to make sure I didn't miss anything.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Scott
    If man made it, don't eat it!
    Never under estimate the wisdom of nature!
    www.POISONINGaNATION.com
  • FranklinFranklin Posts: 4,747
    edited 2008-01-05 03:07
    OK, so you can program the stamp OK but not use java to communicate with it? Can you write a small java app that will just tell you what it finds for ports? Not being a java person I can't tell if that is what your included program did or not, sorry. Also can you look in the device manager and see what you have in the ports and the universal serial bus controllers? You should have a USB serial converter device and a USB serial port (COMx). Also make sure you have the correct drivers for the adapter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • hacktorioushacktorious Posts: 72
    edited 2008-01-05 03:11
    Yeah, I think my installation is messed up.

    This is from the directions:
    # Copy javax.comm.properties to your <JDK>\lib directory.

    C:\>copy c:\commapi\javax.comm.properties c:\jdk1.1.6\lib

    The javax.comm.properties file must be installed. If it is not, no ports will be found by the system.

    I did this, but I don't think it is seeing the properties file.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Scott
    If man made it, don't eat it!
    Never under estimate the wisdom of nature!
    www.POISONINGaNATION.com
  • hacktorioushacktorious Posts: 72
    edited 2008-01-05 04:47
    ports and the universal serial bus controllers has the following:
    USB Serial Converter

    Under Ports I have the following:
    USB Serial Port (COM1)

    I am attempting to run a sample java file (BlackBox) written by Sun to find com ports. I am getting the following message:
    No serial ports found!

    The javax.comm.properties file is in the correct location so I am almost 100% certain this is not the cause.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Scott
    If man made it, don't eat it!
    Never under estimate the wisdom of nature!
    www.POISONINGaNATION.com
  • hacktorioushacktorious Posts: 72
    edited 2008-01-05 05:37
    OK, I finally figured it out. There are multiple lib and bin directories within the Java directory structure. The properties file needed to be put into the bin folder in within the jre folder within the JDK folder. What a pain in the neck. Well, at least it is solved for now. Thanks for your help everyone.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Scott
    If man made it, don't eat it!
    Never under estimate the wisdom of nature!
    www.POISONINGaNATION.com
Sign In or Register to comment.