Tutorial: Using Matlab compiled classes from within Python

Unlike other Matlab features, it seems that using Matlab compiler for creating a Python package is poorly documented. It took me quite some time, mostly by trial and error, to understand how to use Matlab classes (classdef) from within Python.

In this tutorial we will discuss the following basic Matlab class:

Modifying the class for efficient work from python

We inherit our class from “handle”  (Handle classes define objects that reference the object data. Copying an object creates another reference to the same data.)

read more

Parallella with kernel 4.4.3

Booting Parallella with latest Linux kernel has many benefits – docker support, security, speed. Thanks to kernelci project, it’s quite easy:

Prerequisites (needed for manual process only)

  1. Connect Parallella UART 3 pins and make sure you see boot messages
  2. Power up Parallella with no SD card inserted
  3. Set timeout for U-Boot

     

Prepare SD card

  1. Download official trusty image and burn it on SD card
  2. Download pre-built images
  3. Build uncompressed kernel image (uImage)
  4. Copy the following files to /boot partition

Manual Boot Process

  1. Hit any key during 5 secs delay in U-Boot to get prompt
  2. Load FPGA
  3. Load kernel, dtbd, set args and boot
    setenv bootargs ‘console=ttyPS0,115200 root=/dev/mmcblk0p2 ip=dhcp’

Automatic boot

I don’t feel confident enough to alter Uboot settings, but the following procedure seems to be working without any special bootargs:

  1. Put newly created uImage instead of 3.14 image on your Sd card /boot partition
  2. Rename zynq-parallella.dtb to devicetree.dtb (instead of the original)

Boot the device – for me it worked (no UART prompt)! 🙂

References

  • https://github.com/parallella/parallella-linux/issues/8
  • https://parallella.org/forums/viewtopic.php?f=23&t=1711

read more

Repair Windows 10 – the only correct way!

For all you having trouble with running

or

and receiving the following error

Here is probably the only working solution:

  1. Download original Windows 10 ISO from here (Microsoft website)
  2. Mount the ISO image (Right Click -> Mount)
  3. Create new dir – e.g. “c:\mount” (mkdir c:\mount)
  4. Mount install.wim from ISO, where X is the drive you mounted ISO to:
  5. Make sure the result is
  6. Run DISM:
  7. Run SFC to verify everything is Ok

     

read more

Optimizing Parallella network throughput

15478282925_5accdb9d95_o-600x400

I like Parallella board very much in terms of performance, form-factor and price. So I decided to measure it’s performance in terms of Ethernet throughput. Xilinx XAPP1082 reference design for Zynq FPGAs measured very promising performance, therefore my initial thought was Parallella should not fall behind (even though results from 2013 were not very promising).

The Setup

Parallella hardware: based on Zynq 7010

Parallella firmware: Ubuntu 14.04.4 LTS (GNU/Linux 3.14.12-parallella-xilinx-g40a90c3 armv71)

read more

Installing PyGrib on Ubuntu 14.04

pygrib is a leading python package for parsing weather GRIB files.

Install grib-api

Install pygrib

  • open setup.cfg
  • Uncomment grib_api_dir and set it to

  1. Save
  2. Run

Test

 

Easy Ansible provisioning withing Vagrant running under Windows

It’s not a big secret Ansible is not supported under Windows, therefore default Ansible plugin for Vagrant is not working.

It is still possible to run Ansible from within Vagrant VM (Ubuntu) without changing almost anything:

internal-ansible.sh

Create the following “internal-ansible.sh” file within your Vagrant root:

  • Change ‘vagrant.yml’ to whatever your root Ansible script you have

Vagrantfile

Comment out Ansible provisioner section within your Vagrantfile and add bash provisioner instead. Your file should look like the following:

 

read more