Wednesday, May 28, 2014

Controlling Mitsubishi A/C with iTach IP2IR

Ingredients:
 - iTach IP2IR with IR blaster
 - Android 4 (rooted)

Mitsubishi Msz-fd50va & Msz-fd35va indoor units IR command codes:
 ON = sendir,1:3,1,38109,1,1,131,65,17,49,17,49,16,17,16,17,17,16,16,49,16,17,16,17,16,50,17,49,16,17,16,49,16,17,16,17,16,50,16,49,16,17,16,49,17,49,17,16,17,16,17,49,17,16,16,17,16,50,16,17,16,17,16,17,17,16,16,17,17,16,16,17,16,17,16,17,16,17,17,16,17,16,16,17,17,17,16,17,17,16,17,16,16,17,17,16,16,17,16,50,16,17,17,16,17,16,16,17,17,16,16,50,17,16,17,16,17,16,16,17,16,50,16,50,16,17,16,17,16,17,17,16,17,16,17,16,17,16,16,17,16,17,16,17,16,50,16,50,16,17,16,17,16,17,17,16,16,17,16,17,16,17,17,49,17,49,16,17,16,17,16,49,17,49,16,50,17,16,16,17,17,16,16,50,16,17,16,17,17,16,17,16,17,16,17,16,16,17,17,16,17,16,16,17,17,16,16,17,17,16,17,16,16,17,16,17,17,16,16,17,16,17,16,17,16,17,16,17,17,16,16,17,16,17,16,17,17,16,16,17,16,50,16,17,17,16,16,17,16,17,16,17,17,16,17,16,17,16,17,17,16,17,17,16,17,16,16,17,17,16,16,17,17,16,17,16,16,17,16,17,17,16,16,50,16,50,17,49,16,17,17,49,16,50,16,17,17,653,134,66,16,50,16,50,17,16,16,17,16,17,17,49,17,16,16,17,16,50,16,49,17,16,16,50,17,16,16,17,16,49,16,50,16,17,17,49,17,49,16,17,16,17,17,49,16,17,17,16,17,49,16,17,16,17,16,17,16,17,17,16,17,16,16,17,16,17,16,17,17,16,16,17,16,17,16,17,17,16,17,16,16,17,16,17,16,17,17,16,16,17,17,49,16,17,16,17,16,17,16,17,16,17,16,50,16,17,17,16,16,17,16,17,17,49,16,50,17,16,16,17,16,17,17,16,17,16,16,17,16,17,17,16,16,17,16,17,17,49,16,50,17,16,16,17,16,17,16,17,16,17,16,17,16,17,16,50,17,49,16,17,16,17,16,50,16,50,16,49,16,17,16,17,16,17,16,50,17,16,16,17,17,16,17,16,16,17,17,16,16,17,16,17,16,17,17,16,17,16,16,17,16,17,17,16,16,17
OFF = sendir,1:3,1,38109,1,1,131,65,16,50,16,50,17,16,16,17,16,17,17,49,17,16,16,17,17,49,17,49,17,16,16,50,16,17,17,16,16,50,17,49,16,17,16,50,16,50,17,16,17,16,16,50,17,16,16,17,16,50,16,17,16,17,17,16,17,16,17,16,16,17,16,17,16,17,16,17,16,17,17,16,17,16,16,17,17,16,16,17,16,17,17,16,17,16,16,17,17,16,17,16,17,16,17,16,16,17,16,17,16,17,16,50,16,17,16,17,17,16,17,16,16,50,17,49,17,16,17,16,16,17,17,16,17,16,16,17,17,16,17,16,16,17,17,16,16,50,16,50,16,17,17,16,17,16,17,16,17,16,16,17,16,17,16,50,17,49,17,16,17,16,16,50,17,49,16,50,17,16,16,17,16,17,17,49,16,17,16,17,17,16,17,16,17,16,16,17,16,17,17,16,16,17,16,17,17,16,17,16,16,17,17,16,17,16,16,17,16,17,17,16,16,17,16,17,16,17,17,16,17,16,17,16,17,16,16,17,16,17,17,16,16,50,16,17,17,16,16,17,16,17,17,16,17,16,16,17,16,17,17,16,16,17,17,16,16,17,17,16,16,17,17,16,17,16,16,17,17,16,17,16,17,16,17,49,16,50,17,49,17,16,17,16,17,49,17,16,17,649,135,65,17,49,16,50,17,16,16,17,17,16,16,50,17,16,16,17,17,49,16,50,17,16,16,50,16,17,17,16,16,50,17,49,17,16,17,49,16,50,16,17,17,16,17,49,16,17,16,17,16,50,17,16,17,16,16,17,17,16,16,17,16,17,16,17,17,16,16,17,17,16,17,16,17,16,17,16,16,17,16,17,16,17,17,16,16,17,16,17,16,17,16,17,16,17,16,17,17,16,17,16,17,16,17,49,17,16,16,17,17,16,17,16,16,50,16,50,17,16,16,17,16,17,16,17,17,16,17,16,16,17,17,16,17,16,16,17,16,50,16,50,16,17,16,17,16,17,16,17,17,16,16,17,16,17,16,50,16,50,16,17,17,16,17,49,17,49,17,49,17,16,16,17,16,17,17,49,16,17,17,16,17,16,17,16,17,16,17,16,16,17,17,16,16,17,17,16,16,17,16,17,17,16,16,17,17,16

Note: code have been retrieved using Telnet and get_IRL command not with the iLearn software, it can't record such a long code, see more details here -> https://globalcache.zendesk.com/entries/27803933-iLearn-and-Daikin-air-conditioner

Then I created a script in perl to send my command over Telnet.

 http://nthinking.net/delivery/itach_commandor

Perl is handy because it is installed in a lot of Linux distribs (readynas) by default. So you can then run some cron jobs that call this script in order to schedule the power on and off of the A/C units.

Well... Perl is not present by default on Android... but can be done using the followings.
 - SL4A with Perl for Android

You need to changet he frist line of the perl script to:

#!/data/data/com.googlecode.perlforandroid/files/perl/perl -w

Others handy Android software:
- SManager -> to create terminal widgets that calls the Perl script







Friday, November 08, 2013

PhProjekt broken left side menu

If you have a broken/empty menu with the projects tree on the left side and you're using Firefox>24 or Chrome>29, like this:

http://utyp.net/thumbs/p/phprojekt-bug.png

 that's because Dojo 1.6 has a bug that is fixed on this release here:

http://downloads.dojotoolkit.org/release-1.6.2/

Just copy the files over in phprojekt/htdocs/ and that will fix it.

But then you'll notice that it takes forever to load all the .js files, so you'll need to create a custom build, see here:

http://dojotoolkit.org/reference-guide/1.7/quickstart/custom-builds.html

I used this:

dependencies ={

  layers:  [
      {
      name: "mydojo.js",
      dependencies: [
          "dojo.fx",
          "dijit.dijit-all",
          "dijit.Button",
          "dojox.wire.Wire",
          "dojox.wire.XmlWire",
        "dojo.dnd.Avatar",
        "dojo.dnd.common",
        "dojo.dnd.Container",
        "dojo.dnd.Manager",
        "dojo.dnd.move",
        "dojo.dnd.Mover",
        "dojo.dnd.Moveable",
        "dojo.dnd.Selector",
        "dojo.dnd.Source",
        "dojox/data/QueryReadStore",
        "dojox/form/Rating",
        "dojox/form/CheckedMultiSelect",
        "dojox/grid/_EditManager",
        "dojox/grid/util",
        "dojox/grid/_Events",
        "dojox/grid/_FocusManager",
        "dojox/grid/_Grid",
        "dijit/dijit",
        "dojox/html/metrics",
        "dojox/grid/_Scroller",
        "dojox/grid/_Layout",
        "dojox/grid/cells",
        "dojox/grid/cells/_base",
        "dojox/grid/_RowSelector",
        "dojox/grid/_View",
        "dojox/grid/_Builder",
        "dojox/grid/_ViewManager",
        "dojox/grid/_RowManager",
        "dojox/grid/Selection",
        "dojox/grid/cells/dijit",
        "dojox/grid/DataSelection",
        "dojox/grid/DataGrid",
        "dojox/grid/nls/DataGrid_en",
        "dojox/string/Builder",
        "dojox/string/sprintf",
        "dojox/string/tokenize",
        "dojox/dtl",
        "dojox/dtl/_Templated",
        "dojox/dtl/filter/htmlstrings",
        "dojox/dtl/filter/strings",
        "dojox/fx/_base",
        "dojox/fx/_core",
        "dojox/fx/scroll",
        "dojox/form/RangeSlider",
        "dijit/form/VerticalSlider",
        "dojox/fx",
        "dojox/layout/ExpandoPane",
        "dojox/layout/ScrollPane",
        "dojox/widget/Toaster",
        "dojox/layout/ResizeHandle"
      ]
      }
  ],

  prefixes: [
      [ "dijit", "../dijit" ],
      [ "dojox", "../dojox" ]
  ]

};

Friday, August 09, 2013

Yes, Ethernet Cable Pin Out IS Important

... maybe it sounds straightforward but the Cable Pin Out needs to be respected if you want to acheive 1Gbps speed with Cat 5E or Cat6 cables. If you don't respect it you'll be stuck to 100Mbps.

It seems like the position of each cable within the twists makes a big differences? Especially the blue cable which is put on the 5th position.

Anyway, more information about the Pin Out here:

http://www.ertyu.org/steven_nikkel/ethernetcables.html

or here is the diagram:





Saturday, May 26, 2012

Cisco Default IP (10.10.10.1)

I've just received a Cisco router 1921.
Opened the box and check for a manual or a CD that would explain what to do configure it, but nothing. As the online documentation from Cisco must be somewhere I've not been looking yet, I had no idea what to do with this box.
I figured it out by connecting my computer to the console port. Using ZTerm for OS X with the following settings:


Bits per sec    :  9600 
Data bits       :     8 
Parity          :  none 
Stop bits       :     1 
Flow control    :  none  


Default user/pass is cisco/cisco
Then pay attention to the procedure to change the password on the welcome message.

So after listing the configuration looks like the default IP for port 0/0 is not 10.0.0.1 anymore as some website suggest, but 10.10.10.1

So you can directly telnet it to this address, or even use the web admin (if you have Java...).

Tuesday, February 28, 2012

Build OpenWRT on WR1043ND from SVN

1)Install necessary packages (osx)
$port install macports packages:
$port install coreutils asciidoc binutils bzip2 fastjar flex getopt gtk2 intltool jikes zlib openssl p5-extutils-makemaker python26 rsync ruby sdcc unzip gettext libxslt bison gawk autoconf wget gmake ncurse
$port install e2fsprogs ossp-uuid
$port install findutils

2)Create Work Image (osx)
open Disk Utility in the /Applications/Utilities directory.
Click File -> New -> Blank Disk Image...
Name = OpenWRT
Choose a size = 4.5GB.
In Format drop down, select Mac OS Extended (case-sensitive)
Image Format= sparse disk image
Create
it will mount it on /Volumes/OpenWRT

3)get last sources
$cd /Volumes/OpenWRT
$svn co svn://svn.openwrt.org/openwrt/trunk/


4)Make configuration and compile

$make menuconfig

choose Target System Atheros AR7xxx/AR9xxx
choose Target Profile (TP-LINK TL-WR1043N/ND)

$make -j 3

after approx. 45mn on a core 2 duo

5)Flash router
$cd ~/openwrt/trunk/bin

locate image
openwrt-ar71xx-generic-tl-wr1043nd-v1-squashfs-factory.bin (for first time flash, IMPORTANT: note tested)
openwrt-ar71xx-generic-tl-wr1043nd-v1-squashfs-sysupgrade.bin (for OpenWrt Upgrade)

flash using web interface, wait for 5mn


6)Configure router

There might be quite a lot of missing packages, you need to install manually.

>>telnet 192.168.1.1
connect internet cable on WAN port
#ping www.nthinking.net
#opkg update
#opkg install l2tpv3tun
#opkg install luci
#mv /etc/config/luci-opkg /etc/config/luci
#/etc/init.d/uhttpd enable
#/etc/init.d/uhttpd start

perl:
opkg install perl
opkg install perlbase-base
opkg install perlbase-essential
opkg install perlbase-autoloader
opkg install perlbase-config
opkg install perlbase-config
opkg install perlbase-getopt

openswan
opkg install openswan

Here you are, you now have a fully l2tpv3tun enabled, web interfaced, gigabit Ethernet router!

L2TPV3 commands

#l2tpv3tun show tunnel
#l2tpv3tun show session

Further readings on playing with l2tpv3:
http://wiki.openwrt.org/doc/uci/network
http://wiki.openwrt.org/doc/howto/pseudowire
http://asiantuntijakaveri.wordpress.com/2012/01/17/layer-2-over-layer-3-using-linux-built-in-features/
http://www.openl2tp.org/pipermail/openl2tp-users/2010-April/000836.html (Linux specific)

Useful commands:
If you can't ping the router anymore, after reset, press QSS on reboot when sys is blinking (it will blink faster), then you can $telnet 192.168.1.1
then type
#mtd -r erase rootfs_data
this flush everything back to default (and auto reboot)

Restart the network services:
#/etc/init.d/network restart

Verify syntax on /etc/config/network config (IMPORTANT if you don't want to reboot with a wrong config that will force you to use the commands below):
#uci show network

Query a specific interface status:
#uci -P/var/state show network.wan

And last but not least, how to stop vi from stupidly indenting your PASTE:
:set noai

Labels: , , ,


Thursday, March 17, 2011

How to really disable spotlight and save your old mac

I have one of the first generation of Mac Book Intel. This machine has been working really good for the past five years.
Since I bought it I've been steadily upgrading it with more RAM and faster and bigger hard-disk.
With the last hard-disk, I was happy to have all my 500Go desktop files with me, everywhere I go.
But with Snow Leopard and a bigger hard-disk came the problem of the dreadful mds process. It was just dragging my 1.8 MHz duo core to its knees; until the whole laptop overheat till reboot.
So I figured out it was related to spotlight which I never used (I much prefer the unix commands to do complicated searches).
And suddenly came Snow Leopard 10.6.6. which made removing spotlight much harder...

So if you have a old mac laptop you don't want to trash with a lot of files and you don't know what is spotlight, this is what you should do:

1 - enable the superuser (root) account (by doing this)

2 - start a unix terminal Applications>Utilities>Terminal

3 - verify the mds process is the reason why your computer is overheating by typing
top -o cpu

into the Terminal. If it shows 100% and stay like this for too long (5-30mn) it means this process should be disabled

4 - create a nomds.sh script that turns spotlight indexing off
#!/bin/sh
mdutil -a -i off


5 - run this script (nomds.sh) as root
login root
(type your password)
chmod 755 nomds.sh
chown root nomds.sh
mv nomds.sh /usr/bin/
nomds.sh

should be enough (Terminal prompting "Indexing disabled.") if you run osx prior to 10.6.6. But on 10.6.6 mds is like a phoenix always coming back even after you ask the system to uninstall it. So I added a daemon that just kill it every minutes. To do so:

6 - add a launchd plist in /Library/LaunchDaemons/. Call this file com.devdaily.nomds.plist

and copy/paste the following text into it

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>label</key>
<string>com.devdaily.nomds</string>

<key>ProgramArguments</key>
<array>
<string>/usr/bin/nomds.sh</string>
</array>

<key>OnDemand</key>
<false/>

<key>Nice</key>
<integer>1</integer>

<key>StartInterval</key>
<integer>60</integer>

<key>StandardErrorPath</key>
<string>/tmp/AlTest1.err</string>

<key>StandardOutPath</key>
<string>/tmp/AlTest1.out</string>
</dict>
</plist>



Now reboot, or if you don't want to reboot run
launchctl load /Library/LaunchDaemons/com.devdaily.nomds.plist


You should never be bothered by splotlight anymore.

I know it sounds a bit brutal to force the system like this, there might be a way to do the indexation good once and for all, or disable it gently, but as I said above I don't use any of this features, so this was the fastest and most acceptable solution I came with.

If you know what you're doing you can use this technique for a lot of other annoying processes, like all those from Adobe, but this is another matter.

Labels: , , , , , ,


Thursday, January 15, 2009

We are in 2009!!!

UTYPER

Powered by: 2009

This page is powered by Blogger. Isn't yours?