Show Posts
Pages: 1 ... 205 206 [207] 208 209 ... 232
3091  Forum 2005-2010 (read only) / Troubleshooting / Re: retreve script on: May 10, 2010, 03:21:42 pm
If you have flashed the Arduino it implies the source was on your disk at one point in time. If you did not write to much after the crash you could still try to recover it. I would suggest to try Photorec http://www.cgsecurity.org/wiki/PhotoRec. This tool really rocks.

Otherwise you may want to have a look here: http://www.forensicswiki.org/wiki/Main_Page.

Udo
3092  Forum 2005-2010 (read only) / Troubleshooting / Re: time to switch between 0 and 1 and viceversa on: April 03, 2010, 08:47:41 am
25ms is a lot of time. The Arduino is definitely fast enough. This looks like an issue with you camera.

Udo
3093  Forum 2005-2010 (read only) / Troubleshooting / Re: Avrdude issue with ispmkii and Ubuntu 9.10 on: April 03, 2010, 10:37:57 am
Forget this question. The problem disapeared after I switched off my paper shredder. No clue if and/or why the shredder caused this issue. In theory it shouldn't...

Udo
3094  Forum 2005-2010 (read only) / Troubleshooting / Avrdude issue with ispmkii and Ubuntu 9.10 on: April 03, 2010, 09:01:23 am
Today I upgraded from Ubuntu 9.04 to 9.10. Everything works fine but the ISP. Avrdude complains as follows:

Code:
/usr/bin/avrdude -V -p atmega644   -c stk500v2 -P usb       \                                                                                                                                            
                        -U flash:w:build/UltimateTrigger.hex:i                                                                                                                                          
avrdude: stk500v2_recv_mk2: error in USB receive                                                                                                                                                        
avrdude: stk500v2_recv_mk2: error in USB receive                                                                                                                                                        

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9609
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.                        
avrdude: current erase-rewrite cycle count is 33559552 (if being tracked)      
avrdude: erasing chip
avrdude: reading input file "build/UltimateTrigger.hex"
avrdude: writing flash (54362 bytes):

Writing | ################################################## | 100% 3.01s

avrdude: 54362 bytes of flash written

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

The issue is not that I can not upload. The issue is that it takes quite a while for the
Code:
avrdude: stk500v2_recv_mk2: error in USB receive

errors to show up. Once they show up it continues to upload. Has anyone an idea why I get these strange errors and how to get rid of them? Interestingly they do not show up on the first upload. However successive uploads get this penalty.

Udo
3095  Forum 2005-2010 (read only) / Troubleshooting / Re: help with project on: March 30, 2010, 01:38:09 pm
A board? I would expect to do this with free software. On the PC autoit http://www.autoitscript.com/autoit3/index.shtml will do the trick. AHK will do it as well. If a keyboard does not look good enough the next step would be to rip a cheap keyboard apart and immediately get 100 keys or so. Cool idea digimike. Definitely better than to go for Arduino. Seems we are sometimes to focused on doing everything with out golden hammer smiley

Udo
3096  Forum 2005-2010 (read only) / Troubleshooting / Re: help with project on: March 29, 2010, 04:21:43 pm
Write a sketch that read the digital ports in an endless loop and sends the results thorugh the serial interface to your computer.

If this is not enough of a hint: try some of the example sketches.

Udo
3097  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: February 03, 2010, 01:06:08 pm
The answer is yes and yes.

You may want to read the following two threads:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263243210/3
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1223527587

Bottomline: do not use AVRdude to set SCK to 0 if you do not want to boot Windows.

Use AVRstudio for maximum ISP speed setup (it will be retained).

Go for the teensy or a modified bootloader if you want to flash fast without ISP.

Cheers, Udo
3098  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: February 02, 2010, 01:41:49 pm
One afterthought: it took me >2 months till I got it that I can flash very much faster if I use AVRstudio to setup the MKII to write with 4 Mhz. Now I can flash 40k in <3s.

I mentioned this elsewhere but since this thread seems to be read quite a lot I wanted to add this here as well.
3099  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: October 21, 2009, 02:35:20 pm
With regard to the /dev/serial/by-id: this is cool, for the arduino this means that I would not have needed any rule. So maybe I will just drop it. But for the prolific this is not enough. Uniqueness is not what I need. What I need are persistent (in time) IDs. This is not guaranteed by this approach.

So I will keep searching. But at least my initial problem is solved. And some others are now solved as well. The prolific issue is only a minor nuisance. Somewhere at the end of my list.
3100  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: October 21, 2009, 11:07:20 am
Ok, I got

Code:
/etc/udev/rules.d# lsusb -vvv -d 067b:2303

Bus 004 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            3.00
  iManufacturer           1 Prolific Technology Inc.
  iProduct                2 USB-Serial Controller
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)



/etc/udev/rules.d# udevadm info --attribute-walk --name=/dev/ttyUSB1
 
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/ttyUSB1/tty/ttyUSB1':
    KERNEL=="ttyUSB1"
    SUBSYSTEM=="tty"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/ttyUSB1':
    KERNELS=="ttyUSB1"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="pl2303"
    ATTRS{port_number}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0':
    KERNELS=="4-1:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="pl2303"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="03"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bInterfaceSubClass}=="00"
    ATTRS{bInterfaceProtocol}=="00"
    ATTRS{modalias}=="usb:v067Bp2303d0300dc00dsc00dp00icFFisc00ip00"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1':
    KERNELS=="4-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{urbnum}=="20"
    ATTRS{idVendor}=="067b"
    ATTRS{idProduct}=="2303"
    ATTRS{bcdDevice}=="0300"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="4"
    ATTRS{devnum}=="9"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Prolific Technology Inc."
    ATTRS{product}=="USB-Serial Controller"

  looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4':
    KERNELS=="usb4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="188"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0001"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="4"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="2"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.28-15-generic uhci_hcd"
    ATTRS{product}=="UHCI Host Controller"
    ATTRS{serial}=="0000:00:1d.2"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:1d.2':
    KERNELS=="0000:00:1d.2"
    SUBSYSTEMS=="pci"
    DRIVERS=="uhci_hcd"
    ATTRS{vendor}=="0x8086"
    ATTRS{device}=="0x27ca"
    ATTRS{subsystem_vendor}=="0x17aa"
    ATTRS{subsystem_device}=="0x200a"
    ATTRS{class}=="0x0c0300"
    ATTRS{irq}=="18"
    ATTRS{local_cpus}=="ffffffff,ffffffff"
    ATTRS{local_cpulist}=="0-63"
    ATTRS{modalias}=="pci:v00008086d000027CAsv000017AAsd0000200Abc0Csc03i00"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

--> you are right. The serial is not set  smiley-sad

So I have to search a tool to set it. Maybe there is a similar tool for the prolifics as for the arduino's FTDI. Let's see.
3101  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: October 21, 2009, 10:36:24 am
Now I renamed my rules to not start with numbers --> without changing any rule content avrispmkii works as desired.

Then  I removed the symlink part of the avrisp rule --> it does not show up anymore at all.

In addition I changed the comment as suggested to FTDI and added the missing prolific entry.

Code:
/etc/udev/rules.d# cat programmer.rules

#Set permissions for the AVRIspMKII programmer granting read- and write-access for every user
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2104", MODE="0666"


/etc/udev/rules.d# cat usb-serial-adapters.rules
# add symlink for prolific serial adapters to show up with serial number
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="ttyUSB-$attr{serial}"

# add symlink for FTDI serial adapters to show up with serial number
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="ttyArduino-$attr{serial}"

/etc/udev/rules.d# ls -l /dev/ttyUSB* /dev/ttyArduino*
lrwxrwxrwx 1 root root         7 2009-10-21 17:20 /dev/ttyArduino-A7004mO1 -> ttyUSB0
lrwxrwxrwx 1 root root         7 2009-10-21 17:25 /dev/ttyUSB- -> ttyUSB1
crw-rw---- 1 root dialout 188, 0 2009-10-21 17:20 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 2009-10-21 17:25 /dev/ttyUSB1

So now it works almost as desired: the mkii works for non root users, the arduino / freeduinos show up with serial numbers. The only thing that is still bugging me is why the ttyUSB shows an empty serial numbers. I will investigate this with udevadm and will report what I find out.

With regard to the question what I am using: I use Ubuntu 9.04.

3102  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: October 21, 2009, 10:34:16 am
Now I renamed my rules to not start with numbers --> without changing any rule content avrispmkii works as desired.

Then  I removed the symlink part of the avrisp rule --> it does not show up anymore at all.

In addition I changed the comment as suggested to FTDI and added the missing prolific entry.

Code:
/etc/udev/rules.d# cat programmer.rules

#Set permissions for the AVRIspMKII programmer granting read- and write-access for every user
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2104", MODE="0666"


/etc/udev/rules.d# cat usb-serial-adapters.rules
# add symlink for prolific serial adapters to show up with serial number
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="ttyUSB-$attr{serial}"

# add symlink for FTDI serial adapters to show up with serial number
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="ttyArduino-$attr{serial}"

/etc/udev/rules.d# ls -l /dev/ttyUSB* /dev/ttyArduino*
lrwxrwxrwx 1 root root         7 2009-10-21 17:20 /dev/ttyArduino-A7004mO1 -> ttyUSB0
lrwxrwxrwx 1 root root         7 2009-10-21 17:25 /dev/ttyUSB- -> ttyUSB1
crw-rw---- 1 root dialout 188, 0 2009-10-21 17:20 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 2009-10-21 17:25 /dev/ttyUSB1

So now it works almost as desired: the mkii works for non root users, the arduino / freeduinos show up with serial numbers. The only thing that is still bugging me is why the ttyUSB shows an empty serial numbers. I will investigate this with udevadm and will report what I find out.

With regard to the question what I am using: I use Ubuntu 9.04.

3103  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: October 20, 2009, 02:39:09 pm
By now I have somewhat mixed success and I am somewhat confused.

I have added two files:

Code:
udo@laptop:/etc/udev/rules.d$ cat 30-programmer.rules

#Set permissions for the AVRIspMKII programmer granting read- and write-access for every user
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2104", MODE="0666", SYMLINK+="avrispmkII-%n"

udo@laptop:/etc/udev/rules.d$ cat 38-usb-serial-adapters.rules
 
# add symlink for prolific serial adapters to show up with serial number
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="ttyUSB-$attr{serial}"

The usb serial adapters file works as expected:

Code:
udo@laptop:/dev$ ls -l ttyUSB*
crw-rw---- 1 root dialout 188, 0 2009-10-20 21:18 ttyUSB0
lrwxrwxrwx 1 root root         7 2009-10-20 21:18 ttyUSB-A7004mO1 -> ttyUSB0

So this works and I think I understand why.

But the other one does not at all work as expected:
Code:
udo@laptop:/dev$ ls -l avr* usbdev2.4*
lrwxrwxrwx 1 root root      14 2009-10-20 21:23 avrispmkII-00 -> usbdev2.4_ep00
lrwxrwxrwx 1 root root      14 2009-10-20 21:25 avrispmkII-02 -> usbdev2.4_ep02
lrwxrwxrwx 1 root root      15 2009-10-20 21:23 avrispmkII-2 -> bus/usb/002/004
lrwxrwxrwx 1 root root      14 2009-10-20 21:25 avrispmkII-82 -> usbdev2.4_ep82
crw-rw-rw- 1 root root 252, 14 2009-10-20 21:23 usbdev2.4_ep00
crw-rw-rw- 1 root root 252, 13 2009-10-20 21:25 usbdev2.4_ep02
crw-rw-rw- 1 root root 252, 12 2009-10-20 21:25 usbdev2.4_ep82

There are actually 2 issues here:
1) It creates 4 symlinks for one programmer and I do not understand why
2) I still need to run avrdude as root and I do not understand why. The error it gives is:
Code:
udo@laptop:/etc/udev/rules.d$  avrdude -t -p m328p -P usb -c avrispmkII
avrdude: usb_open(): cannot read serial number "error sending control message: Operation not permitted"
avrdude: usb_open(): cannot read product name "error sending control message: Operation not permitted"
avrdude: usbdev_open(): error setting configuration 1: could not set config 1: Operation not permitted
avrdude: usbdev_open(): did not find any USB device "usb"

Once I add sudo it immediately works. So the rule does not fix my initial problem. Do you have any  hints why (1) and (2) happen and how to fix them?
3104  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: October 02, 2009, 02:16:37 pm
Way cool. I have to try this immediately after my vacation smiley
3105  Forum 2005-2010 (read only) / Troubleshooting / Re: AVR MKII pitfalls on: October 01, 2009, 02:01:43 pm
Great. This is really helpful advice. After figuring out that udevinfo should be called udevadm I even understand how to get hold of the attributes smiley

It gave me
Code:
 looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1':
    KERNELS=="4-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bMaxPower}==" 90mA"
    ATTRS{urbnum}=="26"
    ATTRS{idVendor}=="0403"
    ATTRS{idProduct}=="6001"
    ATTRS{bcdDevice}=="0600"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="4"
    ATTRS{devnum}=="2"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="FTDI"
    ATTRS{product}=="FT232R USB UART"
    ATTRS{serial}=="A7004mNS"

Hence

Code:
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A7004mNS", SYMLINK+="freeduino.1"

should give me a stable link to freeduino #1 right? That is you solved my issue how to enforce the proper order of the controllers.

Thank you very much!
Pages: 1 ... 205 206 [207] 208 209 ... 232