Author Topic: Unable to see Digispark on USB bus  (Read 11972 times)

EMk

  • Newbie
  • *
  • Posts: 13
Re: Unable to see Digispark on USB bus
« Reply #15 on: August 31, 2013, 12:22:14 am »
Hey digistump,

It took a litlte longer(I had to install desktop UI, ia32libs, vnc etc) to get a GUI desktop installed on my Ubuntu server to get arduino to run... and even then, I had to battle with java and... well, I got the DigiSpark version of Arduino to compile the code, but it is failing on the download with this outpu:

Binary sketch size: 5,230 bytes (of a 6,012 byte maximum)
Running Digispark Uploader...
Plug in device now... (will timeout in 60 seconds)
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 16% complete
connecting: 22% complete
connecting: 28% complete
connecting: 33% complete
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 50% complete
> Erasing the memory ...
erasing: 55% complete
erasing: 60% complete
erasing: 65% complete
> Starting to upload ...
>> Abort mission! An error has occured ...
>> Please unplug the device and restart the program.

if I try to compile after launching as su, I get compile errors on TinyWireM_Digispark library.  I'll try to work on getting it to work under sudo later this week.

Hey Bluebie,

Thanks for the heads up, the ports I'm using are from the internal USB headers on the motherboard - they are connected to the front panel of my case and they're USB2.0.  I don't have any powered hubs at the moment, but I will try the rear motherboard mounted USB2.0 and a single USB3.0 port when I get a chance.


Thanks in advance!

EMk

  • Newbie
  • *
  • Posts: 13
Re: Unable to see Digispark on USB bus
« Reply #16 on: September 17, 2013, 09:38:54 pm »
Hi,


It's been some time, but I finally had some time to play with the digiSpark.  I have been able to get it to download sketches FROM Ubuntu, successfully and I think I have an idea as to what is happening(no clue how to fix it though).


It definitely seems power related ???

on Ubuntu, when I directly plug it into a port on the Chasis, lsusb does not recognize the device.  When I plug in a USB hub, the hub gets enumerated.


The hub is one with an optional external power plug.  If I plug in just the hub, unpowered, DigiSpark(with DigiUSB2LCD) code will start.  However, LCD display is dim, and it the DigiUSB communication does not work.  send/receive commands return with "DigiSpark not found".


When the hub is powered(this one has a plug that provides 2A at 5V, the LCD is brightly lit.  I can see individual pixels.  Also, DigiUSB communication does work.


Of course, when I try this on my Windows box, it works, the LCD is not as bright as powered hub, but it is brighter than the unpowered hub on Ubuntu.


So... it looks like the problem is the following(I'm not an expert on USB protocol, so all of the following is my theory)


DigiSpark does not properly enumerate on Linux(Ubuntu).  On windows, I had to install a driver to get DigiSpark to get recognized.  My guess is that w/o a proper USB enumeration process, the USB port is providing the bare minimum amps(100mA?), just enough to power the DigiSpark, but struggles on DigiUSB + DigiLCD + DigiSpark combo.  I would further guess that by using a hub, the hub properly enumerates as a USB device and the power on that USB port increases, which the DigiSpark rides on.




As for potential solutions(and this is what I want to ask you all if you agree with my theory);
  • Create a boost circuit on the that sits between the USB and the DigiSpark to increase power(maybe with a supercap?)
  • See if there is a way to inject code into the kernel/USB module to have linux treat DigiSpark as a device that requires higher amperage power?
I tried playing with libusb-dev + hubctrl ([size=78%]http://www.gniibe.org/oitoite/ac-power-control-by-USB-hub/hub-ctrl.c[/size]) but since lsusb does not recognize when DigiSpark is plugged in, it's hard to determine where the DigiSpark is plugged in. 


Maybe if it's a fixed device on a fixed port?


Not sure, now I'm rambling.


What do you all think?