Tag Archives: Arduino Uno

Getting Arduino Uno Clone with CH340 to work on Linuxmint 19


 Please consider donate through My Amazon Wishlist

Just got sometime to upgrade my Dell T3600 and HP Probook 4520s to Linuxmint 19 and everything almost worked flawlessly.

While going through setting up my ardruino development environments. I encountered a problem. So, I will share it here.

Thing are looking much better for CH340 chipset support on Linuxmint 19. It almost worked right out of the box on my Dell T3600 desktop machine with the default ch341 kernel module. No more messing around with custom building CH34x module from source.

All that is needed on Dell T3600 is adding yourself to dialout group using the following command and you are ready to go.

sudo usermod -aG dialout $USER

On my HP Probook 4520s laptop, however I am still getting permission issue. I remember I added self to dialup group on this laptop earlier when I setup USBasp. Some how I am still see the following error.

avrdude: Warning: cannot open USB device: Permission denied

This can easily fixed by finding out the idVendor and idProduct of the Uno board when it is attached.

$ lsusb
Bus 002 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

Then create a udev rule.

sudo vim “/etc/udev/rules.d/99-CH340-USB-Serial.rules”

with the following rule

SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", GROUP="dialout"

Then add self to dialout user group.

sudo usermod -aG dialout $USER

Then logoff and login again.

Unplug your Uno clone then restart udev.

sudo /etc/init.d/udev restart

Reconnect your Uno device.

$ ls -l /dev/ttyU*
crw-rw—- 1 root dialout 188, 0 Nov 30 10:48 /dev/ttyUSB0

Sketch upload through USB should now work once you select the proper board and port:

Board: Arduino/Genuino Uno
Port: /dev/ttyUSB0

Happy hacking!

Advertisements

Geting USBasp v2.0 to work with Linuxmint


 Please consider donate through My Amazon Wishlist

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:

SUBSYSTEM=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", GROUP="dialout"

Add self to dialout user group.

sudo usermod -aG dialout $USER

Then logoff and login again.

Unplug USBasp device 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
Programmer: USBasp

Then select Tools/Burn Bootloader.