Author Topic: Can't upload to DigiSpark on Ubuntu  (Read 14248 times)

PaulRB

  • Newbie
  • *
  • Posts: 7
Can't upload to DigiSpark on Ubuntu
« on: May 29, 2017, 04:52:18 am »
Hi all, just received my first DigiSpark, can't get upload to work and would appreciate some pointers what to try next.

I am an experienced Arduino user (mainly use Nano 3, Wemos D1 mini, ATTiny84/85 via USBAsp). I am using Arduino IDE 1.16.11, DigiStump AVR boards package 1.6.7 on Ubuntu 14.04 LTS (64-bit)

I installed the UDEV rules and the Digispark seemed to be recognised ok initially, because lsusb gave me something that said "DigiStump" or "DigiSpark" (sorry, I did not make a note of exactly what it said). However, that no longer appears. I have tried restarts and sudo udevadm control --reload-rules, but I cannot get the DigiSpark related device to re-appear in lsusb. In fact, nothing appears when I plug the DigiSpark in, by which I mean nothing new appears in lsusb.

I'm not sure what I did that caused the device to disappear from the usb device list. I was working my way through the Linux Troubleshooting guide, so it might have been when I tried sudo apt-get install lib32stdc++6, but I've no idea why that would cause an issue.

The Digispark itself seems OK. Its power led comes on immediately it is plugged in, and after 5s, the other red led starts flashing at about 2Hz. The USB cable is good, I just re-tested it by uploading a sketch to a Wermos D1 mini. No circuit connected to the DigiSpark at present.

Any suggestions from other Ubuntu users would be especially useful.

Thanks!

Paul


« Last Edit: May 29, 2017, 04:58:24 am by PaulRB »

PaulRB

  • Newbie
  • *
  • Posts: 7
Re: Can't upload to DigiSpark on Ubuntu
« Reply #1 on: June 10, 2017, 03:32:06 am »
Thanks for the suggestion Ralf. Here's the output of "sudo dmesg -c":
Code: [Select]
[  612.040846] usb 3-3: new low-speed USB device number 16 using ohci-pci
[  612.180761] usb 3-3: device descriptor read/64, error -62
[  612.424622] usb 3-3: device descriptor read/64, error -62
[  612.664489] usb 3-3: new low-speed USB device number 17 using ohci-pci
[  612.804405] usb 3-3: device descriptor read/64, error -62
[  613.048264] usb 3-3: device descriptor read/64, error -62
[  613.288129] usb 3-3: new low-speed USB device number 18 using ohci-pci
[  613.695894] usb 3-3: device not accepting address 18, error -62
[  613.831822] usb 3-3: new low-speed USB device number 19 using ohci-pci
[  614.239586] usb 3-3: device not accepting address 19, error -62
[  614.239663] hub 3-0:1.0: unable to enumerate USB device on port 3

I'm not particularly familiar with these messages, so I plugged in a known working Wemos D1 mini using same port & cable for comparison:
Code: [Select]
[  758.337158] usb 3-3: new full-speed USB device number 20 using ohci-pci
[  758.502247] usb 3-3: New USB device found, idVendor=1a86, idProduct=7523
[  758.502259] usb 3-3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[  758.502266] usb 3-3: Product: USB2.0-Serial
[  758.526288] usbcore: registered new interface driver usbserial
[  758.526304] usbcore: registered new interface driver usbserial_generic
[  758.526315] usbserial: USB Serial support registered for generic
[  758.528486] usbcore: registered new interface driver ch341
[  758.528501] usbserial: USB Serial support registered for ch341-uart
[  758.528520] ch341 3-3:1.0: ch341-uart converter detected
[  758.551306] usb 3-3: ch341-uart converter now attached to ttyUSB0

Have i got a faulty digiSpark? I'm going to order another one from a different supplier for comparison.
« Last Edit: June 10, 2017, 04:00:42 am by PaulRB »

KASA

  • Newbie
  • *
  • Posts: 34
Re: Can't upload to DigiSpark on Ubuntu
« Reply #2 on: June 11, 2017, 04:07:02 am »
Total Linux noob here, I only have a Raspi, but it looks like the bootloader is broken (" device descriptor read/64, error -62 ")...
Is it a fake one or an original? Do you have a Windows machine to try it there?

PaulRB

  • Newbie
  • *
  • Posts: 7
Re: Can't upload to DigiSpark on Ubuntu
« Reply #3 on: June 11, 2017, 12:25:43 pm »
Hi Kasa. At the price I paid, it's certain to be "clone".

I do have a pc I can boot into Win7, but I don't have Arduino or anything installed. What were you going to suggest?

KASA

  • Newbie
  • *
  • Posts: 34
Re: Can't upload to DigiSpark on Ubuntu
« Reply #4 on: June 11, 2017, 02:08:46 pm »
I would try if Windows recognises the Spark and if it doesnt, The Bootloader is broken. Then I would try to buy some ISP like the USBASP and try to Flash the Bootloader. If it does recognise it, Linux has some Problems.
(1) Driver (unlikely if it shows some errors with dmesg)
or
(2) The Digispark doesnt Follow the USB standard very accurately and Linux isnt ok with that but Windows is.
or
(3) Something Else and I have no clue
the Most likely thing is the Bootloader I guess.
Try it out...
« Last Edit: June 11, 2017, 02:13:42 pm by KASA »

PaulRB

  • Newbie
  • *
  • Posts: 7
Re: Can't upload to DigiSpark on Ubuntu
« Reply #5 on: June 12, 2017, 02:43:01 pm »
OK, thanks for the suggestions.

On Win7, I downloaded the driver from here

I unzipped and ran the DPinst64 installer. When that eventually finished (having pressed "install" about half a dozen times over), I plugged in the Digispark. Windows made a "USB device plugged in" noise. Checking the Device Manager, I see that an "Unknown Device" has appeared under "Universal Serial Bus Controllers" with a yellow warning symbol. Right clicking on this, I choose "Update Driver Software", then "Browse my computer". I go to the folder where I unzipped the download file and click Next. The message says "windows has determined the driver software for your device is up to date".

The Unknown Device disappears from Device manager when I unplug the digispark.

So does this indicate a broken bootloader?

I have a USBasp. Can you point me to some instructions for re-uploading the bootloader please? (Ideally using Linux...)
« Last Edit: June 12, 2017, 02:46:22 pm by PaulRB »

KASA

  • Newbie
  • *
  • Posts: 34
Re: Can't upload to DigiSpark on Ubuntu
« Reply #6 on: June 14, 2017, 03:01:50 am »
Yes, I guess the Bootloader is broken...
This is the Bootloader that should be on the Spark: https://github.com/micronucleus/micronucleus
You Need AVRdude to burn it. Since I have no clue about Linux I cant Tell you how you can get it but i guess there are tutorials online.

KASA

PaulRB

  • Newbie
  • *
  • Posts: 7
Re: Can't upload to DigiSpark on Ubuntu
« Reply #7 on: June 14, 2017, 10:35:42 am »
Thanks Kasa,

My replacement DigiSpark arrived today. This was from a different eBay supplier. Same errors as the first:
Code: [Select]
paul@paulsPC:~$ sudo dmesg -c
[  118.702980] usb 3-3: new low-speed USB device number 4 using ohci-pci
[  118.842901] usb 3-3: device descriptor read/64, error -62
[  119.086758] usb 3-3: device descriptor read/64, error -62
[  119.326622] usb 3-3: new low-speed USB device number 5 using ohci-pci
[  119.466542] usb 3-3: device descriptor read/64, error -62
[  119.710401] usb 3-3: device descriptor read/64, error -62
[  119.950269] usb 3-3: new low-speed USB device number 6 using ohci-pci
[  120.358017] usb 3-3: device not accepting address 6, error -62
[  120.493952] usb 3-3: new low-speed USB device number 7 using ohci-pci
[  120.901736] usb 3-3: device not accepting address 7, error -62
[  120.901788] hub 3-0:1.0: unable to enumerate USB device on port 3

I will re-try on Win7.

PaulRB

  • Newbie
  • *
  • Posts: 7
Re: Can't upload to DigiSpark on Ubuntu
« Reply #8 on: June 14, 2017, 10:42:06 am »
Same issue on Win7...

KASA

  • Newbie
  • *
  • Posts: 34
Re: Can't upload to DigiSpark on Ubuntu
« Reply #9 on: June 14, 2017, 02:35:46 pm »
Did you try a different USB Port or an USB Hub? I don't think two Ebay suppliers send damaged Digisparks... I tried two suppliers and both worked... Where did you get them?
KASA

PaulRB

  • Newbie
  • *
  • Posts: 7
Re: Can't upload to DigiSpark on Ubuntu
« Reply #10 on: June 15, 2017, 11:49:43 am »
No, but I did try the same port & cable with the Wemos, which proved both are good (the Wemos was recognised and I was able to upload a sketch).

I purchased the digisparks from here and here.

KASA

  • Newbie
  • *
  • Posts: 34
Re: Can't upload to DigiSpark on Ubuntu
« Reply #11 on: June 16, 2017, 01:11:56 pm »
Could you try it on a different USB port? Maybe the Wemos is more tolerant to USB specification violations or something like that. My Arduino Micro for example doesn't work on USB 3 ports even if USB 3 should be downward compatible... Please try it!

KASA

KASA

  • Newbie
  • *
  • Posts: 34
Re: Can't upload to DigiSpark on Ubuntu
« Reply #12 on: June 21, 2017, 10:59:09 am »
I bought digisparks from 2 chinese sellers myself and all worked... Im not to sure if this is a problem with the digispark or something else.
Just to be clear, please support Digistump! The Problem for me is, if I would buy there shipping would cost more than a digispark so I buy them in china... But to Help them a little bit I try to help in the Forum  ;)