Category Archives: Linux

Geting USBasp v2.0 to work on Linux


I recently bricked by Arduino Uno board and any attempt to upload new sketch will produce and error. I had tried to reflash the firmware multiple times using my serial programmer that I build a while back but no luck getting it to work. I end up purchasing a USBasp v2.0 programmer from eBay.

USBASPV2.0

USBasp v2.0 should work right out of the box on Linux in most cases. On Arduino IDE, you only need to sett the following:

Board: Arduino/Genuino Uno
Programmer: USBasp

The Port setting is not used and the menu item should be grayed out. You should be able to burn bootloader or upload Sketch using the USBasp programmer with the above settings.

Or reflash the boot loader from command line.

/path/to/arduino-1.8.2/hardware/arduino/avr/bin/avrdude -C/path/to/arduino-1.8.2/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cusbasp -Uflash:w:/path/to/arduino-1.8.2/hardware/arduino/avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Ulock:w:0x0F:m

 

On some system. A tty device is created when USBasp is connected. In my case /dev/ttyS0. However when Port is set to /dev/ttyS0 in Arduino IDE. You will see the following errors:

avrdude: Warning: cannot open USB device: Permission denied
avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor=’www.fischl.de’ product=’USBasp’

To Fix Permission denied error. As root edit “/etc/udev/rules.d/99-USBasp.rules” with the following:

SUBSYSTEMS==”usb”, ATTRS{idVendor}==”16c0″, ATTRS{idProduct}==”05dc”,MODE=”0666″

Then restart udev.

sudo /etc/init.d/udev restart

To reflash the Arduino Uno boot loader

In the Arduino IDE Tool menu. Set the following:

Board: Arduino/Genuino Uno
Port: /dev/ttyS0
Programmer: USBasp

Then select Tools/Burn Bootloader.

 

I am currently unemployed and produce and share knowledge to help other people problems. I would like to raise some fund to get the stand alone domain for this blog. If you find these information helpful and would like to show your appreciation. Please consider Donate.

Advertisements

Installing Wings3D on Linuxmint 15


Recently I just upgraded my laptop with Linuxmint Mate 15 and found out the hard way that Wings3D is now broken and won’t install through the package manager due erlang-wx package is now no longer part of Ubuntu main due to the size foot print of wxWidgets library.

Anyway, here are the steps if you wanted to have the packe installed on your system.

1. Go to http://www.wings3d.com and follow the link to download wings-1.4.1-linux.bzip2.run.gz for Linux.
2. Unzip and run the installer

gunzip wings-1.4.1-linux.bzip2.run.gz

chmod +x wings-1.4.1-linux.bzip2.run

./wings-1.4.1-linux.bzip2.run

3. The installer will install wings3d under your home directory. Move the package to /opt

sudo mv ~/wings-1.4.1 /opt

4. Edit the bash script /opt/wings-1.4.1/wings so that ROOTDIR path is now /opt instead of your home directory and save the file.

#!/bin/sh
ROOTDIR=/opt/wings-1.4.1

5. Integrate it with desktop menu by right click on the menu and select Edit Menu.

  • In Main Menu dialog, select Graphics under Application. Click New Item to create a launcher.
  • Click on the icon and select /opt/wings-1.4.1/lib/wings-1.4.1/ebin/wings_icon_big.bmp
  • Enter Wings3D in name text box.
  • Enter /opt/wings-1.4.1/wings in Command text box.
  • Enter “Wings3D Modeling Program” in Comment Text box.
  • Click OK to save the launcher.

If you find this information helpful and would like to see more. Please show your support.