Digivation Hack Central

linux

Dumping the LG Roboking VR6270LVM

by on Jul.25, 2013, under linux, Nifty Hacks

Having just obtained a shiny new LG Roboking VR6270LVM (AKA HomBot Square) via ebay from korea, my first thought was to convert the Korean speech to something I can actually understand.

The english manual is easy to find on any LG web site, however software updates are a bit more difficult. After searching around a bit I found a software update for this model, though I’m not sure on whether it is useful for me. However, it did give me some hints.

This device is running ARM embedded linux. There is a USB port next to the dust catcher which is used to perform updates.

It looks for a file called update.sh, which if found it executes! It is important that a line in this script has the text

#IS_HIT_UPDATE_SCRIPT=1

usually on the second line.

An example script to dump the filesystem is

 


#!/bin/sh
#IS_HIT_UPDATE_SCRIPT=1

SOURCE_PATH="/mnt/usb"

if ! test -e $SOURCE_PATH/rk.tar ; then

mount >> $SOURCE_PATH/log 2>&1
ls -al / >> $SOURCE_PATH/log 2>&1
ls -al /bin >> $SOURCE_PATH/log 2>&1
ls / >> $SOURCE_PATH/log 2>&1
ls /mnt >> $SOURCE_PATH/log 2>&1

R="bin dev etc lib linuxrc root sbin temp tmp usr var mnt/rwfs"
tar cf $SOURCE_PATH/rk.tar $R >> $SOURCE_PATH/log 2>&1

sync

fi

aplay -c 1 -r 16000 -f S16_LE /usr/SNDDATA/SND_NOTICE_UPDATE_END.snd

/usr/rbin/rpjig.axf /vision /usr/rcfg/config.xml -poweroff 15000 &

exit 0

It will talk when complete.

There are 2 sets of sound files, one male and one female, and both in korean. These are in mono 16k raw audio and can be converted to wav files with sox.


#!/bin/bash

mkdir -p sound/SNDDATA{0,1}

for i in `find . -name "*.snd"` ; do
d1=`dirname $i`
d1=`basename $d1`
i1=`basename $i`
i2=`basename $i1 .snd`
sox -r16000 -c1 -e signed -b 16 -traw $i sound/$d1/$i2.wav
done

The file names are quite descriptive but it would be nice to know what each one says. Then I can rerecord them and make it speak english. If anyone has the english versions of these sound files, I would be grateful.

Also interesting is that it supports wifi. Plug in a compatible wifi USB dongle and upload (using update.sh) wifi.cfg to /usr/etc. The format seems to be


ESSID ssidname
IP
WPS WPS_OFF

but this is untested. It runs dropbear so you should be able to log into it. You may also need to update wpa_supplicant.conf in the same directory with keys for WPA2 as is standard for linux. Supported dongles include rt3070sta, rt5370sta, rt3370sta and 8192cu.

All for now.

Comments Off :, more...

Git Tricks and Tips

by on Nov.19, 2010, under linux, Nifty Hacks

Maintaining Vendor Branches

For the case where you have a vendor tarball or zip source bundle, these are effectively managed in a branch.

If the vendor releases a new version, the update process is:

git co vendor
mkdir zzz
mv * zzz/
mv .* zzz/
mv zzz/.git .
rm -rf zzz
git commit -a

Now you can merge or rebase your development tree to the new vendor release.

Some useful Git links.

Refs:
http://cheat.errtheblog.com/s/git
http://sourceware.org/frysk/build/git-fu.html
http://sandofsky.com/blog/git-workflow.html

Comments Off more...

Mapping special names to multiple USB serial adapters

by on Apr.17, 2010, under linux, Solar

The watts clever envi has a USB serial adapter which is a Prolific pl2303. When inserted it is assigned /dev/ttyUSB0 by udev, among a few other symlinks. I have now obtained an RS485 serial adapter on ebay for A$13.98 delivered which uses the exact same chip, which makes it indistiguishable from the envi’s port. What I needed was a way to guarantee uniqueness regardless of the enumeration order on boot or random hot plugin. Naturally, this is for the Aurora GCI which will be installed when they become available in May.

Researching udev a bit, I found /lib/udev/rules.d/60-persistent-serial.rules (mine is a debian system). This file shows how the standard symlinks are done. Since each USB port is unique, I should be able to use that uniqueness to map another symlink to the device.

Firstly plug in the device in the chosen USB port and issue
udevadm info --query=all --name=/dev/ttyUSB1

This shows a heap of stuff but mainly we are interested in
P: /devices/pci0000:00/0000:00:1a.0/usb2/2-1/2-1:1.0/ttyUSB1/tty/ttyUSB1

Create a file in /etc/udev/rules.d/70-persistent-serial.rules which contains

#see /lib/udev/rules.d/60-persistent-serial.rules

ACTION!=”add|change”, GOTO=”persistent_serial_end”
SUBSYSTEM!=”tty”, GOTO=”persistent_serial_end”
KERNEL!=”ttyUSB[0-9]*|ttyACM[0-9]*”, GOTO=”persistent_serial_end”

IMPORT=”usb_id –export %p”
#IMPORT=”path_id %p”

ENV{ID_SERIAL}==””, GOTO=”persistent_serial_end”

# usb nearest ethernet connector
ENV{DEVPATH}==”*usb2/2-2/2-2:1.0*”, SYMLINK+=”serial/by-name/envi”
#bottom front connector
ENV{DEVPATH}==”*usb7/7-1/7-1:1.0*”, SYMLINK+=”serial/by-name/rs485″
# usb below nearest ethernet connector
ENV{DEVPATH}==”*usb2/2-1/2-1:1.0*”, SYMLINK+=”serial/by-name/rs485″

LABEL=”persistent_serial_end”

Replug and voila you get /dev/serial/by-name/rs485 which will always be the correct device.

Now I just have to run the wire to where the GCI will be installed.

Comments Off :, , , , , , , , , , more...

Funny Characters for gcc/g++ errors and warnings

by on Apr.01, 2010, under linux

I have found that on some linux systems when you compile with gcc and g++ the error messages have funny characters like

test.c: In function â:
test.c:6: warning: unused variable â

This is due to the default locale being set to something other than the default.

in /etc/default/locale you will have a line like

LANG="en_AU.UTF-8"

add

LC_CTYPE=C

Restart the shell and compile again and the errors are now meaningful.

test.c: In function 'main':
test.c:6: warning: unused variable 'x'

Naturally you could set it in the local shell for the session, but then you would have to do it every time.

Comments Off : more...