Archive

Archive for the ‘Mobile’ Category

Debug android-maven-plugin apps in Eclipse with DDMS

November 9, 2011 Leave a comment

Lately, I’ve been developing Android applications with Maven support and, while it’s rather easy to mount a mature development environment with Eclipse, the usage of android-maven-plugin has brought some integration issues when debugging.

Usually, I do most of my Maven and debugging stuff in a terminal console. But others will prefer to use Eclipse! And I can understand why, since its DDMS perspective is so powerful and easy to use.  Here’s how you can do it:

  1. mvn clean package
  2. Deploy the target/xxx.apk to the device
  3. Open DDMS perspective in Eclipse
  4. Select the process you want to debug/trace
  5. There you go!

From profiling to thread debugging or simply adb logcat, you’ll have it all!

Don’t forget to configure permissions for your user to access the device. Ever hard those “?????” when issuing adb devices stating you have no permissions? Here’s how you can fix it (in Ubuntu-based distros at least):

  1. Run lsusb
  2. Check the line for your device, such as Bus 001 Device 008: ID 0bb4:0cab High Tech Computer Corp.
  3. Edit a new udev rule by executing sudo nano /etc/udev/rules.d/51-android.rules as seen bellow the bullet list
  4. Save file and issue sudo service udev restart
SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666
Reconnect your device and you’re done!

Debugging running APK in Eclipse DDMS

Installing Ubuntu 9.04 into Alix2d3

August 29, 2009 7 comments

Hi fellow geeks!

For sometime now, I’ve been looking forward to acquire an embedded system that would become my home router and testbed for some networking stuff I’m working on. The requisites are the following:

  • Noiseless, cause I want to sleep with it right next to me
  • Very small
  • x86 architecture, cause I want it as a testbed for my networking applications and don’t want to fiddle with architecture vs compiler/libraries issues
  • Two or more Ethernet devices
  • USB and mini-PCI are pluses
  • Cheap!!

Thanks to my friend João Barraca, I went for a PC Engines Alix ALIX2D3. And must I say, it’s great!! And only 104Euro + 26Euro (customs taxes).  I’m not showing the unboxing process, but here’s a picture of the board.

ALIX2D3 board

ALIX2D3 board

I did some things wrong though, on the rush of getting a new toy (don’t you geeks know this feeling?!). First PC Engines is based in Switzerland, and therefor non-EU, and therefor customs taxes and a long wait for the delivery. Then I ordered the board and a black case only, so at arrival, I missed a DC, a Compact Flash card and a null-modem serial cable. I went to one of those big electronics market and bought the following:

  • Vivanco universal DC 7v-24v (I recommend setting it for 18v, depending on the number of devices you’ll be using, such as USB and mini-PCI stuff). Oh and be careful with the polarity of the board which you can find by looking down the FB18, and using the correct connector size, 2.1mm.
  • Sandisk CF Ultra II 4GB;
  • Null-modem serial cable (female-to-female);
  • Serial-to-USB adapter.

As I said, I also ordered a black case and I had an issue while assembling the board into it. The serial port hex nuts wouldn’t fit the case! Well, just remove them, insert the board, and attach them again. In the end, this is the result:

Board in the case

Board in the case

Front of "the machine"

Front of "the machine"

Size compared to the E71

Size compared to the E71

I recommend you install everything you need and test it before you put the board into the case, so you can avoid repeating the screw/unscrew process.

Now, let’s head for the installation.

  1. First, grab the alternate installer for the latest Ubuntu i386 (9.04 iso). Burn it.
  2. Plug your CF card into a USB card-reader and punch it in your PC/laptop.
  3. Boot from the CD and press F4. Select text-only system installation.
  4. Install Ubuntu into your CF. I recommend setting only one partition and not using swap as you don’t want to “burn” lifetime from your CF.
  5. Don’t install grub into the MBR of the first disk, but on the MBR of the CF.
  6. Reboot.
  7. Boot into your CF Ubuntu system and log-in.
  8. Install an ssh server. sudo apt-get install openssh-server
  9. Edit your /etc/network/interfaces and configure your network devices as you see fit.
  10. As you’re using your PC/laptop for the installation process, udev has persisted the currently existing network devices. You must remove all entries before putting the CF into the ALIX2D3 board, so that all Ethernet devices there are correctly named (eth0, eth1, eth2). Just issue echo “” > /etc/udev/rules.d/70-persistent-net.rules
  11. In order to protect the CF once more, edit your /etc/fstab and change relatime to noatime in the root line (/). Also, add the following lines:

none /tmp tmpfs nr_inodes=200k,mode=01777 0 0
none /var/tmp tmpfs nr_inodes=200k,mode=01777 0 0

Power off. Now, put the CF into the board and have fun through ssh. Enjoy :-)

Categories: Linux, Mobile, Networking, OSS, Tek, Work

Long time no see..

May 7, 2009 4 comments

Hi fellow geeks,

Been 2 months since my last post, I know. I have been quite busy at work! And I guess it’s time I talk a little bit of what I’m doing since November.

Well, for a start I left Nokia Siemens Networks for PDM&FC (I know the website is old, and not trying to excuse the inexcusable, let’s say that people there are actually busy working on real stuff). Anyway, leaving a corporate for an SME was a refreshing decision! I didn’t feel productive anymore, and that was something I couldn’t stand. People were great, though :-)

Arriving at the new company was nothing as I had in mind. In the initial couple days, it was hard to find someone who could spare some time pointing me what to do and where to start. Soon, I realized everyone was so very busy working on their projects. Nonetheless, I was kindly received by my new coworkers, and I was eager to start showing what I’m able to do.

I started with some minor tasks like writing some Python + Gstreamer code for video-transcoding stuff; then some PHP spaghetti; ending with architectural design discussions for a scalable web service-oriented platform. But the true thing I was recruited for was yet to come, the EU-funded project (FP7) HURRICANE.

HURRICANE aims at delivering a framework to enable and execute seamless handover between heterogeneous radio access networks like 802.11, 802.16 aka WiMAX, DVB-H and 3GPP (UMTS). Let me throw some major concepts so you can better understand what I’m doing..

  • Handover – process of transferring an ongoing call or data session from one channel connected to the core network to another (see Handoff);
  • IEEE 802.21 – aka Media-Independent Handover (MIH) Service, this emerging standard is the base for this project, comprehending the facilitation of handover analysis procedures. The resulting decision process and execution is out-of-scope of the standard.

And this is what HURRICANE proposes: to provide an implementation of the .21 standard, some handover-decision/execution modules on top of it, and also the lower-layer access to the identified RATs (Radio Access Technologies).

802.21 - Media-Independent Handover

My main function on this project is to implement the proposed framework. Starting on the .21 generic service, the MIH Function (MIHF) and going through several stages of the link-layer (I hope to skip the real part on this), we’ll end by having, I hope, a real seamless handover between 802.11 and 802.16 – there are some more scenarios defined, but due to hardware access limitations, I don’t believe they’ll be fully deployed – powered by HURRICANE. Also, I’m the responsible to study (done!) and implement a PMIPv6 module to IP-mobility on top of this architecture.

A lot of work has been done, but there’s much more to do! I’m thrilled to see what we’ll achieve by the end of this year. In the meanwhile, I’ll be posting about casual stuff I shall be working on :-)

Cheers to you all, and cya soon!

Yours truly

Categories: Life, Mobile, Networking, Tek, Work

My MIPv6 testbed

February 26, 2009 6 comments

Oh yeah, just got “my” MIPv6 testbed up and running. It’s a work task actually, but some material is mine like the Asus EeePC and the Nokia N810. Well, just wanted to share with the world how wonderful it is :-p

Super-cool MIPv6 testbed

Super-cool MIPv6 testbed

Enjoy you geeks!

Categories: IPv6, Linux, Mobile, Networking, OSS, Tek, Work

Defining multiple IPv6 addresses in one single NIC in Linux

February 26, 2009 1 comment

While on my MIPv6 quest, I needed to define two IP addresses to a single ethernet card. Well, I thought the usual aliases thing would suffice, but I guess I was wrong since that didn’t work, complaining something like:

SIOCSIFFLAGS: Cannot assign requested address

So I remembered that, at least in Linux, you can have multiple IPv6 addresses in one single NIC just by issuing the command:

ip -6 addr add 2001:db8:a::1/64 dev eth0

This worked out! But now I wanted to add it to my /etc/network/interfaces so that the changes would be permanent. After some googling I found out that all I had to do was to add the previous command like follows:

auto eth0
iface eth0 inet6 static
address 2001:db8:f:1::1/64
netmask 64
up ip -6 addr add 2001:db8:a::1/64 dev eth0

Then just reboot or execute:

sudo ifconfig eth0 down
sudo /etc/init.d/networking restart

And there you go! Multiple IPv6 in one single NIC the easy way :-)

Categories: Linux, Mobile, Networking, OSS, Tek, Work

Custom kernel for Asus Eee PC

February 18, 2009 7 comments

Recently a relative of mine bought an Asus Eee PC 4G (I believe it’s aka 701) with Windows XP. It’s a sweet device for any geek to have around, btw :-)

Oh well, some cola over the keyboard made it unusable.. at least for the previous owner. That’s right, “previous”! Why? Well, there it was, this beautiful black toy, thrown to a dark and cold corner as if dead and I couldn’t resist to ask for a look. We agreed that if I got it to work, it would be mine. And so it was.. Now I only need to test if the built-in keyboard is really dead or if it’s a controller problem. Anyway, I’m using my Apple USB keyboard for home fun.

Asus EEE PC 701

Asus EEE PC 701

After the hardware issues I got to the software part aka replacing the bundled Windows XP with Linux. As I was in a hurry I looked for the default Linux distro that comes with these babies, Xandros Linux, just to find out that it’s not freely available. Oh well, it actually sucks anyway compared to the distro I’m using right now, eeeubuntu. As a strong Ubuntu user and supporter for some years now, I am biased here of course, but it truly suits my needs without any hacks. First of all you have to select and download one of three versions: standard – a full blown desktop; nbr – Netbook Remix says it all; base – for disk space paranoids. I went for the nbr flavour and I’m quite happy with it!

The .iso file can be then processed into a CD that you’ll read using an external CD/DVD drive or simply by going the Ubuntu way, building and using a bootable USB stick. And so, after something like fifteen minutes I had my shiny new operating system up and running :-)

After some adding/removing software, I wanted to start hacking this little bitch to get MIPv6 working on it, meaning I had to recompile the kernel which in this distro is obviously compiled with some external modules. I once tried it in a Xandros installation, and it was quite trivial, but now I wanted to package my changes into a .deb file I could replicate for others, like eventually yourself. I found out that there are already very good instructions to do so, and not wanting to add more noise to the web, I’ll just document the steps I took.

First, you’ll need some packages. I believe the following command package “list” is incomplete as I’ve used this machine before for compiling other stuff like OpenWRT. Still, you should be able to easily identify the missing parts :-)

sudo apt-get install build-essential debhelper fakeroot git-core

Update (thanks to _trine @ freenode):From now on, I assume your user has got write-permission for /opt.
Get the tailored kernel source from array.org git repository (in my case I’m using Intrepid Ibex).

cd /opt
git clone git://git.array.org/array/ubuntu-intrepid.git

Now, manage a .config file which in this case is a bundle of default config and config.eeepc:

cd ubuntu-intrepid
cat debian/config/i386/config debian/config/i386/config.eeepc > .config

Define your kernel options as you see fit:

make menuconfig

Prepare things and package up:

cp .config debian/config/i386/config.eeepc
debian/rules updateconfigs
make mrproper
fakeroot debian/rules binary-eeepc binary-headers
cd ..

Now copy the packages into your machine and install them. Reboot and be happy :-)

Update: I’ve received hundreds of thousands of billions screenshot requests from all over the World, the ISS and even someone who I believe is from Mars. Well, you didn’t have to wait much, now did you?

megatron running eeeubuntu

megatron running eeeubuntu

Categories: Linux, Mobile, Networking, OSS, Tek, Work

802.21

December 12, 2008 1 comment

I’ve been looking into 802.21 aka MIH and I’d like to know if there’s any known effort for developing an open-source implementation of this protocol. Also I’d like to know about any possible interest in participating in such endeavour.

Categories: Mobile, Networking, OSS, Tek
Follow

Get every new post delivered to your Inbox.