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?