Go to Post Embrace the challenge, dont shoot it down. - waialua359 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-31-2016, 10:20 AM
java4first java4first is offline
(Java) Programming Mentor
AKA: Stu
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 2011
Location: Goffstown, NH
Posts: 56
java4first is an unknown quantity at this point
Help w/ WPILib Preferences

Hi -

I had something that worked for this last year, and things in WPILib have changed, and I'm having problems with the same approach this year.

The name of the file stored on the roboRIO in the lvuser home directory has changed (now networktables.ini), the header or 1st line is different, and the format of the properties themselves are different. I got through all that.

So that I don't have to use the SmartDashboard to get the properties loaded, we had a script that used pscp (from Putty) to download a copy of the file on command from the development laptop to the roboRIO.

The problem is that WPILib now throws a complaint about the format of the header, and refuses to process the rest of the file. If I do a diff of the file as copied from my Windows development laptop and the one written by the pscp copy, every line is different, but there is no discernible difference ... so I'm thinking maybe it is the way the end of line is handled on Windows vs. Linux?

WARNING: /home/lvuser/networktables.ini:1:header line mismatch, ignorning rest of file (Dispatcher.cpp:71)
WARNING: When reading initial persistent values from '/home/lvuser/networktables.ini'Dispatcher.cpp:69)[/indent]
It used to work without problems ... And I can live with running the SmartDashboard every time they change just to update the file, but it's kind of awkward and inconvenient. Does anyone from WPILib development know if there is some other problem I can fix on my end?

Thanks in advance!
Stu
Reply With Quote
  #2   Spotlight this post!  
Unread 01-31-2016, 01:28 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,547
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Help w/ WPILib Preferences

It looks like it will fail if you use windows line endings. Based on quick research, pscp keeps the original line endings. I suspect pscp downloads with unix line endings, and your text editor changes them to windows line endings, and then pscp sends it back as windows line endings.

I've successfully done this with filezilla, which will change line endings from unix to windows when transferring to windows and back to unix when transferring to unix. Alternately you can use a text editor that doesn't mess with the line endings.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-31-2016, 08:18 PM
lstonetx lstonetx is offline
Registered User
FRC #4587
 
Join Date: Jan 2016
Location: Houston, TX
Posts: 1
lstonetx is an unknown quantity at this point
Re: Help w/ WPILib Preferences

I don't have access to a RoboRIO right now, but if the "tr" command is available you can ssh to the RoboRIO and use it to strip the carriage returns from the file copied by pscp.

cat networktables.ini |tr -d "\r" >q
mv q networktables.ini
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:26 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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