Categories
Programming Python VSCP

New version pyvscpclasses 0.0.9

A new version 0.0.9 of pyvscpclasses has been published.

Updated class/type definitions

Categories
Programming Python VSCP

New version of pyvscp-sensors-bme680 script 1.0.1

New version that remove directional part of topics which is specified by the VSCP standard document.

Available on PyPi

Docs are here

Categories
Programming Python VSCP

New release of pyvscptypes 0.0.8

Updated to latest class/type definitions

Available on PyPi

Categories
Programming Python VSCP

New release of pyvscpclasses 0.0.8

Updated to latest class/type definitions

Available on PyPi

Categories
Programming Python VSCP

New version of node-vscp-class (1.0.11)

A new version of the package node-vscp-class (1.0.11) was published at 2020-12-01T11:41:21.819Z. The shasum of this package was 4c6327ab52dab75a947a01fd1bcef1c65a92db8c.

Updated class/type definitions to latest

Categories
Programming Python VSCP

New version of node-vscp-type (1.0.9)

node-vscp-type (1.0.9)
A new version of the package node-vscp-type (1.0.9) was published at 2020-12-01T11:44:02.363Z. The shasum of this package was 78d8cce89b53ba3c300839d9d15629e284e5c276.

Update to latest type defs.

Categories
Programming Python VSCP

New release of pyvscp 0.3.9

  • Removed dependency on json module
  • Added getIsoDateTime(), getGuidStr() and toJSON() methods for vscp event classes

Available on PyPi Se also pyvscphelperpyvscpclasses and pyvscptypes

Docs are here

Categories
Programming Python VSCP

New release of pyvscp 0.3.7

  • Added dump to standard event class
  • Standard event now has UTC time set on create
  • Fixed timestamp setting
  • Added timestamp setter (also to constructor)
  • Added constructor with GUID assignment
  • Added missing getmac import
  • Fixed head constants
  • Added new double precision data type
  • Synced VSCP header data
  • Added setGUIDFromMAC

Available on PyPi Se also pyvscphelper, pyvscpclasses and pyvscptypes

Docs are here

Categories
Python VSCP

#VSCP #Python libs.

I have released updated versions of the Python libs. They are still in alpha so structural changes can still happen. Be aware. Docs are also sparse at the moment but there are some simple samples available in the repositories for each lib. pyvscphelper is documented alongside the standard vscphelper library.

You find the libs here Install with

pip install <lib>

Update with

pip install --upgrade <lib>

For more information about VSCP go to the VSCP main site.

/Ake

Categories
Programming Raspberry Pi

Building #ARM #Raspbian packages on your #Intel PC

If you are a maintainer of a software project as I am, you probably spend a lot of time testing and deploying code. The more platforms you add the harder this gets and at some point you need to think carefully what you can do to minimize manual work.

I build things for Ubuntu/Debian/Raspian and Windows. In the beginning a lot of the deployment here was done on each platform. Hours spent on this for each release. Frustrating. I decided to do some scripts that would make it possible to do the first tree automatically. Saving time if I could get it to work.

I found Stein Magnus Jodal‘s excellent article Building ARM Debian packages with pbuilder and he is the only one that should take credit for the things I describe here. I am just a copy cat in this case, well more or less, just adding some vital things.

I had no major problem to get buildings for Ubuntu and Debian to work with pbuilder following Stein Magnis Jodal’s document. The ARM builds was another thing. What I got was this

...
 qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x60184bcc
 qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x600019f9
...

qemu (or rather pbuilder-satisfydepends) fails when checking dependencies. After a long struggle I found that replacing pbuilder-satisfydepends with pbuilder-satisfydepends-apt was a solution to this problem.

I repeat the steps from Stein Magnis Jodal’s document here with my changes and updates and comments to get things working. Again credit is to Stein Magnis Jodal.

Setup pbuilder environment

Add a file .pbuilderrc to your root acount with the following content

!/bin/sh
 set -e
 if [ "$OS" == "debian" ]; then
     MIRRORSITE="http://ftp.se.debian.org/debian/"
     COMPONENTS="main contrib non-free"
     DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}"
         "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg")
     : ${DIST:="stretch"}
     : ${ARCH:="amd64"}
     if [ "$DIST" == "jessie" ]; then
         #EXTRAPACKAGES="$EXTRAPACKAGES debian-backports-keyring"
         OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE jessie-backports $COMPONENTS"
     fi
 elif [ "$OS" == "raspbian" ]; then
     MIRRORSITE="http://ftp.acc.umu.se/mirror/raspbian/raspbian/"
     COMPONENTS="main contrib non-free"
     PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-apt"
     DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}"
         "--keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg")
     : ${DIST:="stretch"}
     : ${ARCH:="armhf"}
 elif [ "$OS" == "ubuntu" ]; then
     MIRRORSITE="http://se.archive.ubuntu.com/ubuntu/"
     COMPONENTS="main restricted universe multiverse"
     DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}"
         "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg")
 else
     echo "Unknown OS: $OS"
     exit 1
 fi
 if [ "$DIST" == "" ]; then
     echo "DIST is not set"
     exit 1
 fi

Note the PBUILDERSATISFYDEPENDSCMD under the Raspbian section.

Now pbuilder will require three environment variables (in upper case) for it’s use

OS

The os you build for.It can be set to ubuntu, debian or raspbian

ARCH

The arcitecture you are builing for. It can be any of amd64, i386, armel, or armhf. Yes som eother supported arcitecure also of course.

DIST

Distribution of the os. For Debian/Raspbian buster, stretch, jessie. For Ubuntu eoan, disco, bionic, xenial, trusty. Well others shoudl work to.

If you are on a PC qemu-debootstrap is used for the ARM builds. So you have to install it with

sudo apt install pbuilder qemu-user-static

We also need the keyrings. For Ubuntu and Debian install them with

sudo apt install ubuntu-keyring debian-archive-keyring

If that for some reason does not work you can fetch the keyring fro Debian at https://packages.debian.org/sid/all/ubuntu-keyring/download and for Ubuntu keyring can be fetched here https://launchpad.net/ubuntu/+source/ubuntu-keyring

The keyring for Raspbian you can get here

 wget http://archive.raspbian.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2_all.deb  
sudo dpkg -i raspbian-archive-keyring_20120528.2_all.deb

Now you need to build the chroots. You do this with steps like

sudo mkdir -p /var/cache/pbuilder/debian-stretch-amd64/aptcache/  
sudo OS=debian DIST=stretch ARCH=amd64 pbuilder --create

Replace OS/DIST/ARCH for your needs.

All you need now is the Debian source package for the code you want to work with. Go to the folder where it is and issue

sudo OS=debian DIST=stretch ARCH=armhf pbuilder build *.dsc

Replace OS/DIST/ARCH for your needs.

If all goes well you find the resulting package in

/var/cache/pbuilder//var/cache/pbuilder/debian-stretch-amd64/result/

replace ‘stretch’, ‘amd64’ and ‘debian’ as to you settings for DIST, ARCH and OS.

If you rather want you can go into an unpacked source folder and issu

tar xvf ../src-pkg.debian.tar.xz
tar xvf ../src-pkg.orig.tar.gz
sudo OS=debian DIST=stretch ARCH=amd64 pdebuild

Again replace OS/DIST/ARCH for your needs.

Thats it really.

I experienced situation when dh-autoreconf was not available in the chroot and when it did not get installed. This was for Ubuntu. If this happens you can instll it manually with

sudo OS=ubuntu DIST=xenial ARCH=amd64 pbuilder --login --save-after-exec 
apt install dh-autoreconf 
exit

Hope this can save some time for someone. And again thanks to Stein Magnis Jodal for his work.

Lazy section

Below is some code you can use if you think typing on a keyboard is tiresome…

Ubuntu

sudo mkdir -p /var/cache/pbuilder/ubuntu-trusty-amd64/aptcache/
sudo OS=ubuntu DIST=trusty ARCH=amd64 pbuilder --create
sudo OS=ubuntu DIST=trusty ARCH=amd64 pbuilder build vscpl2drv-automation1_1.1.0-1.dsc

sudo mkdir -p /var/cache/pbuilder/ubuntu-xenial-amd64/aptcache/
sudo OS=ubuntu DIST=xenial ARCH=amd64 pbuilder --create
sudo OS=ubuntu DIST=xenial ARCH=amd64 pbuilder build vscpl2drv-automation1_1.1.0-1.dsc

sudo mkdir -p /var/cache/pbuilder/ubuntu-bionic-amd64/aptcache/
sudo OS=ubuntu DIST=bionic ARCH=amd64 pbuilder --create
sudo OS=ubuntu DIST=bionic ARCH=amd64 pbuilder build vscpl2drv-automation1_1.1.0-1.dsc

sudo mkdir -p /var/cache/pbuilder/ubuntu-disco-amd64/aptcache/
sudo OS=ubuntu DIST=disco ARCH=amd64 pbuilder --create
sudo OS=ubuntu DIST=disco ARCH=amd64 pbuilder build vscpl2drv-automation1_1.1.0-1.dsc

sudo mkdir -p /var/cache/pbuilder/ubuntu-eoan-amd64/aptcache/
sudo OS=ubuntu DIST=eoan ARCH=amd64 pbuilder --create
sudo OS=ubuntu DIST=eoan ARCH=amd64 pbuilder build vscpl2drv-automation1_1.1.0-1.dsc

Debian

For the arm builds you may need to add the line

PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-apt"

to your pbuilder configuration (.pbuilderrc) file.

sudo mkdir -p /var/cache/pbuilder/raspbian-jessie-amd64/aptcache/
sudo OS=raspbian DIST=jessie ARCH=amd64 pbuilder --create
sudo OS=raspbian DIST=jessie ARCH=amd64 pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-stretch-amd64/aptcache/
sudo OS=raspbian DIST=stretch ARCH=amd64 pbuilder --create
sudo OS=raspbian DIST=stretch ARCH=amd64 pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-buster-amd64/aptcache/
sudo OS=raspbian DIST=buster ARCH=amd64 pbuilder --create
sudo OS=raspbian DIST=buster ARCH=amd64 pbuilder build *.dsc


sudo mkdir -p /var/cache/pbuilder/raspbian-jessie-i385/aptcache/
sudo OS=raspbian DIST=jessie ARCH=i385 pbuilder --create
sudo OS=raspbian DIST=jessie ARCH=i385 pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-stretch-i385/aptcache/
sudo OS=raspbian DIST=stretch ARCH=i385 pbuilder --create
sudo OS=raspbian DIST=stretch ARCH=i385 pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-buster-i385/aptcache/
sudo OS=raspbian DIST=buster ARCH=i385 pbuilder --create
sudo OS=raspbian DIST=buster ARCH=i385 pbuilder build *.dsc


sudo mkdir -p /var/cache/pbuilder/raspbian-jessie-armle/aptcache/
sudo OS=raspbian DIST=jessie ARCH=armle pbuilder --create
sudo OS=raspbian DIST=jessie ARCH=armle pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-stretch-armle/aptcache/
sudo OS=raspbian DIST=stretch ARCH=armle pbuilder --create
sudo OS=raspbian DIST=stretch ARCH=armle pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-buster-armle/aptcache/
sudo OS=raspbian DIST=buster ARCH=armle pbuilder --create
sudo OS=raspbian DIST=buster ARCH=armle pbuilder build *.dsc


sudo mkdir -p /var/cache/pbuilder/raspbian-jessie-armhf/aptcache/
sudo OS=raspbian DIST=jessie ARCH=armhf pbuilder --create
sudo OS=raspbian DIST=jessie ARCH=armhf pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-stretch-armhf/aptcache/
sudo OS=raspbian DIST=stretch ARCH=armhf pbuilder --create
sudo OS=raspbian DIST=stretch ARCH=armhf pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-buster-armhf/aptcache/
sudo OS=raspbian DIST=buster ARCH=armhf pbuilder --create
sudo OS=raspbian DIST=buster ARCH=armhf pbuilder build *.dsc

Raspbian

Use armle for Raspberry Pi 1

sudo mkdir -p /var/cache/pbuilder/raspbian-jessie-armhf/aptcache/
sudo OS=raspbian DIST=jessie ARCH=armhf pbuilder --create
sudo OS=raspbian DIST=jessie ARCH=armhf pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-stretch-armhf/aptcache/
sudo OS=raspbian DIST=stretch ARCH=armhf pbuilder --create
sudo OS=raspbian DIST=stretch ARCH=armhf pbuilder build *.dsc

sudo mkdir -p /var/cache/pbuilder/raspbian-buster-armhf/aptcache/
sudo OS=raspbian DIST=buster ARCH=armhf pbuilder --create
sudo OS=raspbian DIST=buster ARCH=armhf pbuilder build *.dsc

This info is current when this is written but may not be when you read it.