lundi 2 janvier 2012

Karotz - Tips and Tricks

System

Tools & Links

La procédure d'installtion génère un fichier .zip contenant des fichiers de configuration  en fonction des paramètres suivants :
http://www.karotz.com/usbkey/karotzusb.zip?uuid=xxxx-yyyy-zzzz&installtype=wifi&usedhcp=1&ssid=TEST&password=test&lang=FRA&wifitype=auto&ipself=&netmask=&ipgateway=&ipdns=
http://www.karotz.com/usbkey/karotzusb.zip?uuid=xxxx-yyyy-zzzz&installtype=ethernet&usedhcp=0&lang=FRA&ipself=192.168.1.1&netmask=255.255.255.0&ipgateway=192.168.1.254&ipdns=82.125.42.65

Serial Konsole

  • On accède à la console série en branchant le Karotz au Pc par l'un de ses 2 ports usb - standard et mini - à l'arrière - le driver serial_gadget doit être présent sur le Pc. Le port Usb du Pc est ainsi mappé sur un port COMx en 9600+ bauds 8N1. Pour découvrir quel est le numéro du port com mappé, aller dans la config matérielle du pc pour lister les ports séries.

    Utiliser un émulateur terminal genre PuTTY et ouvrir une session en mode Serial.

    Les applications hébergées peuvent dialoguer avec le port série - cf le sdk javascript.
  • Quelques commandes de configuration - lecture / écriture - sont aussi disponibles. Les taper sous le format json suivant : {"cmd":"get_sys_version"}{"cmd":"get_mac"}{"cmd":"reboot"}. On pourra aisément ajouter de nouvelles commandes au système en modifiant les scripts python. Pour plus d'info voir config.py.

Mp3

  • Serveurs TTS : - method POST
[tts] - sans authentification préalable
fr = http://188.165.228.65/tts/Suzanne
en = http://188.165.228.64/tts/Katherine
de = http://188.165.228.64/tts/Alex
es = http://188.165.228.65/tts/Sara
  • Serveurs ASR
[asr]
server0 = 188.165.228.64
server1 = 188.165.228.65
port = 443
Un répertoire par langue contenant x fichiers mp3 : fr contient 304 fichiers - it 306 - ja-Jp 297 - br 298 - de 292 - es 306 - uk 300 - us 297. Sous dos, les charger avec la commande :
for /L %x in (1,1,304) do wget http://s3.amazonaws.com/karotz/moods/fr/%x.mp3

dimanche 1 janvier 2012

Karotz - Boot Process

Le Karotz est architecturé autour d'une carte Pragmatec ARM9 et d'un module 2440 sur lequel tourne un Linux 2.6.28. Pour le développement croisé voir le pdf ARM9 Dev Starter Kit.

Boot

  • whoami - root
  • mount
    rootfs on / type rootfs (rw)
    /dev/root on / type cramfs (ro)
    proc on /proc type proc (rw)
    none on /sys type sysfs (rw)
    ramfs on /var type ramfs (rw)
    none on /dev type tmpfs (rw,mode=755)
    /dev/uba1 on /mnt/usbkey type vfat
    (rw,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)
    /dev/mtdblock6 on /usr type yaffs (rw)
    none on /dev/pts type devpts (rw,mode=622)
    tmpfs on /dev/shm type tmpfs (rw)
    usbfs on /proc/bus/usb type usbfs (rw)
  • cat /etc/inittab - ln /karotz/etc/inittab
    # Startup the system
    ::once:/karotz/scripts/karotz_init.sh
    ::respawn:/karotz/bin/power
    # Configuration programm
    ::once:/usr/scripts/miniusb_read.sh
    ::restart:/sbin/init
    #::askfirst:/bin/bash
    # Stuff to do before rebooting
    ::shutdown:/karotz/scripts/karotz_shutdown.sh
    ::shutdown:/bin/umount -a -r
  • ps
    PID USER COMMAND
    1 root /bin/sh /linuxrc
    2 root [kthreadd]
    3 root [ksoftirqd/0]
    4 root [watchdog/0]
    5 root [events/0]
    6 root [khelper]
    155 root [kblockd/0]
    166 root [khubd]
    169 root [kseriod]
    195 root [pdflush]
    196 root [pdflush]
    197 root [kswapd0]
    198 root [aio/0]
    199 root [nfsiod]
    886 root [scsi_tgtd/0]
    892 root [mtdblockd]
    893 root [nftld]
    894 root [inftld]
    923 root [s3c2410-spi.0]
    931 root [uwbd]
    944 root [wusbd]
    979 root [hid_compat]
    1020 root [rpciod/0]
    1067 root [rt73usb]
    1377 root /karotz/bin/led -l FFCFAF -p 000000 -d 1500
    1380 root /sbin/inetd /tmp/wizz_inetd_telnet.conf
    1346 root /sbin/inetd
    1382 root ps
  • cat /etc/group - ln /karotz/etc/group
    root:*:0:
    daemon:*:1:
    bin:*:2:
    sys:*:3:
    adm:*:4:
    tty:*:5:
    disk:*:6:
    lp:*:7:
    mail:*:8:
    news:*:9:
    uucp:*:10:
    kmem:*:15:
    dbus:x:81:
    ppp:x:99:
    nogroup:x:100:
  • cat /etc/passwd - ln /karotz/etc/passwd
    root:*:0:0:root:/usr/karotz:/bin/bash
    bin:*:1:1:bin:/bin:
    daemon:*:2:2:daemon:/sbin:
    nobody:*:99:99:Nobody:/:
    dbus:x:81:81:dbus:/var/run/dbus:/bin/sh
  • /bin/printenv
    KMOD=/lib/modules/
    TERM=linux
    k_nbclick=0
    LD_LIBRARY_PATH=/lib:/usr/lib
    AUTO_UPDATE=yes
    GST_REGISTRY_UPDATE=no
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:./
    GST_REGISTRY=/usr/karotz/registry
    devfs=udev
    PWD=/
    LANG=C
    SHLVL=1
    HOME=/
    WIZZ_HOME=/usr/karotz
    DISPLAY=unix:0.0
    _=/bin/printenv
  • /bin/busybox
    BusyBox v1.17.4 (2012-03-29 10:05:08 CEST) multi-call binary.
    Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
    and others. Licensed under GPLv2.
    See source distribution for full notice.

    Usage: busybox [function] [arguments]...
    or: function [arguments]...


    BusyBox is a multi-call binary that combines many common Unix utilities into a single executable. Most people will create a link to busybox for each function they wish to use and BusyBox will act like whatever it was invoked as.

    Currently defined functions: where are chpasswd and ftpd? ;-))...
    [, [[, addgroup, adduser, ar, arping, ash, awk, basename, bootchartd, bunzip2, bzcat, cat, catv, chattr, chgrp, chmod, chown, chroot, chrt, chvt, cksum, clear, cmp, cp, cpio, crond, crontab, cut, date, dc, dd, deallocvt, delgroup, deluser, devmem, df, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, echo, egrep, eject, env, ether-wake, expr, false, fdflush, fdformat, fgconsole, fgrep, find, flock, fold, free, freeramdisk, fsck, fuser, getopt, getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod, install, ip, ipaddr, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kill, killall, killall5, klogd, last, length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, losetup, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, makedevs, md5sum, mdev, mesg, mkdir, mkfifo, mknod, mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mt, mv, nameif, nc, netstat, nice, nohup, nslookup, od, openvt, passwd, patch, pidof, ping, pipe_progress, pivot_root, poweroff, printenv, printf, ps, pwd, rdate, readlink, readprofile, realpath, reboot, renice, reset, resize, rev, rm, rmdir, rmmod, route, run-parts, runlevel, sed, seq, setarch, setconsole, setkeycodes, setlogcons, setsid, sh, sha1sum, sha256sum, sha512sum, sleep, smemcap, sort, start-stop-daemon, strings, stty, su, sulogin, swapoff, swapon, switch_root, sync, sysctl, syslogd, tail, tar, tee, telnet, telnetd, test, tftp, time, top, touch, tr, traceroute, true, tty, udhcpc, umount, uname, uniq, unix2dos, unlzma, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat