hardware

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

Update Mellanox MCX312A-XCBT firmware under Ubuntu

check for new firmware versions
http://www.mellanox.com/supportdownloader/
http://www.mellanox.com/page/firmware_table_ConnectX3EN

boot from Ubuntu Live CD (tested with Ubuntu 12.10 and 13.04)

wget http://www.mellanox.com/downloads/MFT/mft-3.1.0-8.tgz -P /tmp
tar xzf /tmp/mft-*.tgz -C /tmp

apt-get update
apt-get install -y rpm2cpio

# compile kernel module
cd /tmp
rpm2cpio /tmp/mft-*/SRPMS/kernel-mft-*.src.rpm | cpio -i --make-directories
tar xzf /tmp/kernel-mft-*.tgz -C /tmp/
cd /tmp/kernel-mft-*
apt-get install -y linux-headers-$(uname -r)

Linpack under Ubuntu / Linux

wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/installit/master/install.linpack.sh -O - | bash -

#!/bin/bash

URL=http://registrationcenter.intel.com/irc_nas/3914/l_lpk_p_11.1.2.005.tgz

# download
wget ${URL} -O /tmp/l_lpk.tgz

# extract
tar -xzf /tmp/l_lpk.tgz -C /tmp/

# copy linpack to /usr/share directory
cp -a /tmp/linpack_11.1.2/benchmarks/linpack/ /usr/share/

# create soft links to executables
ln -sf /usr/share/linpack/runme_xeon64 /usr/sbin/
ln -sf /usr/share/linpack/xlinpack_xeon64 /usr/sbin/

# adjust path in runme_xeon64
sed -i s'|./xlinpack_$arch lininput_$arch|/usr/sbin/xlinpack_$arch /usr/share/linpack/lininput_$arch|g' /usr/sbin/runme_xeon64

# get CPU info
CPU=$(cat /proc/cpuinfo | grep "model name" | tail -1)
COUNT=$(cat /proc/cpuinfo | grep processor | wc -l)
echo "CPU : $CPU"
echo "COUNT : $COUNT"

# OPTIONAL: configure parameter
# export MKL_DYNAMIC=false
# export OMP_NUM_THREADS=4

# run
runme_xeon64

Links
http://software.intel.com/en-us/articles/intel-math-kernel-library-linpack-download - Intel LINPACK Download
http://www.roylongbottom.org.uk/linpack%20results.htm

Pogoplug: Install Debian

Install Debian
# connect to PogoPlug
ssh root@192.168.2.155
ceadmin

# prepare USB flash (1GB root, 256MB swap)
printf "o\nn\np\n1\n\n+1G\nn\np\n2\n\n+256M\nt\n2\n82\nw\n" | fdisk /dev/sda

# download and execute debian installation script
cd /tmp
wget http://projects.doozan.com/debian/dockstar.debian-squeeze.sh
chmod +x dockstar.debian-squeeze.sh
export PATH=$PATH:/usr/sbin:/sbin
./dockstar.debian-squeeze.sh
ok

# login to new debian intallation
ssh root@192.168.1.X
pass: root

# change root password
passwd

Configure netconsole

LSI MegaRAID 9240-4i / 9260-4i perfomance

LSI MegaRAID 9240-4i / TOSHIBA MK1001TRKB SAS 1TB
1x HDD RAID0
write ? MB/s
read ? MB/s
2x HDD RAID1
write ? MB/s
read ? MB/s
4x HDD RAID5
write ~28 MB/s
read ? MB/s
4x HDD RAID10
write 300 MB/s
read ? MB/s

LSI MegaRAID 9260-4i / TOSHIBA MK1001TRKB SAS 1TB
1x HDD RAID0
write 145 MB/s
read 147 MB/s
2x HDD RAID1
write 145 MB/s
read 160 MB/s
4x HDD RAID5
write ~18 MB/s
read 430 MB/s
4x HDD RAID10

Brother MFC 7320

Install printer
wget https://raw.githubusercontent.com/panticz/installit/master/hardware/install.brother-mfc-7320.printer.sh -O - | bash -

#!/bin/bash

# enable multiverse repository
cat <<EOF> /etc/apt/sources.list.d/extra-repository.list
deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs) universe
deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs) multiverse
EOF
apt-get update -qq

# install printer driver
apt-get install -y brother-cups-wrapper-laser

# remove multiverse repository
rm /etc/apt/sources.list.d/extra-repository.list
apt-get update -qq

# create printer
lpadmin -p Brother-MFC-7320 -E -v usb://Brother/MFC-7320 -P /usr/share/ppd/Brother/MFC7220.ppd -o PageSize=A4

# FIXME: set resolution to 1200
# -o Resolution=1200x600dp

Install scanner
wget https://raw.githubusercontent.com/panticz/installit/master/hardware/install.brother-mfc-7320.scanner.sh -O - | bash -

#!/bin/bash

# patch udev rules
cat <<EOF>> /lib/udev/rules.d/40-libsane.rules
ATTRS{idVendor}=="04f9", ENV{libsane_matched}="yes"
EOF

# restart udev
sudo service udev restart

# download driver
wget http://pub.brother.com/pub/com/bsc/linux/dlf/brscan3-0.2.11-4.i386.deb -P /tmp

# install driver
sudo dpkg -i /tmp/brscan3-0.2.11-4.i386.deb

Yamaha RX-V3800 / RX-V3900 AV-Receiver

Install and configure DLNA server for Yamaha RX-V3800
# install MiniDLNA
http://www.panticz.de/Install-MiniDLNA

# configure MiniDLNA for Yamaha PC/MCX player
sed -i 's|#notify_interval=895|notify_interval=86400|g' /etc/minidlna.conf

lyc
http://www.panticz.de/lyc

wlyc
http://www.panticz.de/wlyc

wlyc for Yamaha RX-V3900
https://github.com/panticz/wlyc/blob/master/wlyc3900.html
http://dl.panticz.de/wlyc/wlyc3900.html

Comparison Chart: Yamaha RX-Z7 vs. RX-V3900 vs. RX-V3800

wlyc - Linux Yamaha Receiver Webcontrol

GitHub repository
https://github.com/panticz/wlyc
Demo
http://dl.panticz.de/wlyc/wlyc3900.html

https://raw.githubusercontent.com/panticz/wlyc/master/wlyc

#!/bin/sh

URL="http://cdn1.iconfinder.com/data/icons/super-mono-basic/blue"

# get parameter
p1=`echo "$QUERY_STRING" | cut -d"&" -f1 | cut -d"=" -f2`
case "$QUERY_STRING" in
   *\&*)
   p2=`echo "$QUERY_STRING" | cut -d"&" -f2 | cut -d"=" -f2`
   ;;
esac

# parameter
# cmd 1
# cmd 2
# image url
# alt and title text
# short description
# accesskey
link() {
    echo "<div class='l'><a href='?p1=$1&p2=$2' accesskey='$6'><img src='$URL/$3' alt='$4' title='$4'>$5</a></div>"
}

# run command
/root/lyc $p1 $p2





# head
echo "Content-type: text/html"
echo ""

echo "<html>"
echo "<head>"
echo "<link href='http://dl.panticz.de/wlyc/wlyc.css' rel='stylesheet' type='text/css'>"
echo "</head>"
echo "<body>"

# print command
echo "<div class='cmd'>$p1 $p2</div>"

# control
echo "<div class='title'>Power</div>"
link power off button-cross_basic_blue.png "Power Off" OFF
link power on button-power_basic_blue.png "Power On" ON

echo "<div class='title'>Input</div>"
link input dvd disc_basic_blue.png DVD DVD
link input net music_basic_blue.png "Internet Radio" NET
link input usb usb-stick_basic_blue.png USB USB
link input pc computer_basic_blue.png PC PC

echo "<div class='title'>Volume</div>"
link mute on speaker-mute_basic_blue.png Mute "MUTE" m 
link volume down button-remove_basic_blue.png Display "VOL-" -
link volume up button-add_basic_blue.png Display "VOL+" +
link volume -70 speaker_basic_blue.png "Volume -70 dB" -70
link volume -65 speaker_basic_blue.png "Volume -65 dB" -65
link volume -60 speaker_basic_blue.png "Volume -60 dB" -60
link volume -55 speaker_basic_blue.png "Volume -55 dB" -55
link volume -50 speaker_basic_blue.png "Volume -50 dB" -50
link volume -45 speaker_basic_blue.png "Volume -45 dB" -45
link volume -40 speaker_basic_blue.png "Volume -40 dB" -40
link volume -35 speaker_basic_blue.png "Volume -35 dB" -35
link volume -30 speaker_basic_blue.png "Volume -30 dB" -30


echo "<div class='title'>OSD</div>"
link osd display desktop_basic_blue.png Display DISP
link osd menu site-map_basic_blue.png Menu MENU
link osd left navigation-left_basic_blue.png Left LEFT
link osd up navigation-up_basic_blue.png Up UP
link osd enter button-check_basic_blue.png Enter ENTER
link osd down navigation-down_basic_blue.png Down DOWN
link osd right navigation-right_basic_blue.png Right RIGHT

echo "<div class='title'>DSP</div>"
link dsp 2ch equalizer_basic_blue.png 2ch 2ch
link dsp 7ch equalizer_basic_blue.png "7ch Stereo" 7ch

echo "<div class='title'>Memory</div>"
link memory 1 inbox_basic_blue.png "Memory 1" 1
link memory 2 inbox_basic_blue.png "Memory 2" 2
link memory 3 inbox_basic_blue.png "Memory 3" 3
link memory 4 inbox_basic_blue.png "Memory 4" 4
link memory 5 inbox_basic_blue.png "Memory 5" 5
link memory 6 inbox_basic_blue.png "Memory 6" 6

echo "<div class='title'>Media</div>"
link prev "" button-rew_basic_blue.png Previous PREV
link stop "" button-stop_basic_blue.png Stop STOP
link play "" button-play_basic_blue.png Play PLAY
link next "" button-ff_basic_blue.png Next NEXT

echo "</body>"
echo "</html>"

Links
http://your.recier.ip/YamahaRemoteControl/UnitDesc.xml

lyc - Linux Yamaha receiver control (over serial / RS232 interface)

Yamaha RX-V3800 and some older models like DSP-AX1 are great AV-Receiver, but unfortunately they have no control / web interface to manage it from outside. With a USB-Serial adapter connected to the reciver RS-232 interface, a computer or router and lyc you can control the reciver. In addition, a web interface can be created with wlyc to provide a web access to all network devices like PC, smartphone or tablet.

GitHub repository
https://github.com/panticz/lyc

Download binary
http://dl.panticz.de/lyc/i386/lyc - i386 compiled
http://dl.panticz.de/lyc/ar9132/lyc - Atheros AR9132 (TP-LINK TL-WR1043ND / TL-WDR4300 router)

HowTo compile and run
1. download lyc.c and Makefile
2. compile with: make
3. set up USB Serial adapter http://www.panticz.de/USB-Serial-adapter
4. run command:
./lyc input dvd
./lyc volume up

Run on OpenWrt router
1. download sources
2. comile with
make mips
4. copy lyc to OpenWRT router:
scp lyc root@OPENWRT_IP:/root/lyc
5. login to root@YOUR_OPENWRT_IP
6. download wlyc (OpenWrt wget can not access https, use http redirection)
wget -q http://dl.panticz.de/wlyc/wlyc -O /www/cgi-bin/wlyc
chmod 755 /www/cgi-bin/wlyc
7. Open im broser:
http://OPENWRT_IP/cgi-bin/wlyc
Example: http://ROUTER_IP/cgi-bin/wlyc?p1=input&p2=dvd

cros-compile script for OpenWRT
http://dl.panticz.de/lyc/compile_openwrt_ar9132.sh

http://raw.githubusercontent.com/panticz/lyc/master/lyc.c - lyc source code

#include <stdio.h> /* Standard input/output definitions */
#include <string.h> /* String function definitions */
#include <unistd.h> /* UNIX standard function definitions */
#include <fcntl.h> /* File control definitions */
#include <errno.h> /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */
#include "rxvx700.h" /* Yamaha RX-Vx700 protocol codes */

#define STX 0x02
#define ETX 0x03
#define DC1 0x11

int fd;

//Initialize serial port
int init_port()
{
    int portstatus = 0;

    struct termios options;
    // Get the current options for the port...
    tcgetattr(fd, &options);
    // Set the baud rates to 9600...'textB' un
    cfsetispeed(&options, B9600);
    cfsetospeed(&options, B9600);
    // Enable the receiver and setSTX local mode...
    options.c_cflag |= (CLOCAL | CREAD);

    options.c_cflag &= ~PARENB;
    options.c_cflag &= ~CSTOPB;
    options.c_cflag &= ~CSIZE;
    options.c_cflag |= CS8;
    //options.c_cflag |= SerialDataBitsInterp(8);           /* CS8 - Selects 8 data bits */
    options.c_cflag &= ~CRTSCTS;                            // disable hardware flow control
    options.c_iflag &= ~(IXON | IXOFF | IXANY);           // disable XON XOFF (for transmit and receive)
    //options.c_cflag |= CRTSCTS;                     /* enable hardware flow control */


    options.c_cc[VMIN] = 0;     //min carachters to be read
    options.c_cc[VTIME] = 0;    //Time to wait for data (tenths of seconds)


    // Set the new options for the port...
    //tcsetattr(fd, TCSANOW, &options);


    //Set the new options for the port...
    tcflush(fd, TCIFLUSH);
    if (tcsetattr(fd, TCSANOW, &options)==-1)
    {
        perror("On tcsetattr:");
        portstatus = -1;
    }
    else
        portstatus = 1;

    return portstatus;
}


/*
* send command to reciver
*/
void send_cmd(const char *n) {
    int len = strlen(n);

    // create command
    char cmd[len + 2];
    cmd[0]=STX;
    cmd[len + 1]=ETX;

    // copy string to char array
    int i;
    for (i = 0; i < strlen(n); i++) {
        cmd[i + 1] = n[i];
    }

/*
    // debug
    printf("CMD:");
    for (i = 0; i < sizeof(cmd); i++) {
        printf("%c|", cmd[i]);
    }
    printf("\n");
*/

    write(fd, cmd, sizeof(cmd));
}

/*
* send init command to reciver
*/
void init_cmd() {
    char b[5];
    b[0]=DC1;
    b[1]=0;
    b[2]=0;
    b[3]=1;
    b[4]=ETX;

    int n = write(fd, b, sizeof(b));
}

/*
* open serial port
*/
int open_port(void)
{
    int fd; /* File descriptor for the port */
    fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY);

    if (fd == -1) {
        /*
        * Could not open the port.
        */
        perror("open_port: Unable to open /dev/ttyUSB0 --- \n");
    } else {
        fcntl(fd, F_SETFL, 0);
    }

    return (fd);
}

/*
* decode command
*/
int run_cmd(char *cmd1, char *cmd2) {
    int l = 0;

    // check parameter
    if(cmd1 != NULL) {
        l += strlen(cmd1);
    }

    if(cmd2 != NULL) {
        l += strlen(cmd2);
    }

    // put parameter together
    char c[l + 2];
    strcpy(c, cmd1);
    if(cmd2 != NULL) {
        strcat(c, " ");
        strcat(c, cmd2);
    }

    int i;
    int size = (int)(sizeof(cmd) / sizeof(*cmd));
    for(i = 0; i < size; i++) {
        // search command
        if(strcmp(c, cmd[i][0]) == 0) {
            // todo calculate volume
            // int i = (int)strtol(cmd[i][1], (char **)NULL, 10);

            char code[strlen(cmd[i][1]) + 1];
            strcpy(code, cmd[i][1]);

            char *pch;
            pch = strtok(code, " ");
            while (pch != NULL) {
                send_cmd(pch);

                pch = strtok(NULL, " ");
            }

            return 0;
        }
    }

    return 1;
}

/*
* main
*/
int main(int argc, char **argv) {
    if(argc == 1) {
        return 1;
    }
        
    fd = open_port();

    if(fd == -1) {
        printf("Error opening serial port\n");
    } else {
        if(init_port() == -1) {  
            sleep(.5);
            printf("Error initializing serial port\n");

            close(fd);
            return 0;
        }

        sleep(.5);
        init_cmd();

/*
        // todo: recive response from reciver
        if (n < 0) {
            fputs("write() of X bytes failed!\n", stderr);
        } else {
            printf("Successfully wrote 8 bytes\n");

            sleep(.5);
            char buffer[200];
            int n = read(fd, buffer, sizeof(buffer));
            sleep(.5);
            if (n < 0) {
                fputs("read failed!\n", stderr);
            } else {
                printf("Successfully read from serial port -- %s\n", buffer);
            }
        }
*/

        sleep(.5);
        if(run_cmd(argv[1], argv[2]) == 1) {
            printf("Command not found\n");
        }

        sleep(.5);
        close(fd);
    }

    return 0;
}

https://raw.githubusercontent.com/panticz/lyc/master/rxvx700.h - Yamaha RS232 codes

// todo: add Zone2 and Zone3
const char* cmd[][2] = {
    {"power on", "07E7E"},
    {"power off", "07E7F"},

    {"input cd", "07A15"},
    {"input dvd", "07AC1"},
    {"input bd", "07AC8"},
    {"input netusb", "0F7F013FC0"},
    {"input usb",   "0F7F013FC0 0F7F0138C7"},
    {"input net",   "0F7F013FC0 0F7F0137C8"},
    {"input pc",    "0F7F013FC0 0F7F0136C9"}, 

    {"volume up", "07A1A"},
    {"volume down", "07A1B"}, 
    {"volume -30", "2308B"},
    {"volume -35", "23081"},
    {"volume -40", "23077"},
    {"volume -45", "2306D"},
    {"volume -50", "23063"},
    {"volume -55", "23059"},
    {"volume -60", "2304F"},
    {"volume -65", "23045"},
    {"volume -70", "2303B"},
    {"volume -75", "23031"},
    {"volume -80", "23027"},

    {"mute on", "07EA2"},
    {"mute off", "07EA3"},

    {"sleep off", "07EB3"},
    {"sleep 120", "07EB4"},
    {"sleep 90", "07EB5"},
    {"sleep 60", "07EB6"},
    {"sleep 30", "07EB7"},

    {"dsp 7ch", "07EFF"},
    {"dsp 2ch", "07EC0"},
    {"dsp normal", "07EFD"},
    {"dsp straight", "07EE0"},
    {"dsp general", "07EFC"},

    {"memory 1", "07E35"},
    {"memory 2", "07E36"},
    {"memory 3", "07E37"},
    {"memory 4", "07E38"},
    {"memory 5", "07E39"},
    {"memory 6", "07E3A"},

    {"osd menu", "0F7F012FD0"},
    {"osd enter", "0F7F0131CE"},
    {"osd display", "0F7F0135CA"},
    {"osd up", "0F7F012ED1"},
    {"osd down", "0F7F0134CB"},
    {"osd left", "0F7F0132CD"},
    {"osd right", "0F7F0130CF"},

    {"enhancer on", "07ED8"},
    {"enhancer off", "07ED9"},

    {"stop", "0F7F013DC2"},
    {"play", "0F7F013EC1"},
    {"next", "0F7F013CC3"},
    {"prev", "0F7F013BC4"},

};

https://raw.githubusercontent.com/panticz/lyc/master/Makefile - Makefile

STAGING_DIR=../toolchain-mips_34kc_gcc-4.6-linaro_uClibc-0.9.33.2/bin
export STAGING_DIR

all:
	gcc $(FLAGS) $(INCLUDEDIR) lyc.c -o lyc

arm:
	arm-linux-gnueabihf-gcc lyc.c -o lyc

mips:
	$(STAGING_DIR)/mips-openwrt-linux-uclibc-gcc lyc.c -o lyc
        
clean:
	rm -f *~ *.o *.cgi lyc

Links
http://mark.jerde.org:13780/v1/comp/rxv2400/
http://linuxmce.org/
http://forum.linuxmce.org/index.php?topic=5759.0
http://www.remotecentral.com/cgi-bin/mboard/rc-touch/thread.cgi?849
http://www.omei.de/

Syndicate content