Author Topic: Can't upload sketch to Digispark  (Read 37522 times)

lincomatic

  • Newbie
  • *
  • Posts: 2
Can't upload sketch to Digispark
« on: January 07, 2013, 07:44:57 pm »
I just got my digisparks today. Downloaded the latest IDE, and installed the driver, then tried to load the blink sketch, but Arduino is giving me the following error:

Running AVRDUDE...
avrdude_original: usbdev_open(): did not find any USB device "usb"

Any ideas what's wrong?  Also, can you tell me the programmer type that's being sent to avrdude (-c argument)?

Thanks.

BTW, the digisparks are all too wide to fit directly into my dell notebook. I have to use a usb hub.
« Last Edit: January 07, 2013, 07:44:57 pm by lincomatic »

willscott

  • Newbie
  • *
  • Posts: 10
Can\'t upload sketch to Digispark
« Reply #1 on: January 07, 2013, 08:20:33 pm »
the fact that avrdude_original is being run seems like a bad sign.  that\'s presumably the original one that is supposed to be replaced with the digispark version.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Can\'t upload sketch to Digispark
« Reply #2 on: January 07, 2013, 08:25:03 pm »
@lincomatic - I think you need to set Tools->Board as Digispark AND Tools-> Programmer as Digispark

Are both of those set?

lincomatic

  • Newbie
  • *
  • Posts: 2
Can\'t upload sketch to Digispark
« Reply #3 on: January 07, 2013, 10:54:29 pm »
OK, I didn\'t have Tools->Programmer set to Digispark.  Funny, because for other boards, I only have to do that when programming the bootloader.

It kind of works now... I was able to successfully upload sketches to all 3 of my digisparks, but it\'s a frustrating process, because very often, either 1) the system doesn\'t recognize the board, and thinks it malfunctioned, or 2) the board gets out of the bootloader before it gets detected or 3) it aborts before it gets to 100%.  Is there any way to make it more reliable?  

Also, I\'m afraid I\'m going to destroy the digisparks if I have to keep unplugging/plugging them in each time I program them (especially if I have to do it 3-5x each time).  Could I just hit the reset pin instead?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Can\'t upload sketch to Digispark
« Reply #4 on: January 07, 2013, 11:13:27 pm »
This sounds like a bad USB cable or finicky port - have you tried a rear port or a USB hub, sometimes that will help. If you are using an extension cable try without it. You certainly shouldn\'t have to do more than plug it in when asked to and unplug it before uploading again.

Reset pin: there is no reset pin, though @Bluebie suggested moding a USB extension cable to have a button/switch on the power wire - you could also get a cheapo hub off ebay that has a on/off switch. That said I have several that have been plugged and unplugged thousands of times (literally) and I\'ve yet to wear them out or break them.

Russtang

  • Newbie
  • *
  • Posts: 2
Can\'t upload sketch to Digispark
« Reply #5 on: January 08, 2013, 01:47:51 pm »
My laptop is flaky and has similar issues as you describe.  My work desktop has no problems.  I have solved the laptop\'s problems by using a small powered USB hub, as Erik describes above.  

And, in a completely unrelated subject, the DMP1 is working great Sam!  :)

AlanSE

  • Newbie
  • *
  • Posts: 11
Re: Can't upload sketch to Digispark
« Reply #6 on: February 04, 2013, 06:05:08 pm »
I'm having the same nature of problem.  I followed the instructions here:

http://digistump.com/wiki/digispark/tutorials/connecting

Then I had the problem in the OP.  Then I fixed the "Tools-> Programmer as Digispark" error.  Then it compiled and asked me to plug in the digispark.  Plugged it in and Windows gives an error message that device isn't recognized.  Trying to install the drivers manually is so far fruitless.  No idea what the problem is.  I'll try it again later with another port or a powered hub and see if that changes anything.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Can't upload sketch to Digispark
« Reply #7 on: February 05, 2013, 12:40:22 am »
AlanSE -


Is the message that the device is not recognized or that it has malfunctioned?


Can you try different ports, a hub, and if you have one a USB extension cable?


Thanks,
Erik

barnacleBudd

  • Newbie
  • *
  • Posts: 21
Re: Can't upload sketch to Digispark
« Reply #8 on: February 05, 2013, 03:24:37 pm »
I had similar problems with my first attempts. I am used to the Arduino IDE and there are enough differences that it is easy to get derailed along the way.

In the end, I learned that most of my problems were in the connection between the digispark and the USB extension cable. The first time I actually had it plugged in upside down. I had to put my glasses on and look at things carefully. I have never had a USB device that could be plugged in more than one way. 8-)

I finally got it working when I realized that the connect between the USB jack and the board is loose enough that I have to wiggle it a little to make sure that the pads align correctly. Once I got that figured out it seems to work just fine.

http://mypetdigispark.blogspot.com/


AlanSE

  • Newbie
  • *
  • Posts: 11
Re: Can't upload sketch to Digispark
« Reply #9 on: February 05, 2013, 07:19:19 pm »
Mine has worked now.  At least it works occasionally.  I also need to note that I'm on Windows 7, and since my last post I've been plugging it directly into the USB on the back panel of my computer tower due to power supply concerns.


When it doesn't work it just gives this message that it didn't recognize and nothing else happens.  The editor keeps sitting there waiting for me to plug in the digispark.




This seems to almost always be the initial result.  After a few times of replugging it in, I get lucky and I get these messages instead:

First, driver not installed.


Next, driver is installed?


Third, something (driver?) crashes:


After this point the editor starts a dialogue.  This step doesn't always work either, so I'm going to share the output it gives me as it crashes two different times:

First crash:

Quote
>> Eep! Connection to device lost during erase! Not to worry
>> This happens on some computers - reconnecting...
>> (!) Automatic reconnection not working. Unplug and reconnect
   device usb connector, or reset it some other way to continue.
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 20% complete
connecting: 23% complete
connecting: 27% complete
connecting: 30% complete
connecting: 34% complete
connecting: 40% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 40% complete
parsing: 60% complete
> Erasing the memory ...
erasing: 60% complete
erasing: 60% complete
erasing: 60% complete
(NOTE: this continues for a while, I've deleted those lines)
erasing: 79% complete
erasing: 79% complete
>> Eep! Connection to device lost during erase! Not to worry
>> This happens on some computers - reconnecting...
>> (!) Automatic reconnection not working. Unplug and reconnect
   device usb connector, or reset it some other way to continue.

Another way it failed:
Quote
Binary sketch size: 776 bytes (of a 6,010 byte maximum)
Running Digispark Uploader...
Plug in device now...
Assertion failed: res >= 4, file library/micronucleus_lib.c, line 63

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
> Please plug in the device ...
> Press CTRL+C to terminate the program.

At last, here's the output from a time that it worked:

Quote
Binary sketch size: 776 bytes (of a 6,010 byte maximum)
Running Digispark Uploader...
Plug in device now...
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 20% complete
connecting: 23% complete
connecting: 27% complete
connecting: 30% complete
connecting: 34% complete
connecting: 40% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 40% complete
parsing: 60% complete
> Erasing the memory ...
erasing: 60% complete
erasing: 60% complete
(NOTE: many more lines, deleted)
erasing: 79% complete
erasing: 79% complete
>> Eep! Connection to device lost during erase! Not to worry
>> This happens on some computers - reconnecting...
>> Reconnected! Continuing upload sequence...
erasing: 80% complete
> Starting to upload ...
writing: 80% complete
writing: 80% complete
(NOTE: many more lines, deleted)
writing: 99% complete
writing: 100% complete
>> Micronucleus done. Thank you!

So I'm curious, did it have a problem half way through this upload and then fix it?  Anyway, my sketch ran after this.  I've fully soldered the RGB shield as well as the headers on the digispark.  I have it running an edited version of the test code for that shield:

http://digistump.com/wiki/digispark/tutorials/rgb

I think this is obvious from my post, I would like to see this working a little bit more consistently.  I really can't say for sure that it'll work the next time I plug it in.  Maybe this is a physical problem, it just only seems to work 1/3rd of the time and I don't know why.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Can't upload sketch to Digispark
« Reply #10 on: February 05, 2013, 11:30:52 pm »
AlanSE - I believe the problem you are having is that you need to unplug the Digispark before you hit the upload button and then not plug it in until the program tells you to.

AlanSE

  • Newbie
  • *
  • Posts: 11
Re: Can't upload sketch to Digispark
« Reply #11 on: February 06, 2013, 05:17:00 am »
No, I'm doing that.  I guess I wasn't very clear about that.

My blurb there starts where the editor has compiled the sketch and is in the waiting mode.  So then I try to plug it in, and cycle around that first error - that Windows sees a USB device that it can't recognize.  You know the sound it makes when it detects a new device, and when you unplug a device?  Imagine that on repeat for minutes while trying to physically adjust the digispark in the USB slot.  All the while, the editor is sitting there with the message that it's waiting for the digispark to be plugged in.

Then occasionally I get lucky and it proceeds to the next set of popups.  Then the editor, which had been waiting, kicks in and spits out all the text.  I've loaded a new sketch since that post, and I confirmed that every time it works it gives that same dialogue.  I was surprised by this, because why would it lose the connection at 80%... and then work?  It seems to do this consistently.

I know, I need to try it with some other operating systems now.  I have plans, but haven't got around to it yet.

hardillb

  • Newbie
  • *
  • Posts: 3
Re: Can't upload sketch to Digispark
« Reply #12 on: February 06, 2013, 05:33:27 am »
I'm getting a similar error to the first set of output posted above except I'm on Linux (Fedora 17 x64) and it is always the same.

Code: [Select]
./arduino
Gtk-Message: Failed to load module "pk-gtk-module"
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Binary sketch size: 896 bytes (of a 6,010 byte maximum)
Running Digispark Uploader...
Plug in device now...
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 40% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 60% complete
> Erasing the memory ...
erasing: 79% complete
>> Abort mission! -1 error has occured ...
>> Please unplug the device and restart the program.

I'm running as root and not inserting the device until asked to.

I have installed a 32bit JRE and the 32bit  libusb as needed.

The device flashed the onboard LED before I tried to upload a sketch, now just the power LED is on.

I am going to try on a 32bit Ubuntu machine when I can get my hands on one, but I would really like to get this to work on my normal machine.

Thanks,

GuzWaatensensen

  • Newbie
  • *
  • Posts: 2
Re: Can't upload sketch to Digispark
« Reply #13 on: February 06, 2013, 09:11:11 am »

I have encountered exactly the same problem as the above poster, though i am on a MacPro (late2009). It always stops at 79% with 3 different digiSparks... I also tried it on my iMac but there it wont be recognized.. (i assume because of the ports being USB 3)

Code: [Select]
Running Digispark Uploader...
Plug in device now...
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 20% complete
connecting: 23% complete
connecting: 27% complete
connecting: 30% complete
connecting: 34% complete
connecting: 40% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 40% complete
parsing: 60% complete
> Erasing the memory ...
erasing: 60% complete
erasing: 60% complete
erasing: 61% complete
erasing: 62% complete
erasing: 63% complete
erasing: 64% complete
[---SNIP---]
erasing: 77% complete
erasing: 78% complete
erasing: 79% complete
>> Abort mission! -1 error has occured ...>> Please unplug the device and restart the program.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Can't upload sketch to Digispark
« Reply #14 on: February 06, 2013, 11:07:52 am »
hardillb and GuzWaatensensen -  - The Abort Mission -1 error on linux (unlike the Assertion failed one that is related to permissions) - is usually related to a certain distros/copies/combos of linux and hardware/we aren't quite sure yet but it involves linux - issue that seems to be solved by a hub and often specifically a powered hub (sometimes the  USB plugs found on a monitor work as well) - can you try a hub as well as the various different ports on your machine?