Linux Troubleshooting - buguno/Digispark-RubberDucky GitHub Wiki

libusb

If your sketch uses DigiUSB to communicate with the PC, you need both the legacy 0.1 version of libusb and version 1.0(http://www.libusb.org/). For compiling the DigiUSB programs, also ensure the package libusb-compat-devel is installed.

If you are getting an error (especially on ubuntu) when compiling or uploading sketches - try installing libusb and possibly lib32stdc on linux - (on ubuntu get it by issuing: apt-get install lib32stdc++6)

Permissions

Try running Arduino as root. If possible try the whole process as root.

If using Ubuntu or similar try the step below, if not make sure you have proper permission for the device.

Bad permissions generally cause the “Abort mission! -1 error has occurred …” error during upload. “micronucleus: library/micronucleus_lib.c:63: micronucleus_connect: Assertion `res >= 4' failed.” is also a result of bad permissions.

Ubuntu Troubleshooting

Ubuntu and other modern Linux distibutions use udev to manage device files when USB devices are added and removed. By default, udev will create a device with read-only permission which will not allow to you download code. You must place the udev rules below into a file named /etc/udev/rules.d/49-micronucleus.rules

# UDEV Rules for Micronucleus boards including the Digispark.
# This file must be placed at:
#
# /etc/udev/rules.d/49-micronucleus.rules    (preferred location)
#   or
# /lib/udev/rules.d/49-micronucleus.rules    (req'd on some broken systems)
#
# After this file is copied, physically unplug and reconnect the board.
#
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", GROUP="dialout"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
#
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.

Perhaps it's necessary to reload the rules as root.

udevadm control --reload-rules

References