Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Serial Port Not Finding Pixy Camera (http://www.chiefdelphi.com/forums/showthread.php?t=153409)

DevOrc 10-01-2017 17:48

Serial Port Not Finding Pixy Camera
 
We are trying to use the Pixy camera for vision targeting. We have it hooked up to the USB Port on the RoboRio. However we keep on getting the same error when we create the Serial Port object.
Code:

java.lang.RuntimeException:  Code: -1123. HAL: The specified serial port device was not found
        at edu.wpi.first.wpilibj.hal.SerialPortJNI.serialInitializePort(Native Method)
        at edu.wpi.first.wpilibj.SerialPort.<init>(SerialPort.java:112)
        at edu.wpi.first.wpilibj.SerialPort.<init>(SerialPort.java:160)
        at org.usfirst.frc.team4283.robot.vision.RobotCamera.initTeleop(RobotCamera.java:21)
        at org.usfirst.frc.team4283.robot.Robot.teleopInit(Robot.java:68)
        at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:123)
        at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:247)


Thad House 10-01-2017 17:57

Re: Serial Port Not Finding Pixy Camera
 
Quote:

Originally Posted by DevOrc (Post 1628840)
We are trying to use the Pixy camera for vision targeting. We have it hooked up to the USB Port on the RoboRio. However we keep on getting the same error when we create the Serial Port object.
Code:

java.lang.RuntimeException:  Code: -1123. HAL: The specified serial port device was not found
        at edu.wpi.first.wpilibj.hal.SerialPortJNI.serialInitializePort(Native Method)
        at edu.wpi.first.wpilibj.SerialPort.<init>(SerialPort.java:112)
        at edu.wpi.first.wpilibj.SerialPort.<init>(SerialPort.java:160)
        at org.usfirst.frc.team4283.robot.vision.RobotCamera.initTeleop(RobotCamera.java:21)
        at org.usfirst.frc.team4283.robot.Robot.teleopInit(Robot.java:68)
        at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:123)
        at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:247)


If you log into the web dash on the roboRIO, http://wpilib.screenstepslive.com/s/...o-webdashboard, you should see 3 serial port objects. What shows up for the last one? ASRL1 and ASRL2 are the built in serial ports.

DevOrc 10-01-2017 18:08

Re: Serial Port Not Finding Pixy Camera
 
The web dashboard shows three other things on the list:

1. CAN Interface
2.Pixy
3.Pixy

Thad House 10-01-2017 18:21

Re: Serial Port Not Finding Pixy Camera
 
Quote:

Originally Posted by DevOrc (Post 1628851)
The web dashboard shows three other things on the list:

1. CAN Interface
2.Pixy
3.Pixy

So they show up, but I need the actual names of the serial ports. If you click on each one, what data does it show? I don't remember the exact name, but there should be a string that starts with /dev . can I get that name?

Thad House 10-01-2017 21:28

Re: Serial Port Not Finding Pixy Camera
 
So doing some research, and the Pixy is not a USB serial device. It's USB connection uses a custom app to talk to the device. So that is why it is not working. However, you should be able to hook up the uart on the expansion connector to the roborio uart on the MXP, then use the MXP setting for the wpilib serial port. Note do not try to hook up to the RS-232 port on the roboRIO, as this will break the Pixy.

DevOrc 11-01-2017 06:44

Re: Serial Port Not Finding Pixy Camera
 
Ok! I will try that later when we have our meeting. Thank you!

DevOrc 11-01-2017 15:06

Re: Serial Port Not Finding Pixy Camera
 
Ok, I talked to the team today and We have two questions:

1: What cable would we use to hook it up to the MXP Port?
2: Could we use the NVIDIA Jetson?

Xanawatt 13-01-2017 08:56

Re: Serial Port Not Finding Pixy Camera
 
Quote:

Originally Posted by DevOrc (Post 1629429)
Ok, I talked to the team today and We have two questions:

1: What cable would we use to hook it up to the MXP Port?
2: Could we use the NVIDIA Jetson?

You would most likely have to make a custom cable(ours is just several single pin connectors all hot glued in the connection). We used the I2C interface and it works ok. And if you use the I2C, you dont even have to connect it to the mxp, you could just connect it directly to the RoboRIO. I would love to share the code and help :)

Coach Seb 14-01-2017 14:59

Re: Serial Port Not Finding Pixy Camera
 
Please share !!! i will be the next one asking as soon as my dev environemnt is setup....

loafdog 15-01-2017 21:50

Re: Serial Port Not Finding Pixy Camera
 
I'm guessing this might be code Xanawatt is referring to?
https://github.com/Xanawatt/PixyI2C
Just a guess.. :)

I'd like to see more info how you or anyone else actually connected the pixy to the hw. Wiring info and/or pics of what you did would be really helpful. We are trying to figure out which method to use to connect pixy to roborio. I think our choices are(in order of preference) i2c, uart serial, or plain ol analog/digital.

Related, i also found a few repos that contained what looks like uart serial code. This is just one example: https://github.com/Zero2848/PixyCamTest


All times are GMT -5. The time now is 12:33.

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