Total members 9951 | Gratitudes |It is currently Sat Feb 11, 2012 10:57 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 12 posts ]  Go to page 1, 2  Next
Author Question
 Question subject: How to connect to serial port using java
PostPosted: Sat Jun 30, 2007 5:27 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 56 time

This is the code of connecting to serial port and writing streams and reading from it :gOOd: .This project was already exists on some page . What i did new is changing the GUI to javax.swing .Here in this project you choose a file to send using JFileChooser Dialog. You can then save it at the receiver.I have to say something that sun have a package called java.comm is used for communication .but i found it only for linux and solary .I didn't find version for windows.So i used native functions that is implemented in c/c++ language. I is also can be found with the project .
It is a netBeans project so you will find java codes in src folder .Just remmber to install netbeans to open this project or use java files that exists in src folder.


Attachments:
File comment: the netbeans project of it
serialport.rar [550.2 KiB]
Downloaded 8758 times

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Tue Nov 11, 2008 9:50 pm 
Offline
Newbie
User avatar

Joined: Tue Nov 11, 2008 9:34 pm
Posts: 1
Has thanked: 0 time
Have thanks: 0 time
The link to the serialport.rar file is broken.
Is the file still available?
Thanks


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Wed Nov 12, 2008 11:08 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 56 time
codemiles123 wrote:
The link to the serialport.rar file is broken.
Is the file still available?
Thanks



check the link , again , :wink:

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Mon Sep 14, 2009 11:55 pm 
Offline
Newbie
User avatar

Joined: Mon Sep 14, 2009 11:51 pm
Posts: 3
Has thanked: 0 time
Have thanks: 0 time
I am getting the following error when I try to run the code in NetBeans 6.5. Anybody know how to fix this?

Initing NATIVE port. Com = \\.\com1, baud = 9600
###ERROR: You can't get input stream because serial port wasn't opened
###ERROR: You can't get input stream because serial port wasn't opened
###ERROR: Couldn't open requested port
preferences file 'JavaTerm.pref' not found / didn't open or there was a problem opening serial port. Searching for serial port
Initing NATIVE port. Com = \\.\com1, baud = 9600
###ERROR: You can't get input stream because serial port wasn't opened
###ERROR: You can't get input stream because serial port wasn't opened
###ERROR: Couldn't open requested port
Initing NATIVE port. Com = \\.\com2, baud = 9600
###ERROR: You can't get input stream because serial port wasn't opened
###ERROR: You can't get input stream because serial port wasn't opened
###ERROR: Couldn't open requested port
Couldn't open any serial ports

Thanks for the help.


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Tue Sep 15, 2009 8:19 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 56 time
i think you have problem with your ports configurations .

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Tue Sep 15, 2009 8:03 pm 
Offline
Newbie
User avatar

Joined: Mon Sep 14, 2009 11:51 pm
Posts: 3
Has thanked: 0 time
Have thanks: 0 time
So are you saying that this is more of a computer problem than a java problem?? Or is there someway to fix this in the code.


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Wed Sep 16, 2009 2:08 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 56 time
Yes , because this is what think ! Are you sure that your serial ports are working correctly .

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Wed Sep 16, 2009 8:24 pm 
Offline
Newbie
User avatar

Joined: Mon Sep 14, 2009 11:51 pm
Posts: 3
Has thanked: 0 time
Have thanks: 0 time
I have used them with other programs and they work fine.


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Sat Oct 03, 2009 12:44 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2103
Location: Earth
Has thanked: 39 time
Have thanks: 56 time
Does it works now. ? Am just concerned to find the actual problem.

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: How to connect to serial port using java
PostPosted: Thu Aug 19, 2010 9:03 pm 
Offline
Newbie
User avatar

Joined: Thu Aug 19, 2010 9:01 pm
Posts: 1
Has thanked: 0 time
Have thanks: 0 time
I have the same problem: I can connect to my device in vb.net, with you program I cannot. Port settings are correct


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 12 posts ]  Go to page 1, 2  Next
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 Java seminar topic with demo  Java  Anonymous  1
 java project code  Java  Anonymous  0
 change Font of text in java  Java examples  msi_333  1
 Read your gmail using Java code  Java examples  msi_333  5
 project source code in java  Java  Anonymous  0

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 3 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team