Fred's Home Page

About me
csh is bad
Help out
KRoC/Linux (old)
occam upgrades
occam tutorial
Projects (PhD)
Quick gdb
UNIX crashcourse
WG / WGBuilder


(some people call these things blogs)

The last 8 entries are displayed on this page, older ones can be found here. An RSS feed is available here.


Apologies for any lack of communication on my part! I've got about 4" of exam questions to mark and an inbox with over 900 messages waiting to be dealt with. Things moving forward steadily however; for urgent things, repeated email prods may be the way to go (or give me a call).


Straight into the thick of it, oof. Mostly spending time preparing teaching for this term, and I have a lot! Also picked up an extra 20% role as "Undergraduate Director of Studies (QA)", that really does require some time put into it! (and a good excuse for some crude PHP hacking to build a coursework deadline co-ordination/planning thing — as a colleague said, an interface only a mother could love, but hey, it works! ;-)).

Managed to put a bit more time into Guppy and the EV3, heading closer towards my 4x dining-philosophers. The LEGO is built but untested, and I only just tested driving the motor from Guppy the other day, but that sort of worked (needs my Github version of Ralph Hempel's ev3dev-modules that has the /dev/ interface in it). At the moment it looks like this:

@include "guppy_stdlib.gpi"

@external "guppy" "define ev3_pwm_init () -> bool = 64"
@external "guppy" "define ev3_pwm_shutdown () = 64"
@external "guppy" "define ev3_pwm_on_fwd (val int motor, val int power) = 64"
@external "guppy" "define ev3_pwm_off (val int motor) = 64"

define test_g56 (chan(string) screen!)
  timer tim
  int t
  bool b
    screen ! "hello, EV3 world!\n"
    b = ev3_pwm_init ()
    if (b == false)
      screen ! "failed to initialise PWM device..\n"

    tim ? t
    ev3_pwm_on_fwd (0x01, 30)
    tim ? after (t + 300000)
    ev3_pwm_off (0x01)

    screen ! "done!\n"

    ev3_pwm_shutdown ()

Just back from visiting the Stella Maris Primary School in Folkestone, showing a group of year 4 children some LEGO robots and answering a lot of fairly inquisitive questions! Also met Stella the class gecko, which was a fairly placid but quite large creature.


Happy New Year! :-). Picked up where I left off getting an MSc student project from last year ready for teaching in a few months. This is a simple IDE for writing AVR assembly aimed at the Arduino Uno, written in C++ (g++) using Qt (and the pretty snazzy Qt Creator IDE) also using QScintilla, calling nocc to do the lexing for QScintilla and for assembling the code proper (then avrdude to upload to the Arduino). Decided for a second time that I don't care much for object-oriented in C++. Whilst the abstraction is mostly comfortable (and does apply well to some things), layer on layer of inheritance and overriding can make it very hard to follow independent bits of code within the system, without some broad global knowledge. For the time being I'll stick to my default C approach of structures and lots of parameters-passing.


Had some crazy wind+rain on the 23rd that nearly took a tree out (now it's just leaning precariously). The storms managed to take the power out too (again, really need to replace the UPS..). The only device that survived the 8+ hour outage was my LEGO EV3 (running at essentially zero load) which has now been up for 15 days!


Dangers of living on the edge (of operating-system distributions): after several days of NVIDIA kernel mismatch warnings and other semi-upgraded machine unhappiness, the X server finally vapourised itself, taking with it around 80 xterms and 83 VIM sessions (neatly awaiting recovery) :-(. At least things seem more stable after a good reboot :-).


Erlang up and running on the EV3 again, so time to continue prodding that one. Also writing some code for the Arduino Uno based RF receiver for a student project, getting close to the point of having it send UDP packets (with nothing much in them to start with!).

One of our cats broke my yellow plate, very sad. broken plate Bought this back in 1998 from Tesco, along with a yellow duck (I think Steve still has his!), whilst a student. Keeping eyes open for a replacement though!


Was about to start doing something more serious with the LEGO EV3, then got distracted because I'd somehow bricked the SD card. Lots of block device errors started appearing, which led to something going bad. Possibly some issue related to my D-Link USB hub, or software handling of it, since plugging it direct into the host made all those problems go away. Also discovered that the good folk at mindboards github repo (Ralph Hempel) have made a Debian distro for the EV3. After some prodding and poking, this now boots successfully :-). Just in the process of getting Erlang running on it again, using the same cross-compile toolchain (Sourcery G++ Lite 2009q1-203), which built hello-world okay. Tried a more recent version (Sourcery G++ Lite 2011.03-42) but that failed to build an executable, for now.


Another year ticks by, many thanks to all for birthday greetings and presents :-). Many thanks and love to wife for a shiny espresso/cappuccino machine, which does a lovely job :-).

Some more prodding around with the LEGO EV3, this time to get Erlang running on it. After some prodding around with the cross-compile stuff, which by and large worked as the HOWTOs suggested (++), have a seemingly working Erlang system running on the EV3. This (probably a poor example) hello-world program:


hello_world() ->
	io:fwrite("Hello world from Erlang!\n"),
	io:fwrite("  version:   ~s\n", [erlang:system_info(version)]),
	io:fwrite("  OTP release: ~s\n", [erlang:system_info(otp_release)]),
	io:fwrite("  system ver: ~s\n", [erlang:system_info(system_version)]),
	io:fwrite("  system arch: ~s\n", [erlang:system_info(system_architecture)]),
	io:fwrite("  machine: ~s\n", [erlang:system_info(machine)]).

is compiled and run in the Erlang shell (erl) thus:

frmb@EV3:~/erlang$ erl
Erlang R17A (erts-5.11) [source-236b48c] [async-threads:10] [kernel-poll:false]

Eshell V5.11  (abort with ^G)
1> c(hello).
2> hello:hello_world().
Hello world from Erlang!
  version:   5.11
  OTP release: R17A
  system ver: Erlang R17A (erts-5.11) [source-236b48c] [async-threads:10] [kernel-poll:false]

  system arch: arm-none-linux-gnueabi
  machine: BEAM

Next up, time to prod around with the EV3's motor and sensor interfaces, which the LEGO folk have done a great job of documenting nicely :-). Then some gluing together of this stuff with the Erlang Embedded ALE framework.

Last modified: 2015-06-01 21:29:47.194351691 +0100 by Fred Barnes [ds] [plain]
Page generated: Mon Jun 01 21:29:48 2015
Valid XHTML 1.0! Valid CSS!