![]() |
Text files on the roborio?
Hi,
Does anyone know how to write text files to storage on the roborio with java? If so, what directories do I have access to? Here's my code if it helps: Code:
package org.usfirst.frc.team1559.robot;java.io.IOException: No such file or directory at java.io.UnixFileSystem.createFileExclusively(Nativ e Method) at java.io.File.createNewFile(File.java:1012) at org.usfirst.frc.team1559.robot.Robot.robotInit(Rob ot.java:32) at edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:76) at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:234) ERROR Unhandled exception: java.lang.NullPointerException at [java.io.Writer.<init>(Writer.java:88), java.io.BufferedWriter.<init>(BufferedWriter.java: 101), java.io.BufferedWriter.<init>(BufferedWriter.java: 88), org.usfirst.frc.team1559.robot.Robot.robotInit(Rob ot.java:39), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:76), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:234)] WARNING: Robots don't quit! ---> The startCompetition() method (or methods called by it) should have handled the exception above. Any help is appreciated! |
Re: Text files on the roborio?
I was able to create files by specifying a absolute path, i.e.:
Code:
/home/lvuser/Output.txt |
Re: Text files on the roborio?
We are writing files to /home/lvuser as described here: http://wpilib.screenstepslive.com/s/...15#FileStorage as well as to a usb drive at /media/sda1
|
Re: Text files on the roborio?
Thank you so much!
I guess ~/ only works in desktop linux..... |
Re: Text files on the roborio?
You also can output to a flashdrive using /U/ and /V/.
|
Re: Text files on the roborio?
Quote:
Code:
. |
Re: Text files on the roborio?
Hi All -
I have looked around the links on this post for more information about using a USB stick, but can't find much. I see that I can reference /U/ and /V/ (presumably for the two USB ports). When I plug a Kingston NTFS-formatted USB stick and connect via FTP (Filezilla) I can see the KINGSTON device, but not the folders. I assume this is because the stick is formatted NTFS. If I use a FAT-formatted USB stick, will I see it as /U or /V depending on the port it is plugged into? Any other fine points about getting this to work for data logging? tia - mp |
Re: Text files on the roborio?
Quote:
|
Re: Text files on the roborio?
Sorry forgot to mention that I did look for /media/sda1, and I do not see the device listed that way. Neither do I see it listed as U or V.
I have since formatted my device as FAT and tried again with no luck. It is a 64Gb stick - any chance there is a size limit? As an alternative I could use the internal storage. Read in the specs for the Roborio that the internal storage capacity is 256 MB. Can anyone tell what the approx remaining capacity is after loading JRE and robot program? Filezilla is not help me figure that out. mp |
Re: Text files on the roborio?
Happy to report that I finally got this working using another smaller, FAT formatted USB stick.
Placed in the bottom USB port (the one closest the logo) this appears as: /u, /U and /media/sda1. So I guess we should avoid NTFS and very large capacity sticks. mp |
Re: Text files on the roborio?
Quote:
|
Re: Text files on the roborio?
Quote:
|
Re: Text files on the roborio?
Quote:
Quote:
They also included on the same page, probably more germane: Quote:
|
Re: Text files on the roborio?
Quote:
|
Re: Text files on the roborio?
Quote:
Code:
File file = new File("Output.txt");Code:
File file = new File("new_directory/Output.txt"); |
| All times are GMT -5. The time now is 10:34. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi