FHEM logrotate

Hier möchte ich nur kurz meine logrotate configuration festhalten:

hgode@atom2:~$ cat /etc/logrotate.d/fhem 
/opt/fhem/log/fhem.log {
    missingok
    weekly
    copytruncate
    rotate 5
    compress
    postrotate
       /etc/init.d/fhem restart
    endscript
}

Wichtig ist, dass die Anweisung in postrotate/endscript keinen Fehler zurückmlden. Dann läuft das logrotate nämlich gar nicht!

FHEM Batteriewarnung per eMail

Nach langem hin und her und dem Lesen von vielen unvollständigen und falschen Posts (manche User können noch nicht mal richtig Texte in Posts kopieren oder schreiben irgendwas aus dem Kopf) habe ich meine eMail Warnungen für Batterien jetzt fertig. Ach ja, an alle fhem Forum Poster die Variablen benutzen: wenn es denn keine global definierten Variablen sind muss IMMER ein ‘my’ davor! Wenn Du als User also irgenwo fhem Perl Code mit einer Funktion siehst und die Variablen haben kein my davor, dann wird der wahrscheinlich so nicht funktionieren.

Im Grunde ist es ganz einfach. Man darf halt nur nicht alles ungeprüft übernehmen. Antworten zu Hilferufen (von Anfängern) im FHEM Forum sollten auch nicht mit “Lern erst mal Perl” benatwortet werden. Zudem kommt, dass die Syntax der Anweisungen mal FHEM und mal Perl ist. Dann noch der Unterschied, ob man direkt in die fhem.cfg schreibt oder über die Web Oberfläche Kommandos absetzt oder DEF Eingaben vornimmt.

Lange Rede kurzer Sinn. Hier die entsprechenden fhem.cfg Zeilen Original aus meinem laufenden fhem Server: Continue reading ‘FHEM Batteriewarnung per eMail’ »

How to enable WPA2-PSK AES on Cisco AP1231G

I own two (I know these are older ones) Cisco 1231 with a G-radio, software version 12.3(8)JEE, RELEASE SOFTWARE (fc1), cisco AIR-AP1231G-E-K9.

The APs are setup using WPA-PSK TKIP and I would like to switch to WPA2. There are many pages describing how to enable WPA2-PSK AES, but my tries to enable wpa2 always stopped with an error message.

The normal documented way to enable WPA2-PSK is:

configure terminal
dot11 ssid <SSID_NAME>
authentication open
authentication key-management wpa version 2
guest-mode
wpa-psk ascii <SSID_PASSWORD>
!
interface Dot11Radio0
encryption mode ciphers aes-ccm
ssid <SSID_NAME>
no shutdown
!

Every time I got an error entering this line:

AP1(config-ssid)#authentication key-management wpa version 2
                                                    ^ 
% Invalid input detected at '^' marker.

The trick is to ignore the “version 2”. The software will automatically use WPA2 when you enter “aes-ccm” as the encryption mode cipher. So instead of the above use the following config commands:

configure terminal
dot11 ssid <SSID_NAME>
authentication open
authentication key-management wpa
guest-mode
wpa-psk ascii <SSID_PASSWORD>
!
interface Dot11Radio0
encryption mode ciphers aes-ccm
ssid <SSID_NAME>
no shutdown
!

Thanks to Cisco not mentioning that in there standard documenation and thanks for one or two guys pointing that out in internet.

*replace the text inside the <> brackets with your SSID and password.

Mobile Development – Start apps with another using injectDLL

I already posted one article about using injectDLL, one about subclassing a foreign window. This time injectDLL is used to start and stop an application when another app is started. Remember that every DLL listed inside the MULTI_SZ registry key HKLM\System\Kernel\injectDLL is loaded into every process.

I would like to add some battery and wifi indicator to a full screen Remote Desktop Mobile (RDM) session. There are two specialized applications that display a small bar graph on the right of the screen, one for the battery level and one for the WiFi RSSI.

tsshellwnd_normal_with_wifi_and_batt_monitor_bars

The upper right one is for the WLAN RSSI and the lower bar shows the battery charge level.

As these apps should only add there display when RDM ist started, I added them to an injectDLL.

Continue reading ‘Mobile Development – Start apps with another using injectDLL’ »