Bluebie / digiusb.rb

A little ruby thing for talking to digiusb, like a serial port or like a telnet (whichever!)
The Unlicense
25 stars 5 forks source link

doesn't seem to find the digispark #7

Open tcurdt opened 9 years ago

tcurdt commented 9 years ago

I have digiterm running and the digispark is running

#include <DigiUSB.h>

void setup() {
  DigiUSB.begin();
}

void loop() {
  DigiUSB.println("hello");
  delay(1000);
}

but I it's just looking

Looking for Digispark running DigiUSB...

and then throwing an exception

/Users/user/.gem/ruby/2.2.0/gems/libusb-0.5.0/lib/libusb/constants.rb:62:in `raise_error': LIBUSB::ERROR_OTHER in libusb_init (LIBUSB::ERROR_OTHER)
    from /Users/user/.gem/ruby/2.2.0/gems/libusb-0.5.0/lib/libusb/context.rb:103:in `initialize'
    from /Users/user/.gem/ruby/2.2.0/gems/digiusb-1.0.5/lib/digiusb.rb:50:in `new'
    from /Users/user/.gem/ruby/2.2.0/gems/digiusb-1.0.5/lib/digiusb.rb:50:in `sparks'
    from /Users/user/.gem/ruby/2.2.0/gems/digiusb-1.0.5/bin/digiterm:32:in `<top (required)>'
    from /Users/user/.gem/ruby/2.2.0/bin/digiterm:23:in `load'
    from /Users/user/.gem/ruby/2.2.0/bin/digiterm:23:in `<main>'

This is on:

$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
tcurdt commented 9 years ago

Seems like product and vendor id are different. Changing them to

ProductID = 0x0753 # product id number from Digistump
VendorID = 0x16d0 # vendor id number for Digistump

I get

Attached to <Digispark:?:@20.23>
Type control + c to exit

unfortunately it's still not printing anything from the Spark.

Bluebie commented 9 years ago

Your delay is far too long. You need to use the special DigiUSB delay functions. You are making the spark freeze up for a full second, crashing the USB link.

Jenna

On 25 Aug 2015, at 7:43 am, Torsten Curdt notifications@github.com wrote:

Seems like product and vendor id are different. Changing them to

ProductID = 0x0753 # product id number from Digistump VendorID = 0x16d0 # vendor id number for Digistump I get

Attached to Digispark:?:@20.23 Type control + c to exit unfortunately it's still not printing anything from the Spark.

— Reply to this email directly or view it on GitHub.

tcurdt commented 9 years ago

@Bluebie after digging through the code I found that, too. But even with just e.g. 100ms delay it's not working.

Bluebie commented 9 years ago

100ms is very likely to be too much. Use the DigiUSB delay function, not the global one.

Jenna

On 25 Aug 2015, at 5:21 pm, Torsten Curdt notifications@github.com wrote:

@Bluebie after digging through the code I found that, too. But even with just 100ms delay it's not working.

— Reply to this email directly or view it on GitHub.

tcurdt commented 9 years ago

I changed it to

#include <DigiUSB.h>

void setup() {
  DigiUSB.begin();
}

void loop() {
  DigiUSB.println("hello");
  DigiUSB.delay(10);
}

and still get nothing but the Attached message

E3V3A commented 5 years ago

4 years too late, but the VID/PID should be:

16d0:0753   Digispark Bootlaoder
16c0:05df   DigiUSB

so check that you're using the correct drivers (if on windows).