Skip to content

Cubietruck - ready for mischief

In the last few days I finally found the time for fiddling with my Cubietruck again. I switched the harddisk for a small SSD I had laying around. Now it makes no noise at all.



After experimenting with Lubuntu for Cubietruck and not being satisfied with the newer "official" choices I decided to go with Igor's Debian Build. Wheezy is showing its age and with Jessie around the corner I chose the Jessie build - excited for systemd. The NAND-install script worked for me at the first try, perhaps because I've already had Lubuntu installed from my former experiments with the cubietruck,


Cubietruck - First obstacles

During the setup I encountered the first two obstacles. The first one was during the installation. I followed this instructions to install the supplied image of Lubuntu to the NAND memory. I decided to install the server release, but the steps are the same. I installed it under windows, so I had to download the PhoenixSuite instead of the LiveSuite. The first obstacle I encountered was that after the board entered FEL mode it did not get recognised by the PhoenixSuite. I figured it must be the missing driver, Windows complained earlier after connecticting the Cubietruck. You can find the driver in \PhoenixSuit\Drivers and install it via the Windows Device Manager. Right click on the unknown device and install the driver.



The second obstacle was to fit the Cubietruck into the case I bought. Luckily the announcement post for case comes with detailed instructions. I suggest you follow them to the letter. Be careful with the IR receiver.


New Hardware: Cubietruck

I got some new hardware: A Cubietruck (Cubieboard 3)

Over the following weeks I plan to configure and set it up as DNS and DHCP server for my home network. I also plan to put some network monitoring on it and a network share, mainly for music. I already run DNS and DHCP on a Raspberry Pi, but it's more of a makeshift setup and I want to use the Raspberry for other tasks. At the same time, a Raspberry Pi, due to its hardware limitations, is not the best device to offer network shares. I already have a full-blown home server but I don't run it 24/7 and I usually don't want to start it, just to listen to music from my collection that is not on Spotify.



Services I plan to run:




  • DNS

  • DHCP (with DDNS)

  • Network-Monitoring

  • SMB-Share

  • ???



If I run into obstacles while setting this up I plan to blog about them and how I overcome them.


The C Challenge - VirtualBox troubles

I finally wanted to continue my foray into C. But, shockingly, my VM in Virtual Box refuses to start. And neither does a new VM.



Cannot access the kernel driver!




Cannot access the kernel driver!


 


I tried reinstalling and I tried manually installing the driver from "C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv". So far I'm out of luck. I'm going to keep you updated on my progress resolving this issue.


 


Update: A repair install did the trick. I will probably never know why a regular reinstall did not help.


MOVE-CORRESPONDING and performance

A thing that many ABAP programmers may have heard early in their career is to avoid "MOVE-CORRESPONDING" because it performes badly. The aspiring programmers then are quickly told to only move the field of the structure they need. This can become tedious and prone to error quickly. But sometimes one have to make sacrifices during design/developement time, to save execution time.

I don't know if the performance hit of MOVE-CORRESPONDING has ever been true, (perhaps in ancient releases) but according to some tests Ashok Kumar Rajagopal ran and published on the SCN a program using MOVE-CORRESPONDING does not only performe on par with "manual" moves, but actually performes better.

So, in my opinion, there is no reason left to not use MOVE-CORRESPONDING. It looks nicer, is less work to type and actually performes better.

FOR ALL ENTRIES IN itab

In light of recent events: There is a small caveat to the "FOR ALL ENTRIES IN itab WHERE"-clause. This is an incredibly useful addition to the where condition when you need to do selects based on the content of an internal table. But the trap is, that if your itab is empty the SELECT returns all rows, instead of nothing. This is actually well documented behaviour, still a lot of developers fall into this trap.

Your code should look more like this:




IF itab IS NOT INITIAL.
  SELECT col1, col2
  FROM dtab
  INTO TABLE target
  FOR ALL ENTRIES IN itab
WHERE colx = itab-eval.
ELSE.
"handle empty itab if necessary
ENDIF.


You can omit the else clause depending on your code.


The C Challenge - Picking it up again

I plan to pick up C again next week. I will continue with Excercise 23 but I will also look into some more practical applications of what I've learned so far to learn from real challenges. I'm not sure yet what to do, though. I'm quite interested in networking related stuff, so I guess I could look into some simpler tools and try to understand the source, fiddle with it and perhaps implement some of them myself.