Go to Post canadians are amazing.. - Ashley Christine [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-07-2009, 05:26 PM
aaeamdar2 aaeamdar2 is offline
Registered User
FRC #1893
 
Join Date: Nov 2009
Location: Baltimore
Posts: 9
aaeamdar2 is an unknown quantity at this point
Problem Loading Java Code

I'm experimenting with Java as a potential platform for programming in '10, but I've run into a block. Here's where I got:

Re-imaged my cRIO - however during re-imaging I just realized that I did NOT check “Format Controller” - anyone know if this is potentially the source of my problems?

Tried to load code. What happens when I load code is that it goes through the first few dozen steps, then gets to "rebooting your cRIO" and seems to get stuck (I've left it for 20+ minutes, came back, found no difference).

The "Getting Started With Java" pdf doesn't really give any troubleshooting - it just says press the run button to load code.

Any ideas?

(Yes I will be following several other routes to get this fixed including contacting a local beta team; I wanted to get this post out there to see what came up.)
Reply With Quote
  #2   Spotlight this post!  
Unread 12-07-2009, 06:14 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem Loading Java Code

I did the same thing. Re-run the new imaging tool and select Fromat controller.

The other issue I had was that I needed to set the team number in netbeans. You can find it in the Tools>Options>Misc.>FRC tab.

I still haven't gotten the debugger working, but I have our 2009 ported to Java and running perfectly on our old robot.
__________________
Eric Haskins KC9JVH
Reply With Quote
  #3   Spotlight this post!  
Unread 12-07-2009, 06:16 PM
aaeamdar2 aaeamdar2 is offline
Registered User
FRC #1893
 
Join Date: Nov 2009
Location: Baltimore
Posts: 9
aaeamdar2 is an unknown quantity at this point
Re: Problem Loading Java Code

When you say you did the same thing - do you mean that you had the same problem and that selecting "Format Controller" fixed it?

-P
Reply With Quote
  #4   Spotlight this post!  
Unread 12-07-2009, 06:18 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem Loading Java Code

Quote:
Originally Posted by aaeamdar2 View Post
When you say you did the same thing - do you mean that you had the same problem and that selecting "Format Controller" fixed it?

-P
I didn't select Format Controller, had the exact same issue, and re-imaging with Format Controller checked fixed it.
__________________
Eric Haskins KC9JVH
Reply With Quote
  #5   Spotlight this post!  
Unread 12-07-2009, 06:28 PM
aaeamdar2 aaeamdar2 is offline
Registered User
FRC #1893
 
Join Date: Nov 2009
Location: Baltimore
Posts: 9
aaeamdar2 is an unknown quantity at this point
Re: Problem Loading Java Code

Thanks, awesome, I'll definitely do that then. It was my next step. Shame I couldn't get Chief Delphi and be on site at the same time =(.
Reply With Quote
  #6   Spotlight this post!  
Unread 12-07-2009, 07:00 PM
Trevor_Decker's Avatar
Trevor_Decker Trevor_Decker is offline
Registered User
AKA: Trevor Decker
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: Pittsburgh
Posts: 42
Trevor_Decker is an unknown quantity at this point
Re: Problem Loading Java Code

Does any one know if their is a place to download the 2009 Crio Imaging tool?( I Am not sure where our teams copy of the 2009 software CD's are). Any help would be appropriated!
__________________
- Trevor

Team 3504 - The Girls of Steel 2011 - Present
2012 Pittsburgh Regional Engineering Inspiration, and website awards
Team 1743 - The Short Circuits 2009 - 2011
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2010 Won Autodesk Animation Competition
2010,2011 Pittsburgh Team spirit award
Reply With Quote
  #7   Spotlight this post!  
Unread 12-07-2009, 07:29 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem Loading Java Code

Quote:
Originally Posted by Trevor_Decker View Post
Does any one know if their is a place to download the 2009 Crio Imaging tool?( I Am not sure where our teams copy of the 2009 software CD's are). Any help would be appropriated!
I'm not aware of a standalone installer for the imaging tool. Why do you need to old version?
__________________
Eric Haskins KC9JVH
Reply With Quote
  #8   Spotlight this post!  
Unread 12-07-2009, 08:01 PM
Trevor_Decker's Avatar
Trevor_Decker Trevor_Decker is offline
Registered User
AKA: Trevor Decker
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: Pittsburgh
Posts: 42
Trevor_Decker is an unknown quantity at this point
Re: Problem Loading Java Code

According to the Getting Started With Java pdf you need the old software

"Choose a Windows installation that has the 2009 FRC Software already installed on it. If you do not have one, then follow the instructions from last year’s set of DVDs to create one."

I personally do not care if I have the old software installed or not just as long as I can Image the Crio for Java.
__________________
- Trevor

Team 3504 - The Girls of Steel 2011 - Present
2012 Pittsburgh Regional Engineering Inspiration, and website awards
Team 1743 - The Short Circuits 2009 - 2011
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2010 Won Autodesk Animation Competition
2010,2011 Pittsburgh Team spirit award
Reply With Quote
  #9   Spotlight this post!  
Unread 12-07-2009, 08:06 PM
wmatt2014 wmatt2014 is offline
Registered User
AKA: Matt
FRC #2374 (CrusaderBots)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jesuit High School, Portland, OR
Posts: 6
wmatt2014 is an unknown quantity at this point
Re: Problem Loading Java Code

We have also been running into errors when we try to load code onto the cRIO. We have made attempts on two different platforms, both of which have resulted in error.
On a mac, we run through rebooting and to the point where the cRIO is starting up again but the deployment hangs indefinitely on the line "in static method #3 of com.sun.squawk.VM(bci=6)".
Additionally, on a windows computer, we do not make it to the point in which the code is downloaded. Here are the last few lines before the error:
Quote:
Connecting FTP @10.23.74.2
Remote OTA server matches local, no upgrade needed
Remote VM matches local, no upgrade needed
Remote Java suite matches local, no upgrade needed
C:\Documents and Settings\robotics\sunspotfrcsdk\build.xml:98: The following error occurred while executing this line:
C:\Documents and Settings\robotics\sunspotfrcsdk\ant\upgrade.xml:38 : java.net.SocketException: Connection reset
BUILD FAILED (total time: 25 seconds)
Any help on either platform would be much appreciated.

On a side note, we are fairly sure we have reimaged the cRIO correctly as we have done it multiple times with the format controller button selected. Also, someone previously mentioned that they had forgotten to set their team number in tools/options/frc configuration, but we have done so correctly.
Reply With Quote
  #10   Spotlight this post!  
Unread 12-07-2009, 09:34 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem Loading Java Code

Quote:
Originally Posted by wmatt2014 View Post
We have also been running into errors when we try to load code onto the cRIO. We have made attempts on two different platforms, both of which have resulted in error.
On a mac, we run through rebooting and to the point where the cRIO is starting up again but the deployment hangs indefinitely on the line "in static method #3 of com.sun.squawk.VM(bci=6)".
Additionally, on a windows computer, we do not make it to the point in which the code is downloaded. Here are the last few lines before the error:


Any help on either platform would be much appreciated.

On a side note, we are fairly sure we have reimaged the cRIO correctly as we have done it multiple times with the format controller button selected. Also, someone previously mentioned that they had forgotten to set their team number in tools/options/frc configuration, but we have done so correctly.
What version of the imaging tool are you using?
Is it set to Java Technology?

What firewall(s) are you using?
Can you try with them disabled?
__________________
Eric Haskins KC9JVH
Reply With Quote
  #11   Spotlight this post!  
Unread 12-08-2009, 12:24 AM
wmatt2014 wmatt2014 is offline
Registered User
AKA: Matt
FRC #2374 (CrusaderBots)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jesuit High School, Portland, OR
Posts: 6
wmatt2014 is an unknown quantity at this point
Re: Problem Loading Java Code

Quote:
What version of the imaging tool are you using?
Is it set to Java Technology?

What firewall(s) are you using?
Can you try with them disabled?
For the imaging tool, we have installed the update released with the Java prerelease. There is an option for Java in our imaging tool, and we have successfully reimaged with that option and the "format controller" button selected. For all we know, the reimaging process has gone swimmingly.

As far as the firewalls go, I know that on the Windows computer (the one that did not make it as far as the mac in the code deployment), we were asked by XP during one of the deployment attempts to verify that we wanted netbeans to have permission to do whatever it was doing at the time. We said to allow netbeans to continue.

Last edited by wmatt2014 : 12-08-2009 at 12:29 AM.
Reply With Quote
  #12   Spotlight this post!  
Unread 12-08-2009, 12:27 AM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem Loading Java Code

Quote:
Originally Posted by wmatt2014 View Post
For the imaging tool, we have installed the update released with the Java prerelease. There is an option for Java in our imaging tool, and we have successfully reimaged with that option and the "format controller" button selected. For all we know, the reimaging process has gone swimmingly.

As far as the firewalls go, I know that on the Windows computer (the one that did not make it as far as the mac in the code deployment), we were asked by XP during one of the deployment attempts to verify that we wanted netbeans to have permission to do whatever it was doing at the time. We said to allow netbeans to continue.
My suggestion is disable the firewall, and connect firectly from the PC to the robot using a cressover cable. This should eliminate any network issues.
__________________
Eric Haskins KC9JVH
Reply With Quote
  #13   Spotlight this post!  
Unread 12-08-2009, 08:54 AM
derekwhite's Avatar
derekwhite derekwhite is offline
Java Virtual Machine Hacker
no team (FIRST@Oracle)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2009
Location: Burlington, MA
Posts: 127
derekwhite is on a distinguished road
Re: Problem Loading Java Code

Firewall issues can definitely affect code downloading on both Mac and Windows. The SDK uses a Java-based ftp client that most firewalls don't know about. It may be possible to set up a firewall permission for the Java.exe application.
Reply With Quote
  #14   Spotlight this post!  
Unread 12-08-2009, 09:45 PM
aaeamdar2 aaeamdar2 is offline
Registered User
FRC #1893
 
Join Date: Nov 2009
Location: Baltimore
Posts: 9
aaeamdar2 is an unknown quantity at this point
Re: Problem Loading Java Code

New update:

Of note: though I disabled WatchDog in the code, it still says

"System: Watchdog"

below the team number.

I'm starting to get pretty stumped.

EDIT: It also tells me when I'm loading code:


[cRIO] Information: No user-supplied RobotMain()

Is this possibly a problem?

OK so, now I have a slightly different problem:

I fixed the aforementioned issue (thanks to all who confirmed that that's what it was) and have (as far as I know) successfully loaded code onto the robot. However, there's a minor issue: nothing happens.

I'm still working on troubleshooting this issue, and I'm not by any means tapped out, but if anyone has any suggestions, I would very much appreciate them. A few facts:

1. I have communication established between robot and DS.
2. The code is supposed to be tank-drive - I essentially copied the code in the doc.
3. Nothing happens when I activate the joysticks.

EDIT: One problem was that I had two projects running. One was blank and selected as the main project; the other had the code in it and was NOT selected as the main project. However fixing this did NOT solve the problem (frowny face).


Here's my code:

Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.DriverStation.*;
import edu.wpi.first.wpilibj.camera.*;


/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the SimpleRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class RobotTemplate extends SimpleRobot
{
    //This is all SANDBOX code.
    public static final boolean PRESSED = true;
    public static final boolean UNPRESSED = false;

    Joystick j1;
    Joystick j2;
    RobotDrive drivetrain;
    Compressor comp;
    DriverStation ds;

    Accelerometer a;
    DigitalInput bump;
    AxisCamera cam;
    Timer t;
    Gyro robotHeadingGyro;



    public RobotTemplate()
    {
        comp = new Compressor(1, 1);
        j1 = new Joystick (1);
        j2 = new Joystick (2);
        drivetrain = new RobotDrive (1, 2);
        this.getWatchdog().setEnabled(false);
        
        ds = DriverStation.getInstance();
        /*
        robotHeadingGyro = new Gyro (1);
        a = new Accelerometer(2);
        bump = new DigitalInput(1);

        if (bump.get())
        {
            System.out.println("oh no cap'n we've been bumped");
        }
         */
    }


    
    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous()
    {
        Alliance a = ds.getAlliance();
        if (a.equals(Alliance.kBlue))
        {
            System.out.println("we're blue");

        }
        else
        {
            System.out.println("we're red");
        }

        while (this.isAutonomous() && this.isEnabled())
        {
            double voltage = ds.getBatteryVoltage();
            System.out.println(voltage);
            if (voltage < 10.0)
            {
                break;
            }
        }
    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() 
    {
        while (this.isEnabled() && this.isOperatorControl())
        {
            drivetrain.tankDrive(j1, j2);
            Timer.delay(0.005);
        }
    }

    private void driveStraight(double speed, Gyro g)
    {
        double d = g.getAngle();
        d = d / 360.0;
        if (d > 1.0)
        {
            d = 1.0;
        }
        if (d < -1.0)
        {
            d = -1.0;
        }
        drivetrain.drive (speed, d);
    }
Reply With Quote
  #15   Spotlight this post!  
Unread 12-08-2009, 10:11 PM
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem Loading Java Code

Quote:
Originally Posted by aaeamdar2 View Post
New update:

Of note: though I disabled WatchDog in the code, it still says

"System: Watchdog"

below the team number.

I'm starting to get pretty stumped.

EDIT: It also tells me when I'm loading code:


[cRIO] Information: No user-supplied RobotMain()

Is this possibly a problem?
I'm not sure if that's an issue, but make sure the file "[project directory]\resources\META-INF\MANIFEST.MF" refers to the correct class.

Quote:
Originally Posted by aaeamdar2 View Post
1. I have communication established between robot and DS.
2. The code is supposed to be tank-drive - I essentially copied the code in the doc.
3. Nothing happens when I activate the joysticks.

EDIT: One problem was that I had two projects running. One was blank and selected as the main project; the other had the code in it and was NOT selected as the main project. However fixing this did NOT solve the problem (frowny face).
If the manifest file is accurate then I would close all projects, create a new Default Code project (found under samples>FRC Java), and, without modifing it, see if it runs.

EDIT: The next step would be to zip up the entire project directory, and post a complete copy of the build output. Maybe then we'll find something that's causing your issue.
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 12-08-2009 at 10:16 PM.
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
problems loading code with Easy C Clayton Programming 1 01-31-2008 03:15 PM
Loading Code Onto 2005 RC chris31 Programming 13 11-08-2006 07:45 AM
Ways to speed up code loading process? Makubesu Programming 10 01-21-2006 05:23 PM
Java headache problem MisterX Programming 8 03-30-2005 11:09 AM
problem loading code with ifi loader psych0gambit Programming 7 02-25-2005 08:43 PM


All times are GMT -5. The time now is 08:48 AM.

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