In need of help with FTP.

Hi,

I’m not very good at networking (but i’m good at syntax in coding so i guess that’s why im a programmer), but I know you could transfer files between the cRio and the computer via FTP last year. I know what FTP stands for but I honestly don’t know how to use it to our potential. Let alone code it (Java).

I’d like to load joystick configuration files into the code via a .txt file. (so if we want to change controls quickly we can do it without rebuilding, we just change a .txt file). I tried a local .txt file on the computer and after several minutes of pondering why the robot couldn’t find the file, I realized I was a bit tired.

Anyways, I was hoping if anyone could help me out. I’d like to easily change a .txt file hosted on the RIO and have the robot scan numbers into the code. I have the scanner class and such coded it’s just a matter of getting the correct directory in the code.

So my question - how do I access the RIO via FTP, and where do I find the directory of a file located on the rio?

Look up Filezilla. FTP stands for file transfer protocol, it’s a way of sending files across a network. Same as HTTP is hyper text transfer protocol.

(this may be a bad analogy but it works for me) same as you use chrome or Firefox to view HTTP, you would use Filezilla to view and browse FTP.

Filezilla is an open-source program that makes this a breeze. Just download it and follow the instructions!

If you’ve got any questions, shoot!

I haven’t tried it lately, but I believe FTP is disabled by default on the RoboRIO. SFTP is permitted (over port 22).

Thank you.

Do you think it would be far simpler with SmartDashboard?

I don’t really have any clue how to get it working, last year it just starting showing up one day and it has yet to do so yet even with code.

Here’s what I have for a simple electronics board with a 4 talons attached:

https://github.com/jtervay97/testBoardBot

You can safely ignore any arrays or .txt files, they’re works in progress… and failures also… hehe

Is there any major difference in this context?

Anonymous ftp is enabled on the roboRIO (despite the objections of certain developers).

Windows explorer does ftp. Just type “ftp://roboRIO-2791.local” in the address bar.

I highly recommend using SmartDashboard for this, instead of FTP. If you have a limited amount of these control schemes, I suggest what my team did. Last year half of our drive teams liked tank drive, while the rest prefers arcade. We used a button on our controller, clicking a stick, to switch control schemes on the fly. Pretty useful.

I’ve been considering SD but I’ve always found it to be a royal PITA to configure and keep consistent. I only need it to store about 20 int values that I can configure anyway, I could use it but I just prefer not to. Personal experience is all.

Has retrieving numbers from SD changed between 2014 and 2015?

edit: probably just going to wind up using this for my case: Setting robot preferences from SmartDashboard | SmartDashboard | 2014 FRC Control System

We’ve been using using text files for autonomous and settings for several years. However, because of how fast it is to redownload code (7 seconds for Java), we are planning to go back to embedding those in code (albeit in separate files). This makes version control much easier. Several times we’ve bagged the robot and then remembered we weren’t sure what was the final constants file on the robot.