Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Ubuntu 12.04 can't program Teensy using 1.15.

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    19

    Ubuntu 12.04 can't program Teensy using 1.15.

    I'm running Ubuntu 12.04 (important, because it works on 10.04), and I can't program a Teensy -- neither 2.0 nor 3.0. I'm running Teensyduino 1.15 against Arduino 1.05.

    The teensy is programmed with sensor code that writes output to Serial(). When I plug it in, it creates /dev/ttyACM0, and I can read the output with 'cat </dev/ttyACM0'.

    When I compile a new version of the code, it emits the usual "Please press the RESET BUTTON on your Teensy to upload your sketch. Auto-reboot only works if the Teensy is running a previous sketch." even though it's already running a previous sketch. That would be okay if pressing the PROGRAM BUTTON worked. I have the Verbose output window open, and it prints nothing when I press the program button. It also doesn't create /dev/ttyACM0, presumably because it's stuck in raw hid mode for programming.

    There's no "device came online" message in the Teensy loader window. I ran strace against the 'teensy' executable, and while it can see the USB device when it gets created by the kernel, it can't access it.
    open("/dev/bus/usb/002/039", O_RDWR|O_LARGEFILE) = -1 EACCES (Permission denied)
    However, I see the exact same thing on 10.04 where it *does* work. So this may be a red herring.

    Help?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,008
    Did you install the udev rules? If you're getting a permission denied error, it's very likely because the udev rules aren't set up to all you access to the device.

    http://www.pjrc.com/teensy/49-teensy.rules

    For troubleshooting, the best info about whether the device is detected is syslog. On 12.04, it's /var/log/syslog. You might try running "tail -f /var/log/syslog" in a terminal while doing things. That will show you the kernel's messages about what it's actually detecting.

    But I'm pretty sure, from the info you posted, the udev rule is probably not set up.

  3. #3
    Junior Member
    Join Date
    Oct 2012
    Posts
    19
    Oh. My. God. Kill me now before I make another misteak like this.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,008
    Actually, on my to-do list for the installer is a check to see if the udev rules are installed. Initially it'll probably just show a warning message to remind you to install them.

    Maybe someday I'll figure out how to properly prompt for root access to install them. But that's getting into all sorts of Linux integration (PAM, shadow password files, sudo vs root, real vs effective IDs, etc) that the installer probably will never have.

    Teensy Loader is also going to get a rework of its USB code someday (much has improved on Linux, especially libudev, since I started Teensy 4 years ago). Today it uses usbfs with polling, which isn't ideal but works on all systems. When I switch to libudev, it should become possible for Teensy Loader to do much better at knowing why it can't access your device.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •