Tuesday, March 24, 2015

Redlink Connection Refused


Trying to launch LPCXpresso Redlink server, getting a "connection refused" because a shared library is missing? Online forum threads like this one don't help?

Here's the real answer: actually troubleshoot and solve the problem on your unsupported Linux distro. It's easy, just read on...
First, find out exactly what is going wrong by running redlinkserv from the command line:

/usr/local/lpcxpresso/lpcxpresso/bin/redlinkserv 

If you see the error "could not load shared redlink object" then run strace to see what library the server is trying to open. 

strace /usr/local/lpcxpresso/lpcxpresso/bin/redlinkserv 

Look through the output for open() syscalls like this one.

open("/usr/local/lib/libudev.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

The problem is that redlinkserv cannot find libudev.so.1 because the 32-bit version of libudev is named something different on your distro. (I'm using Mint 13, for example). First, you have to find the i386 library. Use find to search for the file. Specify -type f to ignore softlinks. Search in /lib, /usr/lib (try other directories if you don't find it in these):

$ find -type f /lib /usr/lib -name 'libudev.so.*' -type f
/lib/i386-linux-gnu/libudev.so.0.13.0
/lib/x86_64-linux-gnu/libudev.so.0.13.0

If you don't find it, you'll need to install it (apt-get install libudev0 or equivalent)

You want the 32-bit version. Use ls to find out which is a valid link/file. Then soft link to this from /usr/local/lib:

cd /usr/local/lib
sudo ln -s /lib/i386-linux-gnu/libudev.so.0.13.0 libudev.so.1

And all should be well.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.