Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Trouble recognizing USB interface to microcontroller


    Thanks in advance for any help.

    I'm trying to connect a USB interface that allows you to program a microcontroller.

    I'm using an Asus U31SD laptop
    Linux debian 4.9.0-4-686-pae #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) i686 GNU/Linux
    running LXDE desktop.

    I had been able to use this exact same interface and microcontroller last week before I upgraded Debian/lxde. I was using an older release of Debian/lxde before on the same laptop.

    From what I understand, this USB cable uses an internal ftdi_sio chip that is recognized by native Linux drivers, but needs to be set up for a unique product ID.

    I've attached the manufacturers' installation instructions for this cable.

    I've been trying option #1 and #2 in those instructions, and all the suggestions in another post linked to at the very bottom of this post.


    I have been able to get the permissions set to /dev/ttyUSB0 and /sys/bus/usb-serial/drivers/ftdi_sio/ttyUSB0 and /sys/bus/usb-serial/drivers/ftdi_sio/new_id.

    BUT, both /dev/ttyUSB0 AND /sys/bus/usb-serial/drivers/ftdi_sio/ttyUSB0 are erased every reboot AND /sys/bus/usb-serial/drivers/ftdi_sio/new_id is blank after reboot.

    After I reboot, here is the output of dmesg after I plug in the cable:
    Code:
    [ 1327.854013] usb 2-1.1: new full-speed USB device number 7 using ehci-pci
    [ 1327.969132] usb 2-1.1: New USB device found, idVendor=0403, idProduct=bd90
    [ 1327.969138] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 1327.969142] usb 2-1.1: Product: AXE027 PICAXE USB
    [ 1327.969145] usb 2-1.1: Manufacturer: Revolution
    here is the output of lsusb:

    Code:
    Bus 002 Device 007: ID 0403:bd90 Future Technology Devices International, Ltd
    here is the output of sudo udevadm test /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1

    Code:
    calling: test
    version 232
    This program is for debugging only, it does not run any program
    specified by a RUN key. It may show incorrect results, because
    some values may be different, or not available at a simulation run.
    
    === trie on-disk ===
    tool version:          232
    file size:         8808590 bytes
    header size             80 bytes
    strings            1856310 bytes
    nodes              6952200 bytes
    Load module index
    Found container virtualization none
    timestamp of '/etc/systemd/network' changed
    timestamp of '/lib/systemd/network' changed
    Parsed configuration file /lib/systemd/network/99-default.link
    Created link configuration context.
    timestamp of '/etc/udev/rules.d' changed
    Skipping overridden file: /lib/udev/rules.d/69-libmtp.rules.
    Reading rules file: /etc/udev/rules.d/10-local.rules
    Reading rules file: /lib/udev/rules.d/39-usbmuxd.rules
    Reading rules file: /lib/udev/rules.d/40-usb-media-players.rules
    Reading rules file: /lib/udev/rules.d/40-usb_modeswitch.rules
    Reading rules file: /lib/udev/rules.d/50-firmware.rules
    Reading rules file: /lib/udev/rules.d/50-udev-default.rules
    Reading rules file: /lib/udev/rules.d/55-Argyll.rules
    /lib/udev/rules.d/55-Argyll.rules:129: IMPORT found builtin 'usb_id --export %p', replacing
    Reading rules file: /lib/udev/rules.d/55-dm.rules
    Reading rules file: /lib/udev/rules.d/56-hpmud.rules
    Reading rules file: /lib/udev/rules.d/60-block.rules
    Reading rules file: /lib/udev/rules.d/60-cdrom_id.rules
    Reading rules file: /lib/udev/rules.d/60-crda.rules
    Reading rules file: /lib/udev/rules.d/60-drm.rules
    Reading rules file: /lib/udev/rules.d/60-evdev.rules
    Reading rules file: /lib/udev/rules.d/60-fuse.rules
    Reading rules file: /lib/udev/rules.d/60-libgphoto2-6.rules
    Reading rules file: /lib/udev/rules.d/60-libsane.rules
    Reading rules file: /lib/udev/rules.d/60-persistent-alsa.rules
    Reading rules file: /lib/udev/rules.d/60-persistent-input.rules
    Reading rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules
    Reading rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
    Reading rules file: /lib/udev/rules.d/60-persistent-storage.rules
    Reading rules file: /lib/udev/rules.d/60-persistent-v4l.rules
    Reading rules file: /lib/udev/rules.d/60-serial.rules
    Reading rules file: /lib/udev/rules.d/61-gnome-settings-daemon-rfkill.rules
    Reading rules file: /lib/udev/rules.d/64-btrfs.rules
    Reading rules file: /lib/udev/rules.d/64-xorg-xkb.rules
    Reading rules file: /lib/udev/rules.d/65-libwacom.rules
    Reading rules file: /lib/udev/rules.d/69-cd-sensors.rules
    Reading rules file: /etc/udev/rules.d/69-libmtp.rules
    Reading rules file: /lib/udev/rules.d/69-wacom.rules
    Reading rules file: /lib/udev/rules.d/70-debian-uaccess.rules
    Reading rules file: /lib/udev/rules.d/70-mouse.rules
    Reading rules file: /lib/udev/rules.d/70-power-switch.rules
    Reading rules file: /lib/udev/rules.d/70-printers.rules
    Reading rules file: /lib/udev/rules.d/70-touchpad.rules
    Reading rules file: /lib/udev/rules.d/70-uaccess.rules
    Reading rules file: /lib/udev/rules.d/71-seat.rules
    Reading rules file: /lib/udev/rules.d/73-seat-late.rules
    Reading rules file: /lib/udev/rules.d/73-special-net-names.rules
    Reading rules file: /lib/udev/rules.d/73-usb-net-by-mac.rules
    Reading rules file: /lib/udev/rules.d/75-net-description.rules
    Reading rules file: /lib/udev/rules.d/75-probe_mtd.rules
    Reading rules file: /lib/udev/rules.d/77-mm-cinterion-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-dell-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-ericsson-mbm.rules
    Reading rules file: /lib/udev/rules.d/77-mm-haier-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-huawei-net-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-longcheer-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-mtk-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-nokia-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules
    Reading rules file: /lib/udev/rules.d/77-mm-platform-serial-whitelist.rules
    Reading rules file: /lib/udev/rules.d/77-mm-qdl-device-blacklist.rules
    Reading rules file: /lib/udev/rules.d/77-mm-simtech-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-telit-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-usb-device-blacklist.rules
    Reading rules file: /lib/udev/rules.d/77-mm-usb-serial-adapters-greylist.rules
    Reading rules file: /lib/udev/rules.d/77-mm-x22x-port-types.rules
    Reading rules file: /lib/udev/rules.d/77-mm-zte-port-types.rules
    Reading rules file: /lib/udev/rules.d/78-sound-card.rules
    Reading rules file: /lib/udev/rules.d/80-debian-compat.rules
    Reading rules file: /lib/udev/rules.d/80-drivers.rules
    Reading rules file: /lib/udev/rules.d/80-ifupdown.rules
    Reading rules file: /lib/udev/rules.d/80-iio-sensor-proxy.rules
    Reading rules file: /lib/udev/rules.d/80-libinput-device-groups.rules
    Reading rules file: /lib/udev/rules.d/80-mm-candidate.rules
    Reading rules file: /lib/udev/rules.d/80-net-setup-link.rules
    Reading rules file: /lib/udev/rules.d/80-udisks2.rules
    Reading rules file: /lib/udev/rules.d/84-nm-drivers.rules
    Reading rules file: /lib/udev/rules.d/85-hdparm.rules
    Reading rules file: /lib/udev/rules.d/85-hplj10xx.rules
    Reading rules file: /lib/udev/rules.d/85-hwclock.rules
    Reading rules file: /lib/udev/rules.d/85-nm-unmanaged.rules
    Reading rules file: /lib/udev/rules.d/85-regulatory.rules
    Reading rules file: /lib/udev/rules.d/90-alsa-restore.rules
    Reading rules file: /lib/udev/rules.d/90-console-setup.rules
    Reading rules file: /lib/udev/rules.d/90-libgpod.rules
    Reading rules file: /lib/udev/rules.d/90-libinput-model-quirks.rules
    Reading rules file: /lib/udev/rules.d/90-pulseaudio.rules
    Reading rules file: /lib/udev/rules.d/95-cd-devices.rules
    Reading rules file: /lib/udev/rules.d/95-upower-csr.rules
    Reading rules file: /lib/udev/rules.d/95-upower-hid.rules
    Reading rules file: /lib/udev/rules.d/95-upower-wup.rules
    Reading rules file: /lib/udev/rules.d/97-hid2hci.rules
    Reading rules file: /etc/udev/rules.d/99-axe027.rules
    Reading rules file: /lib/udev/rules.d/99-systemd.rules
    rules contain 393216 bytes tokens (32768 * 12 bytes), 35941 bytes strings
    28138 strings (230196 bytes), 24416 de-duplicated (197978 bytes), 3723 trie nodes used
    GROUP 100 /etc/udev/rules.d/10-local.rules:1
    IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:13
    IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:13
    MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41
    RUN '/sbin/modprobe -q ftdi_sio product=0xbd90 vendor=0x0403' /etc/udev/rules.d/99-axe027.rules:1
    handling device node '/dev/bus/usb/002/007', devnum=c189:134, mode=0664, uid=0, gid=100
    preserve permissions /dev/bus/usb/002/007, 020664, uid=0, gid=100
    preserve already existing symlink '/dev/char/189:134' to '../bus/usb/002/007'
    created db file '/run/udev/data/c189:134' for '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1'
    ACTION=add
    BUSNUM=002
    DEVNAME=/dev/bus/usb/002/007
    DEVNUM=007
    DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1
    DEVTYPE=usb_device
    DRIVER=usb
    ID_BUS=usb
    ID_MM_DEVICE_MANUAL_SCAN_ONLY=1
    ID_MODEL=AXE027_PICAXE_USB
    ID_MODEL_ENC=AXE027\x20PICAXE\x20USB
    ID_MODEL_ID=bd90
    ID_REVISION=0600
    ID_SERIAL=Revolution_AXE027_PICAXE_USB
    ID_USB_INTERFACES=:ffffff:
    ID_VENDOR=Revolution
    ID_VENDOR_ENC=Revolution
    ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
    ID_VENDOR_ID=0403
    MAJOR=189
    MINOR=134
    PRODUCT=403/bd90/600
    SUBSYSTEM=usb
    TYPE=0/0/0
    USEC_INITIALIZED=1327905794
    run: '/sbin/modprobe -q ftdi_sio product=0xbd90 vendor=0x0403'
    Unload module index
    Unloaded link configuration context.
    but whenever I reboot, /dev/ttyUSB0, /sys/bus/usb-serial/drivers/ftdi_sio/ttyUSB0 are gone and /sys/bus/usb-serial/drivers/ftdi_sio/new_id is blank, UNTIL I manually type:

    echo 0403 bd90 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

    AS ROOT. Then the permissions for these three things are not set up for my user so I use chmod 777 for all three as root.

    At this point I have /dev/ttyUSB0, /sys/bus/usb-serial/drivers/ftdi_sio/ttyUSB0 and /sys/bus/usb-serial/drivers/ftdi_sio/new_id (which simply has "0403 bd90") and all three things have proper permissions I think.

    Once I run the echo command above and change the permissions, after plugging in the cable, the last line of dmesg changes to:

    FTDI USB Serial Device converter now attached to ttyUSB0

    I reload udevadm control --reload && udevadm trigger and still it doesn't not work. It's weird becase within Linaxepad (the programming editor running on my computer that you download the code to the microcontroller with) when I click USB Setup within linaxepad it says the following USB devices are available on this computer: /dev/ttyUSB0 but still fails when I try to download with Hardware not found on /dev/ttyUSB0.

    I've been trying to solve this on this other forum with no luck. it's on the main Spark Fun forums but I'm not yet allowed to link to URLs here...
    Attached Files Attached Files

  2. #2
    Linux Newbie sarlacii's Avatar
    Join Date
    May 2005
    Location
    South Africa
    Posts
    223
    Hi there

    I have had this same issue myself. I just need a bit of time to put the solution together, so I'll have to post again a bit later, as I don't have enough time right now.

    Effectively you need to add a rule to udev that recognises the device, and then loads the correct permissions and links etc. There are various howtos around the issue, but some work and some don't.

    To confirm the programmer that you are using, your debug says "AXE027 PICAXE USB"?
    Also what app are you using - EDBG, avrdude etc.?
    And lastly, which device?

    Ta.
    Respectfully... Sarlac II
    ~~
    The moving clock K' appears to K to run slow by the factor (1-v^2/c^2)^(1/2).
    This is the phenomenon of time dilation.
    The faster you run, the younger you look, to everyone but yourself.

  3. #3
    sorry, ya I forgot to mention that option #2 in the installation instructions tells you to make a udev rule

    /etc/udev/rules.d/99-picaxe.rules

    which contains :

    Code:
    #/etc/udev/rules.d/99-axe027.rules
    #contains axe027 udev rule to patch default
    #FTDI product id to AXE027 product id (0xbd90)
    
    ATTR{idProduct}=="bd90",  ATTR{idVendor}=="0403", RUN+="/sbin/modprobe  -q  ftdi_sio  product=0xbd90  vendor=0x0403"
    as suggested in the Spark Fun forum I mentioned, I also made two other udev rules. the first one

    /etc/udev/rules.d/10-local.rules

    which contains

    SUBSYSTEMS=="usb", ATTRS{product}=="PICAXE 027", GROUP="users"

    and this rule, as mtp kept interfering with the udev rule I was creating :

    sudo cp /lib/udev/rules.d/69-libmtp.rules /etc/udev/rules.d/69-libmtp.rules

    which contains :

    # exclude product: AXE027 PICAXE USB
    ATTR{idVendor}=="0403", ATTR{idProduct}=="bd90", GOTO="libmtp_rules_end"

    in the portion of that file that excludes devices from mtp probe.

    I'm trying to program a picaxe 08m2 on a development board from picaxe with picaxe 027 USB cable with Linaxepad programming editor. I was using this exact chip, board and cable right before OS upgrade. I've tried 2 other never used before chips. the programming editor says, /dev/ttyUSB0 available. But when you try to download it says, hardware not found on /dev/ttyUSB0. thanks again!

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie sarlacii's Avatar
    Join Date
    May 2005
    Location
    South Africa
    Posts
    223
    -->
    Hi there, sorry about the later reply.

    Ok, I think that you do not need the modprobe command, as the ftdi serial driver is loaded automatically. What you do need is the device ID's to allow the system to recognise what to do with the device. I have the following rules for my Atmel-ICE and pikit2 respectively. Try something like this instead of your existing rules? And make sure that you add your user to the "dialout" group.

    <snip>
    ~ # cat /etc/udev/rules.d/94-atmelprog.rules
    # Atmel Corp. ATMEL ICE
    ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2141", ACTION=="add", MODE="0666", GROUP="dialout"
    # Atmel Corp. JTAG ICE mkII
    ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2103", ACTION=="add", MODE="0666", GROUP="dialout"
    # Atmel Corp. AVRISP mkII
    ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2104", ACTION=="add", MODE="0666", GROUP="dialout"
    # Atmel Corp. Dragon
    ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", ACTION=="add", MODE="0666", GROUP="dialout"

    ~ # cat /etc/udev/rules.d/94-pickit2.rules
    #PICKIT2 and pk2cmd Rules to allow all users to access
    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",SYSFS{idVendor}=="04d8" , SYSFS{idProduct}=="0033", MODE="0666"
    ~ #
    <snip>

    You need the udev rules to make things persistent over reboots and also automatic when you plug the device in. Give it a go and let us know?
    Last edited by sarlacii; 01-16-2018 at 08:46 AM. Reason: removed comment from code
    Respectfully... Sarlac II
    ~~
    The moving clock K' appears to K to run slow by the factor (1-v^2/c^2)^(1/2).
    This is the phenomenon of time dilation.
    The faster you run, the younger you look, to everyone but yourself.

Posting Permissions

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