Can't find serial port on my mac in processing?

edited December 2016 in Arduino

When using processing on my mac book pro i am unable to find the serial port and instead i get an error message saying the serial port cannot be found. On my arduino its recognised as a USB modem. If anyone could help i'd greatly appreciate it!

Tagged:

Answers

  • Hopefully this will help anyone understand my problem!

  • How do i insert that into my existing code? what do i take out? I am new to this so sorry if im missing something obvious

  • Please no screenshots of code for many reasons: it is unreadable, we cannot copy and paste to reproduce your problem and other forum goers will not be able to search your post in the forum. So copy and paste your code. To format your code in this forum, select your code and hit ctrl+o. Ensure there is an empty line above and below your code. Same applies for error codes and error messages.

    For your question and adding to GoToLoop's post, right before the line that produces the error, you insert the following line:

    printArray(Serial.list());

    Then, when you run it, you will see in your console, a list of available Com ports in your machine. My guess is that you are typing the name of your ports in uppercase. This operation could be case sensitive. By using the serial list printout, you will see the proper name of your com ports.

    Kf

  • The port names don't always show up as COMxx. Sometimes other names end up coming, I don't know why.

  • edited December 2016

    Thanks for the advice Kf,

    I inserted that line and got a list of all the available ports in the console. From this how do i select the one i want? Once i typed it in the error message for the com port went away but instead i got another error from the final line in the section.

             > size (1250, 750); // ***CHANGE THIS TO YOUR SCREEN RESOLUTION***
            >  smooth();
            >  printArray(Serial.list());
            >  myPort = new Serial(this,"/dev/cu.usbmodem1411", 9600); // starts the serial communication
            >  myPort.bufferUntil('.'); // reads the data from the serial port up to the character '.'. So actually it reads this: angle,distance.
            >      orcFont = loadFont("OCRAExtended-20.vlw");
            > }
    

    The final line above threw up a load of errors that im not sure why because when i ran it on windows it worked fine? If anyone coud help i'd really appreciate it.

  • Final line? You mean this - orcFont = loadFont("OCRAExtended-20.vlw");? And what is the nature of the error?

  • @jsmith -- please share the specific error message. Did you create the vlw file on each machine as per the loadFont reference?

  • How can i copy the error message in the console tab without screenshotting it?

  • Select the message in the console and hit ctrl+c. Come to the forum and press ctrl+v. You can format your error message with ctrl+o I think... it will look better anyways if you formatted as if it were code.

    Kf

  • edited December 2016

    okay thank you, here it is,

    java.lang.NullPointerException
      at java.io.DataInputStream.readInt(DataInputStream.java:387)
      at processing.core.PFont.<init>(PFont.java:350)
      at processing.core.PApplet.loadFont(PApplet.java:6130)
      at Radar_v3.setup(Radar_v3.java:52)
      at processing.core.PApplet.handleDraw(PApplet.java:2393)
      at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1540)
      at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)
    Could not run the sketch (Target VM failed to initialize).
    For more information, read revisions.txt and Help → Troubleshooting.
    
  • I guess the problem is with the font file. How did you get hold of it? Have you tested it with any other program?

  • All of the code is copied from the page where it was posted. i ran it on windows and it worked fine and now on my mac it throws up that error. I am unsure what it means and what to do

  • Does the font file even exist in your data folder?

  • How would i check that?

  • You're on Mac, so I'm not sure, but somewhere in the IDE there will be an option - "Show Sketch Folder". Click it, and you may see a data folder. If you don't, you should atleast see a file with extension .vlw. If you do, inside it a file with .vlw extension should exist. If it doesn't, then something isn't right - you need to put the font in the data folder for processing to be able to load it, unless it is one of the default fonts of the OS.

  • edited December 2016

    @jsmith -- To view the contents of your sketch folder on a Mac:

    1. press Command-k while the sketch edit window has focus
    2. or select Menu > Sketch > Show Sketch Folder in Processing
    3. or Command-click the file icon in the Sketch top bar and then select the folder (saved sketches only).

    Screen Shot 2016-12-20 at 10.20.13

    Screen Shot 2016-12-20 at 10.19.24

    Files might be loaded from the sketch folder or from a subfolder "data" as per the discussion above.

  • You can also go to Tools >> Create Font in the Processing IDE.
    It creates vlw files.
    Kf

  • @kfrajer AFAIK, he should already be having the font file.

  • In case the OP doesn't have it. It could be generated easily from Processing itself.

    Kf

  • Yes. There are many fonts, and it also has the bold and italics options.

  • Thanks for the advice. What am i looking to check for or alter to resolve the problem?

  • You didn't answer our question. Did you find a data folder, or atleast the font file?

  • when i do the steps mentioned above a window opens containing my arduino code and processing code in the same folder?

Sign In or Register to comment.