Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   VisionException Unknown Error (http://www.chiefdelphi.com/forums/showthread.php?t=143181)

alambert14 04-02-2016 20:26

VisionException Unknown Error
 
We have been working on vision code with Java, and we are trying to save an image to the roboRIO. Following what we did last year, we connected to the roboRIO with SFTP (filezilla), and then created a folder in the root directory called "image" and placed a picture called test.jpg.

However, when we try to write the file using

Code:

NIVision.imaqWriteJPEGFile(frame, "/image/test.jpg", 100, colorTable);
frame is our image to be written.

However, when we run the code, we get an error on that line saying: "Unhandled exception: VisionException [com.ni.vision.VisionException: imaqError: -1232673104: Unknown error] at [com.ni.vision.NIVision._imaqWriteJPEGFile(Native Method), com.ni.vision.NIVision.imaqWriteJPEGFile(NIVision. java:25654)" on the line of code mentioned above.

It is hard to figure out what is wrong since it is an "unknown" error; however, we believe it has something to do with the file path. Has anyone seen this error before and/or know how to fix it? Anything helps, thanks!

rpappa 04-02-2016 21:37

Re: VisionException Unknown Error
 
I ran into a similar issue earlier today when messing around with OpenCV. Make sure that all users have write access to that directory. Try SSH'ing in and running

chmod -R 0777 /image/

alambert14 06-02-2016 12:24

Re: VisionException Unknown Error
 
Would you mind telling me how to do that step by step? We have never had a problem in the pass accessing the roboRIO's file system; I am able to write files using FTP, just not with the NIVision methods. Thanks.

pblankenbaker 07-02-2016 17:33

Re: VisionException Unknown Error
 
I suspect you are facing a permissions issue on the roboRIO. I believe that the Java robot program will run as the "lvuser" not as the "admin" user.

On the roboRIO, the admin user is similar to the root user and has the ability to write to or modify the entire file system.

Since your program is probably running as the lvuser, I suspect you can only write to the /home/lvuser directory on the roboRIO account (unless you log in as admin and change permissions on your /images directory).

Try opening "ftp://roborio-TEAMNUM-FRC.local/ in your web browser to verify that you see a /home/lvuser directory on the roboRIO. If so, try using "/home/lvuser" as the output directory for your image files instead of "/images". If that works, it is definitely a permissions issue.

You can either then live with using the "/home/lvuser" directory, or use a tool like Putty for Windows (http://www.putty.org/) to ssh into your roboRIO and change the permissions (or ownership) on your /images directory) as indicated in an earlier post.

Code:

chmod 777 /images

alambert14 08-02-2016 14:18

Re: VisionException Unknown Error
 
Yes, that was definitely the problem. I had tried writing to the lvuser folder before, but it still did not work. However, I asked a student who is better versed in Linux than I to help and he changed the permissions (and it worked). Thank you guys so much!


All times are GMT -5. The time now is 09:18.

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