Getting Co-ap tools working on Debian

Debian ,FLOSS
June 3, 2020

At work we have a wonderful pyhon tool that we are able to send CoAP messages to and from our products. Perfect for development work. However recently I needed to install a copy of the tools onto my personal laptop because the only work laptops I have access to have completely dead batteries and so are not suitable for taking out into a field to perform RF range tests….

As a company we have chosen not to package internal development tools – I think that this is a mistake, but this is not my decision. So I simply copied across the coap tools directory and tried to run them. Obviously nothing worked! However, the error messages were enough to work out what dependencies I needed to resolve.

Error #1 Missing libasan.so.2 shared library
By a process of deduction we found that gcc5 contains libasan2, quite old.
Debian’s snapshots was our saviour here:

wget http://snapshot.debian.org/archive/debian/20180412T100152Z/pool/main/g/gcc-5/libasan2_5.5.0-12_amd64.deb

wget http://snapshot.debian.org/archive/debian/20180412T100152Z/pool/main/g/gcc-5/gcc-5-base_5.5.0-12_amd64.deb

dpkg -i ./gcc-5-base_5.5.0-12_amd64.deb ./libasan2_5.5.0-12_amd64.deb

great – that was enough to get the port bindings to work

Error #2 google.protobuf

When I tried to issue coap requests I ran into missing python3 imports “google.protobuf” fortunately this is found packaged in Debian buster as party of python3-protobuf

apt-get install python3-protobuf

Done! everything works :-)