Go to Post Engineering literature? Is that like jumbo shrimp, military intelligence, or legal brief? You know, an oxymoron? - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 15-01-2016, 22:31
AndyB871 AndyB871 is offline
Registered User
FRC #0871
 
Join Date: Jan 2012
Location: East Islip
Posts: 37
AndyB871 has a spectacular aura aboutAndyB871 has a spectacular aura aboutAndyB871 has a spectacular aura about
Java SerialPort kUsb

We're attempting to use an arduino as a controller for neopixels on our robot. We figured we'd use the USB/Serial option to send our commands. So long story short, when we create a SerialPort using kUSB, we can call writeString() exactly once, and then the robot code crashes. We've verified that the command gets to the arduino properly too. The test project was a clean project created with the New Project -> Iterative Robot template. It contains no code at all except the declaration of the SerialPort, the object creation in robotInit, and a single call to writeString() wrapped in an if statement checking for the A button of an Xbox Controller.

The code runs happily until you tap the A button, at which point the Arduino gets that one command, does the right thing, then the robot code hangs for a few seconds, finally crashes, and restarts. The RoboRIO is just fine, as an SSH connection stayed up, just the java robot code died.

We don't have internet access at the school and I dont have the driver station at home with me so I cant copy-pate the exception (Maybe I'll try using my phone as a hotspot tomorrow?), but it eventually boils down to a VISA exception.

We attempted to switch to the onboard RS232, and while the arduino never received the command (Most likely because we had to cobble together a cable, and we werent sure if it needed to be a straight through, or cross-over) The robot code never crashed.

Has anyone seen anything like this? We could probably switch to the RS232 if we have no success, but we're going to need power from the USB anyway, so we might as well not be wasteful. Besides, Not getting a serial connection to work? I'm taking that personally!

Edit::
Error Cap

ERROR Unhandled exception: java.lang.RuntimeException: Code: -1073807339. Unknown error status at [edu.wpi.first.wpilibj.hal.SerialPortJNI.serialWrit e(Native Method), edu.wpi.first.wpilibj.SerialPort.write(SerialPort. java:356), edu.wpi.first.wpilibj.SerialPort.writeString(Seria lPort.java:366), org.usfirst.frc.team871.robot.Robot.teleopPeriodic (Robot.java:55), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:143), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:241)]


Edit 2:

After several hours of experimentation (with a second roborio, loaded with a fresh image and JDK downloaded from the internets) we still have the same result. You get one successful writeString() (successful, meaning the arduino gets the command) followed by a few second halt, followed by a robot code crash and restart. I really hope someone else can reproduce this issue to get some more brains on the problem.

Last edited by AndyB871 : 16-01-2016 at 21:48.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:24.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi