Duplicating/cloning an arduino chip using an "Arduino as ISP" and avrdude


So today I had to write several ATtiny85 with a small silly program I wrote years ago to control LED lighting via PWN, but the source was nowhere to be found. I could rewrite it in an afternoon, but my arduino is kind of rusty so I decided to clone an already written ATtiny85 I had around using my Arduino as ISP bought from CT3 I used for projects that didn't need a full arduino board.

Requirements:

  • An Arduino as ISP board (not necessarily the one I use)
  • avrdude installed

Some of the actions you'll run might need root permission if you've not configured serial access for your user, or if you have a newer kernel that controls access to dmesg.

First, I connect my Arduino as ISP and check the port it's been assigned:

~# dmesg|tail -n 10
[  179.219531] usb 2-3.4: reset high-speed USB device number 6 using xhci_hcd
[ 4137.875481] usb 9-4: new full-speed USB device number 2 using ohci-pci
[ 4138.064654] usb 9-4: New USB device found, idVendor=2a03, idProduct=0043
[ 4138.064661] usb 9-4: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 4138.064665] usb 9-4: Product: Arduino Uno
[ 4138.064669] usb 9-4: Manufacturer: Arduino Srl
[ 4138.064673] usb 9-4: SerialNumber: 85439303333351E02292
[ 4138.102738] cdc_acm 9-4:1.0: ttyACM0: USB ACM device
[ 4138.103861] usbcore: registered new interface driver cdc_acm
[ 4138.103865] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

So, ttyACM0, fine!

Then, we put the chip we wanna read on our ISP and read it with avrdude:

~# avrdude -p t85 -P /dev/ttyACM0 -c avrisp -b 19200 -U flash:r:flash.bin:r
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e930b (probably t85)
avrdude: reading flash memory:
Reading | ################################################## | 100% 5.89s
avrdude: writing output file "flash.bin"
avrdude: safemode: Fuses OK (E:FF, H:DF, L:62)
avrdude done.  Thank you.

Sounds about right! We've read the chip and written its contents to flash.bin. Let's swap the chip for the new empty one and write it:

~# avrdude -p t85 -P /dev/ttyACM0 -c avrisp -b 19200 -U flash:w:flash.bin
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
         avrdude: erasing chip
         avrdude: reading input file "flash.bin"
         avrdude: input file flash.bin auto detected as raw binary
         avrdude: writing flash (1280 bytes):
         Writing | ################################################## | 100% 1.83s
         avrdude: 1280 bytes of flash written
         avrdude: verifying flash memory against flash.bin:
         avrdude: load data flash data from input file flash.bin:
         avrdude: input file flash.bin auto detected as raw binary
         avrdude: input file flash.bin contains 1280 bytes
         avrdude: reading on-chip flash data:
         Reading | ################################################## | 100% 0.93s
         avrdude: verifying ...
         avrdude: 1280 bytes of flash verified
         avrdude: safemode: Fuses OK (E:FF, H:DF, L:62)
         avrdude done.  Thank you.

Great! You're good to go! :D

Flash no ha muerto [ójala]


No, Flash no ha muerto. Sólo ha cambiado de nombre.

Ya he visto unas cuantas veces publicado hoy que Flash ha muerto, especialmente en ‘redes de blogs’, esos espacios de escritura a destajo y falta de información contrastada. Ya me gustaría que se acabara con Flash, siendo uno de los problemas de seguridad más comunes en los equipos de escritorio. Mis ordenadores nuevo ya no tienen Flash instalado. Too bad.

Sí, es cierto que dicen que van a apoyar la pproducción en formato HTML5, pero ni siquiera se han terminado de leer la breve nota de prensa que claramente dice “… while continuing to support the creation of Flash content…” “…Flash continues to be used in key categories like web gaming and premium video, where new standards have yet to fully mature…” “…Adobe is committed to working with industry partners,[…], to help ensure the ongoing compatibility and security of Flash content”.

Algunos se han molestado un poquito más en hacerlo mejor.

En fin. Al menos está un poquito más cerca de su defunción. Espero.

Waldorf nw1 specs leaked on web


/images/nw_1_front.thumbnail.jpg

Today we’ve seen a short video about some of the new releases expected for Waldorf, probably for NAMM 2015. Everybody seemed curious and surprised about the new eurorack module nw1 on video, so I’ve been tinkering around Waldorf web page until I’ve found, hidden, the link with the specs:

Specifications:

  • 21st century advanced wavetable engine
  • Cyclic wavetable scanning with modulatable position and travel speed
  • Control of spectral envelope independent of pitch
  • Adjustable periodicity up to noisy reproduction
  • Classic Waldorf wavetables included
  • Integrated speech synthesizer for wavetables
  • User-recordable wavetables

click to read the rest of the article …

LibreOffice Impress missing sidebar icons on Linux Mint


I’ve noticed after several Mint updates my sidebar icons on Impress were missing, that is, blank. The fix is super easy, you just need to install the package libreoffice-style-tango:

sudo apt-get install libreoffice-style-tango

And that’s all!

You can check, just to be sure, on the menu Tools/options/View, which style is selected.

Go!

Upgrading Proxmox without a subscription


Now, to update Proxmox to the latest versions you need a paid subscription. I don’t mind, it’s a way of supporting their business and they still allow you to download their latest version on an ISO to download.

The subscription is fairly cheap for a production site and their support, AFAIK, is fast.

I have paid subscriptions for my production servers, but I have several testing and development ones I don’t need it, but I would like to update, every once in a while, to newer versions without reinstalling. So the answer is easy: update with the Proxmox ISO.

Backup first!

– Download the latest Proxmox ISO – Mount it on the system as a loop fs:

mount proxmox-ve_3.3.iso /mnt -oloop

– Edit your /etc/apt/sources.list and add this line:

deb file:///mnt squeeze pve

– Update your apt:

apt-get update

– Do dist-upgrade:

apt-get dist-upgrade

– Comment the line you added on /etc/apt/sources.list, reboot, and you’re good to go!

Debian 7 minimal + Kolab MySQL install problem


So I was installing Kolab over an OpenVZ Debian 7 Minimal image on Proxmox, and half the install I find this error:

Stopping MySQL database server: mysqld.
/var/lib/dpkg/info/mysql-server-5.5.postinst: line 146: logger: command not found
ATTENTION: An error has occured. More info is in the syslog!
/var/lib/dpkg/info/mysql-server-5.5.postinst: line 236: logger: command not found
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
 Package mysql-server-5.5 is not configured yet.

So the postinstall scripts found something they are not able to run. I’ve been scratching my head for a while until I found on a russian website I needed the bsdutils package:

apt-get install bsdutils

And done!

php-fmp : Permission denied when accessing to socket


Since last 5.5.12 update for php-fpm you might find you cannot run php webs on your host and you might find messages similar to this on your logs:

connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream

Fixing bug #67060 they changed the default behaviour for FPM when creating its sockets. You probably used to have in you config file two lines like this:

user = www-data
group = www-data

While this created both the process and the socket file with that user and group, now it does it only for the process, and the socket file is created by default with root as an owner.

Now you have to add this, changing to the appropriate user if needed:

listen.owner = www-data
listen.group = www-data

And restart your php-fpm process.

Thanks!

Checkpoint SNX client and libstdc++5 under Ubuntu Trusty


The VPN client Checkpoint has for their products is a royal pain in the ass to run, so probably you’ve found that the easier way to connect one of those systems is using their command line client (snx): it doesn’t rely on java or activex (yikes), it’s faster to install, it doesn’t nag you every other connection to update, you can open and close you browser without worries…

But if you’ve been updating your Ubuntu Linux to 14.04 or your Mint Linux to 17, you might have found this error:

~  snx
snx: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

This is because snx is compiled using gcc 3, instead of the very common version 4 right now, so you need to install libstdc++5. But that’s not enough, lets check its dependencies:

~  sudo ldd /usr/bin/snx
    linux-gate.so.1 =>  (0xf774d000)
    libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf75f3000)
    libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf75d7000)
    libresolv.so.2 => /lib/i386-linux-gnu/libresolv.so.2 (0xf75be000)
    libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf75b9000)
    libpam.so.0 => /lib/i386-linux-gnu/libpam.so.0 (0xf75aa000)
    libnsl.so.1 => /lib/i386-linux-gnu/libnsl.so.1 (0xf7591000)
    libstdc++.so.5 => not found
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf73e1000)
    libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf73bf000)
    /lib/ld-linux.so.2 (0xf774e000)
    libaudit.so.1 => /lib/i386-linux-gnu/libaudit.so.1 (0xf739a000)
    libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf7396000)
    libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf738f000)

As you can see, all the dependencies are 32 bit (i386), so, you need to install the specific 32 bit version of that library, this way:

~ apt-get install libstdc++5:i386

Then, said message should go away and let you connect. In case you are missing any other library, remember installing the 32 bit version appending the ‘:i386’ part to the name of the package.

Good luck!

Checking / decoding a PEM certificate


Did you ever end up with a bunch of PEM files from your SSL certificates? Don’t you know which one corresponds to which domain, or where do they expire?

Decode them as simple as this command:

openssl x509 -in certificate.crt.pem -text -noout