mirror.sketch

The sketch for my mirror with display:

/* mirror
*
* control PWM for fan, read temperatures from DS1820 and interface to PIR
*/
#include
#include
#include // interrupt routine
#define ONE_WIRE_BUS 3 // define port for DS1820 interface
#define TEMP_DEVICE_IN 28E08F3606000003
#define TEMP_DEVICE_EX 289A78370600002C
#define TEMP_DEVICE_BOARD 2873163706000020
#define LED 4
#define PIR_INTERFACE 5 // define port for PIR
#define FANSENSE 8
#define FANPWM 9
#define THRESHOLD_OFF 25
#define THRESHOLD_LOW 30
#define THRESHOLD_HIGH 40
#define THRESHOLD_ON 45
#define TASTER_DOWN 6
#define TASTER_UP 7

DeviceAddress devices[] = {TEMP_DEVICE_IN, TEMP_DEVICE_EX, TEMP_DEVICE_BOARD };
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
int buttonPressed = 0;

void setup() {
Serial.begin(9600);// start serial port
sensors.begin();// Start up the library
for( int i=0; i < 3; i++){ sensors.setResolution(devices[i], 10);// set the resolution to 10 bit } pinMode(PIR_INTERFACE, INPUT);// read PIR status from external Board pinMode(FANSENSE, INPUT); // read RPM data from sense of FAN digitalWrite(FANSENSE, HIGH); // activate internal Pull Up pinMode(LED, OUTPUT); // LED for status info pinMode(TASTER_DOWN, INPUT); // external key for navigation input pinMode(TASTER_DOWN, INPUT); } void setLED(int pulse){ if(pulse > 0){
digitalWrite(LED, HIGH);
delay(10*pulse);
digitalWrite(LED, LOW);
delay(10*pulse);
}
}

void loop() {
/* main loop sends list of values via serial line in format:
* up/down (PIR status flag), TempExternal, TempInternal, TempBoard, RPM from Fan
*/
float Temperature = 0;
double frequency = 0;
unsigned long pulseDuration = 0;
int pirStatus = 0;
pirStatus = digitalRead(PIR_INTERFACE);
if( digitalRead(TASTER_UP) == HIGH ){
buttonPressed = 2; // up taster pressed
} else if ( digitalRead(TASTER_UP) == HIGH ) {
buttonPressed = 1; // down taster pressed
} else {
buttonPressed = 0; // no button pressed
}
if (pirStatus == HIGH) {
Serial.print("up,");
} else {
Serial.print("down,");
}
for(int i = 0; i < 3; i++){ Temperature = Temperature + sensors.getTempC(devices[i]); Serial.print(Temperature); Serial.print(","); } Temperature = Temperature / 3; // Temperature Hytherese pulseDuration = pulseIn(FANSENSE, LOW); frequency = 1000000/pulseDuration; Serial.print(frequency); Serial.println();// new line for next data // analogWrite(FANPWM, 70); //set PWM signal }

rsync setup for client backup

I am using rsync for keeping my photos on the mobile phone in sync with my server. The complete system is growing and growing and the actual state is able to sync photos, books, music and movies. And I also wrote a very limited simple interface to show the contents on the web after syncing. Photos are stored in the server in a date-oriented form. The php script to handle the files on the server side may be found here.
The app is just installed from google play (https://play.google.com/store/apps/details?id=eu.kowalczuk.rsync4android&hl=en). Follow the instructions to generate a key and copy the public key to the server ~/.ssh/authorized_keys – possibly you need to add the key to already stored keys in your authorized_keys file

The setup in android should state the following options:

rsync -vHrltD --exclude=thumbnails --chmod=ug+rwx,o-rwx --perms -e "ssh -y -p 22 -i "mobile@:BackupFromMobile/pictures

for the other folders like:

  • pictures
  • ebooks
  • music
  • whatsapp
  • movies
  • the same settings apply.

    android-x86

    USB install:
    zcat android-x86-….img.gz |dd of=/dev/sdb

    How to wake up:
    the following keys are working: ESC, Menu, left, right, up, down

    to wake up the machine the keys must be pressed for at least one second

    you may use the mouse wheel to unlock the screen

    if you encounter graphics problems you may use the following options:

    kernel initrd=/initrd.img root=/dev/ram0
    androidboot_hardware=generic_x86 acpi_sleep=s3_bios,s3_mode video=-16 SRC=DATA=DPI=240

    the parameter xforcevesa enables VESA graphics driver for X

    nomodeset disables the kernel mode setting

    Both options may be used to play around and getting graphics to work.

    Navigation:
    HOME – windows key left
    BACK – ESC
    MENU – menu-key

    change default application in android

    Tap the Menu button on your phone and select the Android Settings option. Scroll down to the Applications section and tap it. On the next screen, tap Manage Applications and then the All tab on the subsequent screen. Scroll down the list of apps until you see the old browser listed and tap that entry. On the next screen look for the “Launch by default” section and hit the Clear defaults button.

    Fritzbox – OpenVPN

    My Fritzbox 7270 was recently configured to open a VPN tunnel to my internal network. The fritzbox config is shown below in the picture:

    My Desire is configured like this:

    remote olkn.homelinux.net
    proto udp
    dev tap
    tls-client
    ns-cert-type server
    ca /sdcard/openvpn/ca.crt
    cert /sdcard/openvpn/client.crt
    key /sdcard/openvpn/client.key
    tls-auth /sdcard/openvpn/static.key 1
    tun-mtu 1500
    mssfix
    nobind
    pull
    cipher AES-128-CBC
    verb 3

    LeeDroid V2.1a with A2SD+

    FAQs:

    Bootloop? – Re flash making sure you fully wipe

    Video causing restart – Flash latest radio

    Grainy Camera – Try it without you back cover on not a rom issue. See attached photo (where i dont have the plactic lens cover on my case anymore, using Camera360 for HDR effect

    SD card read only – mount in windows and chkdsk

    Internal Memory – it does reduce slightly even with A2SD+. you will have 139mb on boot

    Wireless N – is not in this rom

    SetCPU – you need to buy the app. IT is not included

    Recovery – Enter android recovery > apply update.zip and that will take you to clockwork recovery

    Not booting – allow the phone time to boot after flashing. Sometimes it can take 5 mins. Also dont restore system settings using Titanium. It can cause faults

    Flashing!

    * Use either Amon RA or clockworkmod Recovery < also available via rom manager from the market. * if you want A2SD+ Ensure your SD Card is Partitioned with FAT32 & an EXT3 partition * Nandroid Backup * Full wipe Only required if coming from a non Froyo rom (but always recommended) * Flash Rom (you may need to toggle signature verifacation) * Flash Radio (unless you already have it) * If you already have an EXT3 partition you will be ready for the A2SD+ version * FroYo Apps2SD implementation does not utilize the EXT3 partition * Reboot (this may take a 5-10 mins on the initial boot) * Optional: Install any Addins + Customizations after first boot A2SD+ * Moves apps & Dalvik cahche to your SD card * Lots of free internal memory! * You will be required to format you SD card with 2 partitions as laid out below Partitioning your SD Card ready for A2SD+ * Backup all data on you SD card (this will be wiped) * The card should be formatted with your standard FAT32 partition 1st followed by an EXT3 partition (I would recommend 512mb, EXT4 is also supported but may shorten the life of you SD card) * Linux users use GParted or a similar software. * For everyone else I would recommend using Rom Manager * Once you have downloaded rom manager from the market, open the app and click partition SD Card, Select your EXT size and set 0mb for swap * Restore your data to your SD and the job is done. FroYo A2SD * Moves apps to your Fat32 partition (SD) * No EXT partition is required * Use "Mod Install Location" (included) to change you default install location. * please note, not all applications support direct install to your SD, you can install these and then move them via Sttings > Applications > Manage Applications

    Possible issues and solutions

    * Maps does not show as installed in the market > go to Setting > Applications > all > and clear data & cache in market.
    * I Cant update some of the preinstalled apps even though they are in /data Remove them via Settings > applications, then install them from the market.
    * No mobile internet > go to Wireless & Networks > Mobile Networks > APN then clear defaults, if your settings dont install just enter them manually
    * I cant see some of the applications that come with the rom >If these are supposed to be included in the rom but do not show up, Try a full wipe
    * I have lost my clockwork recovery update.zip from my sd > Here it is,just drop it on your SD.

    LeeDroid Home http://leedroid.protogenlabs.com/