Posts on tag: elektronik
Table of contents
Xmonad on Dell XPS13 Developer Edition with Ubuntu
While my old notebook, an IBM Thinkpad T400, still works, it has a couple of problems: the battery lasts only 30 minutes, it's slow, it's too heavy and the bsd install on it is a mess. So I decided to purchase a new one. After weeks and weeks of reading reviews Dell's XPS 13 Developer Edition finally made it. It comes pre-installed with Ubuntu 14.04. Ok, I hate linux, but you know what? Fuck it. I don't have the time to fiddle with every single bit of the notebook under FreeBSD anymore. It should just work.
Ok then, how is it? In short: i love it. Everything works, wifi, setting brightness, sound etc. It's fast as hell (boot time 1 or 2 seconds), suspend works, resume as well. I don't miss anything. There were of course a couple of things I needed to tweak:
First of all, the FN Keys. There are a couple of FN Keys on the top of the keyboard (for brightness, sound settings etc). They are enabled by default. So if you press F2 to switch to desktop 2 it mutes the sound instead. In order to get the original F2 function, you need to press the FN key. That's pretty annoying. But fortunately this can be reversed in the bios.
Then I'm a xmonad user, so I wanted to have it on the XPS13 as well. Getting it to work was a mess. It's easy to install (just apt-get install xmonad), but many things in my config didn't work. I also use xmobar as the status bar - same problems, see below. Another problem was my .xprofile file. I couldn't use it because then Uniti and XFCE didn't work anymore, to which I switch from time to time (i.e. if xmonad is bricked or if I want to find out the location of a specific program).
Now, my setup looks like this: from my xmonad.hs file I execute ~/bin/x where one would normally execute xmobar. This is a script which does what previously have been done by .xprofile: it starts xscreensaver, sets the background etc. The last thing it does is to exec as xmobar and continue as expected by xmonad.
I also changed my xmobar config. It doesn't contain any commands anymore. Instead I use i3status. It runs permanently in the background (started by ~/bin/x) and prints its output into a status file. In xmobar I read the last line of that file and insert it into the status bar. This aproach is faster, more reliable and just works under linux.
I also needed to write some scripts. One is for brightness setting. Under unity setting brightness works out-of-the-box, but under xmonad it didn't. So xmonad catches the appropriate keys and executes this script. The same applies for volume setting. I also have a couple of wrapper scripts for things like shutdown, logout, reboot, lock-screen etc. All of them are reachable via ALT-p which starts ~/bin/shortmenu which itself is a wrapper for dmenu. All menu entries are scripts in ~/.shortmenu/.
Also I abandoned trayer. Most of the stuff I had there is now displayed by xmobar anyway. For wifi settings I just use unity-control-center. And I use gnome-terminal as terminal application. Don't ask me why, it just was already there.
The whole config can be downloaded here: xmonad-dell-xps13.tgz. Or view it online. Of course there's als a screenshot.
Router Update
Seit ich weiss nicht wie vielen Jahren haben wir hier einen Linksys WRT54G mit DD-WRT stehen, der eigentlich immer sehr zuverlässig war. Letzte Woche hat auf einmal das WLAN den Geist aufgegeben. Auf dem Interface waren immer TX-Errors zu sehen. Ich hab mir den Wolf gesucht und nichts gefunden. Firmware upgegraded, Antennen vertauscht, an irgendwelchen obskuren Funkwerten gedreht - nichts.
Nun hatte ich es satt und hab mir neue Hardware organisiert. Da ich unbedingt wieder etwas mit DD-WRT haben wollte, musste es irgendwas kompatibles sein. Und siehe da, bei Reichelt gabs noch einen WRT54GL neu zu kaufen! Heute ist der Neue gekommen, DD-WRT aufgespielt, alte Config wieder eingestellt, et voilá!
Hach wie schön. Nun geht die Nagiosüberwachung wieder, das MRTG vom Terrarium und so weiter, ich kann mich wieder mit dem Lappi ins Wohnzimmer hocken und - am schönsten - das ellenlange Netzwerkkabel das quer durch die ganze Bude in die Küche verlief, ist auch wieder weg :)
Arduino Adè :-)
Meine bisherigen Controllerprojekte habe ich immer mit Arduino gemacht. Ich bin damit zwar zufrieden, aber es ist doch etwas teuer. Vor allem deshalb, weil man den Arduino nachher irgendwo verbaut hat und somit nicht mehr für Experimente benutzen kann. Sehr schlecht.
So bin ich irgendwann auf AVR Controller gekommen. Eine Weile hab ich mit einem Attiny85 rumgespielt. Um den zu programmieren, hab ich mir den Diamex-USB-ISP besorgt und mir eine kleine Adapterplatine gebastelt. Das war schon ganz gut ... Aber! Ein Attiny85 macht nicht viel her, nur ein paar Pins, kein UART usw. Ich wollte also was grösseres, ein Attiny2313 musste her und ein Atmega168. Aber die haben viel mehr Pins und passen logischerweise nicht in meine Platine. Schöner Mist. Nun hätte ich mir noch eine Platine basteln können, und noch eine usw. Alles Kacke.
Zufällig habe ich myAVR entdeckt und mir die universelle Platine myMultiProg MK2 und den myMultiProg MK2 bestellt.
Und was soll ich sagen? Ich bin SOWAS von happy damit! Atmega draufgesteckt, USB Kabel rein, Port rausgesucht und ins Makefile eingetragen. "make upload" - und fertig!
Seeeehr genial. Ich bin von den Socken. Und hiermit hat sich das Thema Arduino für mich im Grunde erledigt. Ich kann zukünftig direkt mit AVR arbeiten. Und auf den Komfort muss ich nicht verzichten, ino sei Dank!
Ich hab mal mein Makefile samt bisserl Beispielcode hochgeladen. Das Makefile ist für FreeBSD, den Port sucht ein Script raus (ist dabei): Blinktest-Mega8-myAVR.