Home Forums Software osPid front end 3870e68 compile problem

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Brett
    Keymaster
    Post count: 101

    the frontend was written using controlP5 v0.5. newer versions of controlp5 do not seem to be backwards compatible. try using this version from their google code site.

    Brett
    Keymaster
    Post count: 101

    it was built for windows, but I thought I had taken care of all those “” by using file.separator instead. where are you getting your error?

    ragaRew
    Participant
    Post count: 1

    I couldn’t see the question to you about the compile problem, but I’m getting the same problem.

    When I compile the processing script, I get a null pointer exception in call to ReadProfiles().

    I believe this is because the call in osPID_FrontEnd
    ReadProfiles(curDir+ File.separator + “profiles”);
    contains a null string – String curDir = System.getProperty(“user.dir”);

    If I place a copy of the profiles directory at c: and change the offending line to
    String curDir = “c:”;

    it compiles and runs correctly.

    I have experimented with System.getProperty(“user.dir”) in other programs and it works fine. I have installed the code in several different directories with same result.

    Thx,
    Mike

    hairykiwi
    Participant
    Post count: 7

    I’m experiencing the same problem. ragaRew’s solution works, but maybe this shed’s some light on the source of the problem.

    in osPID_FrontEnd.pde (in a folder D:osPID_FrontEnd)
    I inserted

    System.out.println(System.getProperty("user.dir"));

    just before:

        String curDir = System.getProperty("user.dir");

    Then, (click run and) in the processing IDE console window, just before the null pointer debug message(s) it prints your ‘user directory’:

      D:Processingprocessing-1.5.1 – i.e. the location of processing.exe

    So it seems that the “user.dir” is the directory of processing.exe, not the sketch (osPID_FrontEnd.pde) folder.

    Perhaps the getProperty(“user.dir”) needs to be replaced with either getMainFilePath() or getFolder() method?
    as detailed here:
    http://processing.googlecode.com/svn/trunk/processing/build/javadoc/everything/processing/app/Sketch.html#getPrimaryFile%28%29
    But using Processing v1.5.1 those methods are not recognised – and Processing is completely new to me.

    I’ll try and find a solution, but Brett will be way more up to speed on this stuff than me.

    BTW, thanks Brett/Lim – I’m really enjoying playing with osPID for controlling my Rancilio Silvia coffee machine. Will post some pics of that real soon.

    hairykiwi
    Participant
    Post count: 7

    I just discovered Brett already posted the solution to this problem in the following thread:
    viewtopic.php?f=4&t=266&p=407#p407 (The one dated Mon Apr 30, 2012 5:19 pm)
    In it, he says, ‘…you’ll need to copy the “profiles” folder to the folder containing your processing.exe’

    After some searching, I still don’t understand why the methods getMainFilePath() or getFolder(), which appear in the code linked to in my previous post, are not available in processing version 2.0b3 (Java). Any ideas?

    – Hamish

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.