Odd error when trying to use camera: No content-length token found in packet

We’ve recently been trying to get the camera to work with Java. We’re using the standard KoP camera plugged into port #2 on the cRIO with all of the correct settings as stated in the setting up your camera PDF. Based on what we read in this section of the forums, only a single line of code was actually required to make the camera send back an image to the stock dashboard (which is all we are trying to do). We added that line:

AxisCamera camera = AxisCamera.getInstance();

to the main class’s constructor and everything compiled fine, but once we begin running teleop on the robot, we get this odd error:

“AxisCamera: No content-length token found in packet: S_errno_ECONNREFUSED”

It comes up every few seconds in the netbeans output window, and no video is displayed on the dashboard.

Anyone know why this is happening or what we can do to fix it? We’ve looked around, but haven’t seen anyone posting about this problem anywhere else. Your help would be much appreciated! Thanks.

I had a similar problem. I got the same error in netbeans, using the code below:

//in constructor:
AxisCamera cam=AxisCamera.getInstance();
//in teleopPeriodic
try{
                ColorImage currentImage=cam.getImage();
                cam.writeResolution(AxisCamera.ResolutionT.k320x240);
                currentImage.luminanceEqualize();
                currentImage.free();
            }catch(AxisCameraException c){}
            catch(NIVisionException i){}

We had the same issue for a while but we read up on it and were able to figure out that it’s an issue due to the user info. In the FRC document “How to Configure your Camera” it gives working usernames and passwords that seem to eliminate this issue.

"How to Configure Your Camera
The camera comes with a network address of 192.168.0.90 and a root password of “pass”. The IP address is kept but the password for root must be updated to “admin” to work with the camera access software.

Manual Configuration of the Camera
The username/password combinations that work with the default code are shown in the table below. As long as at least one of these users is configured, the camera initialization software will work.
User name FRC
Password FRC
root pass (Axis default, must be changed)
root admin
FRC FRC"

Using the username “FRC” and password “FRC” has worked for us so far.

Thank you. I will try that tomorrow at the next build meeting.