Dienstag, 25. Februar 2014

xbmc remote

http://wardiesworld.wordpress.com/2012/11/14/raspbmc-samsung-remote-key-codes/
http://wardiesworld.wordpress.com/2012/09/22/raspbmc-mapping-samsung-remote/

change the "home" / title key to favourites and add your favourites on this key:

/home/pi/.xbmc/userdata/keymaps/remote.xml


/home/pi/.xbmc/userdata/favourites.xml

raspbmc TemperaturSensor DS18B20

anleitungsmix aus:
http://www.it-adviser.net/raspberry-pi-temperaturmessung-mit-ds18b20-1-wire-sensor/
und:
http://www.danielhansen.net/2013/03/raspberry-pi-temperature-logging-using.html



sudo vi /etc/modules 
#einfuegen von 
wire 
w1-gpio 
w1-therm

manuelles laden mit "insmod wire" bzw
lsmod | grep w1

cat /sys/bus/w1/devices/10-0008028ea37b/w1_slave
2b 00 4b 46 ff ff 04 10 20 : crc=20 YES
2b 00 4b 46 ff ff 04 10 20 t=21500
21.5 grad :-)

wohin geht die reise?
graph, aufzeichnungen, ...

python script zum auslesen:

#!/usr/bin/python

import os, glob, time, sys, datetime

#set up the location of the sensor in the system
#device_folder = glob.glob('/sys/bus/w1/devices/28*')
device_folder = glob.glob('/sys/bus/w1/devices/10*')

#print device_folder[1]
#device_file = [device_folder[0] + '/w1_slave', device_folder[1] + '/w1_slave']
device_file = [device_folder[0] + '/w1_slave' ]
#print device_file


def read_temp_raw(): #a function that grabs the raw temperature data from the sensor
    f_1 = open(device_file[0], 'r')
    lines_1 = f_1.readlines()
    f_1.close()
    return lines_1


print read_temp_raw()

def read_temp(): #a function that checks that the connection was good and strips out the tempera                                  ture
    lines = read_temp_raw()
    while lines[0].strip()[-3:] != 'YES':
        time.sleep(0.2)
        lines = read_temp_raw()
    equals_pos = lines[1].find('t=')
    #equals_pos = lines[1].find('t='), lines[3].find('t=')
    pos = equals_pos+2
    temp = float (lines[1][pos:] ) / 1000
    return temp

temp = read_temp() #get the temp
print 'date: ' + str(datetime.datetime.now())
print 'temp: ' + str(temp)

ps: thanks richi! ;-)

Sonntag, 9. Februar 2014

dateiliste script für ordner


#datei: z_liste.cmd mit texteditor erstellen:
chcp 65001
dir /b/o > z_liste.txt
dir /b/o/aD > z_ordnerliste.txt
dir /b/o/a-D > z_dateiliste.txt

z_liste.cmd ausführen
=> es werden 3 datein erstellt.

chcp ändert den zeichnesatz auf unicode utf8, damit bleiben dann die sonderzeichen erhalten :-)

verwendung für:
- liste für ordner/filme/musikdateien

quelle/idee: https://hpv.leo.uberspace.de/wordpress/konsole-unicode/