BUG Community

Welcome! Log In

Forums Java App layer (Java) access to Handylink serial terminal on base

Subscribe to App layer (Java) access to Handylink serial terminal on base  19 posts, 9 voices

Log in to reply to this topic
 
May 15, 2008 12:27pm
Medium Bug Labs team jconnolly 285 posts

Chuck asked a good question yesterday in our IRC channel about getting programmatic access to the comm port on your bug.

if using the handylink connection to DB9 serial cable, if you plug that into the BugBASE do you get a serial comm device which you can call with Connection cc = Connector.open("comm:0;baudrate=9000"); from the Microedition Connection??

Are there any drivers that would need to be installed first?
Looking to use : javax.microedition.io.CommConnection;


The baud rate is 115200 default, and you can set the dev node as part of the system properties, which can be set on the fly:

System.setProperty("microedition.commports", "/dev/ttymxc/4")

then using the code:

Connector.open("comm:/dev/ttymxc/4;baudrate=115200")

More information from the phoneME documentation page here:

http://java.sun.com/javame/reference/apis/jsr216/javax/microedition/io/CommConnection.html
May 15, 2008 12:32pm
Medium Bug Labs team jconnolly 285 posts

Actually, now that I've tested it, it doesn't work.

here's my code:
public void doStart() {
System.out.println("CommCheckerServiceTracker: start");


System.setProperty("microedition.commports", "/dev/ttymxc/4");

String port1;
String ports = System.getProperty("microedition.commports");
System.out.println("ports: "+ports);
int comma = ports.indexOf(',');
if (comma > 0) {
// Parse the first port from the available ports list.
port1 = ports.substring(0, comma);
} else {
// Only one serial port available.
port1 =ports;
}

try {
CommConnection cc = (CommConnection) Connector
.open("comm:"+port1+";baudrate=115200");

InputStream is = cc.openInputStream();
OutputStream os = cc.openOutputStream();
int ch = 0;
while(ch != 'Z') {
os.write(ch);
ch = is.read();
ch++;
}
is.close();
os.close();
cc.close();

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}


It results in the following output + exception (in /var/log/concierge.log):

CommCheckerServiceTracker: start
ports: /dev/ttymxc/4
javax.microedition.io.ConnectionNotFoundException: The requested protocol does not exist /dev/ttymxc/4;baudrate=115200
at com.sun.cdc.io.InternalConnectorImpl.open(Unknown Source)
at javax.microedition.io.Connector.open(Unknown Source)
at javax.microedition.io.Connector.open(Unknown Source)
at javax.microedition.io.Connector.open(Unknown Source)
at commchecker.servicetracker.CommCheckerServiceTracker.doStart(Unknown Source)
at com.buglabs.application.AbstractServiceTracker.addingService(Unknown Source)
at org.osgi.util.tracker.ServiceTracker$Tracked.track(Unknown Source)
at org.osgi.util.tracker.ServiceTracker.open(Unknown Source)
at commchecker.Activator.start(Unknown Source)
at ch.ethz.iks.concierge.framework.BundleImpl.startBundle(Unknown Source)
at ch.ethz.iks.concierge.framework.BundleImpl.start(Unknown Source)
at com.buglabs.bug.program.UserAppManager.startApp(Unknown Source)
at com.buglabs.bug.program.UserAppManager.processQueue(Unknown Source)
at com.buglabs.bug.program.UserAppManager.run(Unknown Source)
at com.buglabs.bug.program.ProgramServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(Unknown Source)
at com.buglabs.osgi.http.HttpServer.processRequest(Unknown Source)
at com.buglabs.osgi.http.HttpServer.run(Unknown Source)
at java.lang.Thread.startup(Unknown Source)



I'll look into it further, but I've already tried to use the default VM microedition.commports (/dev/ttyS0) and created a symlink to /dev/ttymxc/4 but I get the analogous exception.
May 15, 2008 11:14pm
Medium cdraptor 25 posts

John

Here is something simple to try is just echo out to /dev/ttymxc/4 to make sure your able to send simple asci via serial.

Hook up a PC to the BugBASE over the serial, run a terminal app and root into the Bug and see if you can just do

echo "test" > /dev/ttymxc/4. This would at least make sure the device is working correctly as a serial interface

I should get my bug tomorrow so I’ll start messing around as well – gotta take control of my SSC-32 servo board

May 16, 2008 10:31am
Medium Bug Labs team jconnolly 285 posts

cdraptor
John

Here is something simple to try is just echo out to /dev/ttymxc/4 to make sure your able to send simple asci via serial.

Hook up a PC to the BugBASE over the serial, run a terminal app and root into the Bug and see if you can just do

echo "test" > /dev/ttymxc/4. This would at least make sure the device is working correctly as a serial interface

I should get my bug tomorrow so I'll start messing around as well - gotta take control of my SSC-32 servo board


Chuck,

that's what I usually do first... on the host system:

cat /dev/ttyUSB0 (or whatever your serial dev node is, in my case it's a serial/usb adapter and a virtual serial node).

and on the BUG:

echo "this is a test" > /dev/ttymxc/4

However, the problem I was describing above has more to do with what java expects for the protocol. I'm looking at this now:

http://forum.java.sun.com/thread.jspa?threadID=5279224&tstart=0
May 16, 2008 10:36am
Medium Bug Labs team jconnolly 285 posts

'm looking at this now:

http://forum.java.sun.com/thread.jspa?threadID=5279224&tstart=0


This is much more informative, from Hinkmond, working with phoneME:

http://forums.java.net/jive/thread.jspa?threadID=38484&tstart=0
May 16, 2008 10:54am
Medium Bug Labs team jconnolly 285 posts

jconnolly
'm looking at this now:

http://forum.java.sun.com/thread.jspa?threadID=5279224&tstart=0


This is much more informative, from Hinkmond, working with phoneME:

http://forums.java.net/jive/thread.jspa?threadID=38484&tstart=0


Chuck,

From the forum post on dev.java it looks like serial support must be enabled at compile time. I'll talk to our development team about enabling it by default on R1.2 of the rootfs (and phoneME) build, which is scheduled for release around the end of the month.
May 16, 2008 4:46pm
Medium Bug Labs team jconnolly 285 posts

Chuck,

I've posted an enhancement request on bugzilla


http://bugcommunity.com/bugzilla/show_bug.cgi?id=180

I'm hoping this will be part of a new rootfs release, but I would encourage you to try building the rootfs yourself. We'll be posting some detailed instructions on how to do this soon as well.

Let me know what types of operations you're looking to use and we can try to work with emulation until the build instructions or rootfs are up.
May 16, 2008 10:30pm
Medium cdraptor 25 posts

John

Thanks for all the work you have done looking into this. I will keep an eye out for the R1.2 build – now that I know how to setup the FS on the MMC that will be easy to add in.

I may mess with building the rootfs myself. I just got the bug tonight so going to make sure all is working.

Thanks again

May 27, 2008 10:23pm
Medium cdraptor 25 posts

Hey John, just wondering is the modification to provide serial access going to be in R1.2??

May 28, 2008 11:57am
Medium Bug Labs team jconnolly 285 posts

cdraptor
Hey John, just wondering is the modification to provide serial access going to be in R1.2??


Chuck,

phoneME serial support has been incorporated as part of the latest Release Candidate. If all goes well (i.e. enabling serial support doesn't break anything else), it will end up in our R1.2 Rootfs. I'll keep you posted.
Jul 24, 2008 11:41am
Medium Bug Labs team kschultz 107 posts

Did anyone have success down this road? What about the rxtx library as opposed to javax.comm?

Jul 28, 2008 9:38pm
Medium Bug Labs team jconnolly 285 posts

kschultz
Did anyone have success down this road? What about the rxtx library as opposed to javax.comm?


I'm going to take a look at this tomorrow. Everything compiles with javax.comm, and I got so far as to test that you can use the serial device at the app layer... actual communication though, not yet... One way to test is to send your app to the BUG that just sends junk over the serial connection, and on the host just cat /dev/ttyS0 (or in our case, because we use a serial to USB adapter, cat /dev/ttyUSB0)...
Jul 28, 2008 10:54pm
Medium Bug Labs team kschultz 107 posts

I used the RxTx library rather than javax.comm, but it didn’t seem to go on the BUG, I think I had the wrong binary for our ARM. We should look at it tomorrow.

Oct 28, 2008 10:12am
Img_missing_medium franck 3 posts

Hi,

Have you check that RXTX (namespace gnu.io) is on the BUG

I soon need it..

Regards

Aug 14, 2012 2:09am
User_img_not_found_06_med rubing 103 posts

Isn’t it funny how we www.coachfactorystoreec.com/ Coach Factory Store always want what we can’t have? The girl with the round and pert backside wishes that her rear were 5 times smaller. Meanwhile, the girl with the non existent posterior wishes to achieve a larger butt. Well, if the grass is greener on the other side, just water yours! If you’ve got a small behind, you can create the illusion of a larger one with butt enhancing jeans. Here’s how to do it. Look for light weight denim – This material is very stiff and heavy. If you try to stuff a flat butt into denim jeans, it will only create a flatter looking behind. A little stretch goes a long way – Your butt enhancing jeans should additionally contain some stretch. A mixture of 98 percent cotton and 2 percent lycra is best. This combination of lycra and cotton, especially when it’s in a nice tight-weave fabric that’s fitted through the hip and thigh area will help lift your buttocks. Too much lycra and your jeans may start to ripple like a pair of leggings. If there’s not enough cotton content, there won’t be enough structure to hold you up. It’s all in the pockets – The most effective trick for creating the illusion of a bigger butt is to choose jeans with flap pockets. The added bulk of the flap will enhance and add dimension to your tiny tush. True Religion is notoriously famous for their flap pocket designs. You can also try Hudson, Rock & Republic, Frankie B and Paige for addition flap pocket styles. Pocket placement – If you’re not a fan of flap pockets, or if you’ve already bought too many of them, you can also try denim with regular pockets. Be sure to aim for a pair with smaller pockets that sit higher and this will help make your rear look lifted. Cut is also important – Look for jeans with a slight tapering at www.coachfactoryonliness.com/ Coach Factory Online the knee, such as a straight leg or skinny style. This cut will make your bum look a bit larger in comparison to the rest of your body. Great styles to try are True Religion Billy, Julie or Stella, Siwy Harmah or Rose, and Hudson Emily or Paige. How low can you go – Actually, you don’t want to go too low when it comes to the jean rise. The goal is to project more, not less. A pair of low rise denim will only reduce the size of your rear. Instead, opt for a pair with a medium rise. Color me right – Since dark colors minimize, dark denim and indigo will create a slimming effect. You do not want this kind of effect on your barely there behind! Try to find light colored or medium blue denim. Grey is very flattering and will also work. Like a great bra, butt enhancing jeans can also lift and www.coachfactoryoutletusa.com/ Coach Factory Outlet separate what little you have. So it wasn’t in your genes to have a nice, round bottom. Big deal. Be happy with what you’ve got and just improvise!

Oct 3, 2012 2:33am
User_img_not_found_02_med wunai 103 posts

Thanks to the answers was possible to Tods shoes evaluate the intensity of use and the question of the distinction in purchasing. Women need a bag to carry their belongings, that’s for sure. Leather bags, women nowTods UK  have the flexibility and class beyond what I ever thought. The serious fashion lovers will love the leather bags thanks to its versatility, high quality and elegant style. With brands like Tod tods women shoes, Cole Haan,Tods Outlet   Rebecca Minkoff, among many others, is nothing but leather bags and upscale beyond amazing. Hogan shoes outlet The design is based on a conceptLouis Vuitton UK of minimal interference between your feet and the floor.

Oct 24, 2012 1:36am
User_img_not_found_01_med qazqazqaz 469 posts

As a perfect combination of classic and modern fashion,Coach Outlet Online Julia Bags can show the customers'unique personality.Tiffany UK grabbed the globe, stands out as the celeb on their favorite stars luxury type, granted an innovative simple move the pavement luxury, complete with luxury.In terms of the quality and superior design that make more and more customers are satisfied to Coach Factory Online.Welcome!hat experts claim Coach Outlet Online shopping is in the changes they are available in.As long as you open our Coach Factory Outlet webpage, you will view various Coach New Arrivals which are the most popular also the most fashionable in this year.On the date when the Louis Vuitton UK on sale, all people will pour into the stores. At this time, it on the booths will be wiped out, and only one or two days the seller will declare that there is no stock anymore.

Nov 1, 2012 1:06am
User_img_not_found_04_med wangly 62 posts

that she stole from then boyfriend Alexander Stategos.Man Sues Philly Strip Club
for for moncler down
jackets
for Bladder Rupture from Pole DanceMan Says Pole Dancer
Fell, His Bladder to RuptureBy COLLEEN CURRYOct. 5, 2012— A bachelor bachelor
replica designer handbags
bachelor party celebration at a Philadelphia strip club turned painfully for
Patrick Gallagher, who says his bladder was ruptured while while

cheap replica designer
handbags

while participating in a pole dance on stage.Gallagher, of
Lansdale, filed a lawsuit in Philadelphia’s Court of Common Plea last last knockoff handbags last week, alleging
that a dancer at the Penthouse Club him serious injury, including a ruptured
bladder, when she fell fell

Nov 19, 2012 1:43am
User_img_not_found_01_med fakeoakley 28 posts

Ideal for trekking or cycling, this discount north face combines extreme breathability and durable wind protection with minimum weight and pack volume. Eco-friendly north face black friday has the same great look and function; including abrasion-resistant
panels on the torso, shoulders, and elbows that withstands loads of use
year after year. Unlike other brand,
north face cyber monday mainly display the fashionable, leisure,movement and personalized. An all-around
cyber monday north face for cold weather excursions, this straight-forward
black friday north face offers extreme comfort and protection in nature’s harsh conditions.

Log in to reply to this topic
Forums Java App layer (Java) access to Handylink serial terminal on base

Powered by Community Engine

Top
Login
Close
Bottom