teensy loader

Status
Not open for further replies.

teopan1

New member
Hello!
So I installed arduino and teensyduino in kali linux. When I open a new file and trying to upload a sketch to my teensy 3.2 I get an error mesage which is saying "unable find teensy loader".
Here's an example code with the error message I get:

Code:
Arduino: 1.6.11 (Linux), TD: 1.30, Board: "Teensy 3.2 / 3.1, Keyboard + Mouse + Joystick, 96 MHz optimize speed (overclock), US English"

sketch_sep15b: In function 'void hitCaps()':
sketch_sep15b:59: warning: large integer implicitly truncated to unsigned type 
     Keyboard.set_key1(KEY_CAPS_LOCK);
                                    ^
sketch_sep15b: In function 'void spawnReverseTCP()':
sketch_sep15b:88: warning: large integer implicitly truncated to unsigned type 
     Keyboard.set_key1(KEY_R);
                            ^
sketch_sep15b:97: warning: large integer implicitly truncated to unsigned type 
     Keyboard.set_key1(KEY_ENTER);
                                ^
sketch_sep15b:180: warning: large integer implicitly truncated to unsigned type 
     Keyboard.set_key1(KEY_ENTER);
                                ^
[B]Opening Teensy Loader...
Unable find Teensy Loader.  Is the Teensy Loader application running?
Error compiling for board Teensy 3.2 / 3.1.[/B]

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I searched for the teensy loader and I saw that I have it inside the arduino-1.6.11/hardware/tools folder. Also I have the libpng16.
So where is the problem there?
 
Executable access rights etc. are ok? If so, then try "ldd ./teensy" in that directory and see if there are any problems (i.e. missing library links).
 
Because I am not so good at it this is the output I get from the command:

Code:
	linux-vdso.so.1 (0x00007ffe6cb92000)
	libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f613a385000)
	libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f613a0d0000)
	libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f6139ea9000)
	libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f6139b14000)
	libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f61398fe000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f61396db000)
	libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f613948f000)
	libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f61391e0000)
	libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f6138fa1000)
	libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f6138d4e000)
	libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f6138b4a000)
	libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f6138947000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f613873f000)
	libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f613842d000)
	libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f6138229000)
	libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f6138021000)
	libpng12.so.0 => not found
	libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f6137df6000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6137bdb000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f61379d7000)
	libusb-0.1.so.4 => /lib/x86_64-linux-gnu/libusb-0.1.so.4 (0x00007f61377cd000)
	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f613748a000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6137109000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6136e03000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6136bed000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f61369d0000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f613662e000)
	libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f6136421000)
	libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f613621e000)
	libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f613601a000)
	libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f6135e14000)
	libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f6135b00000)
	libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f61358f5000)
	libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f61356e5000)
	libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f61354d9000)
	libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f61352ce000)
	libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f61350bc000)
	libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f6134e94000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f6134c7d000)
	libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f6134a32000)
	libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f61347b2000)
	libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f613457e000)
	libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f6134374000)
	libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f613416b000)
	libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6133ef7000)
	libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f6133cda000)
	libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f6133ad5000)
	/lib64/ld-linux-x86-64.so.2 (0x00005612ea91c000)
	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f61338b2000)
	libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f613360a000)
	libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f6133405000)
	libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f61331fb000)
	libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f6132fb7000)
	libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f6132d91000)
	libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f6132b89000)
	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f6132984000)
	libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f613277e000)

Is there any problem there?
 
libpng12.so.0 => not found

You're missing this older (required) version of libpng.

Almost all Linux distros provide this library, since so many programs were built with this version. Which distro are you using?

The reality is PJRC only tests the linux versions on Ubuntu. Most other distros work, but when they don't, please try with Ubuntu.
 
Oh yeah I see it. I am using Kali linux 2016.2. I tried installing the missing library with apt-get but the package isn't located there. Should I try installing it from github?
 
Is there a support forum for Kali linux?

Or perhaps you could try using Ubuntu? The reality is Linux support (for PJRC) is we can really only develop and test for one Linux distro.
 
Sorry for the late reply. This weekend I've been a bit busy :D

Instead of messing around with your Linux distro you can try to extract an existing x86_64 libpng12.so.0, i.e. from one of the more recent Debian or Ubuntu repositories (assuming that Kali Linux is .deb/Debian based, haven't looked that much in detail; otherwise go with Redhat/Fedora/...). You can copy that library binary to a directory of your liking (for example ~/lib/ or the directory where the teensy binary resides), and then do something like that:

Code:
LD_LIBRARY_PATH=<directory-of-your-libpng12.so.0> <directory-to-teensy-tool>/teensy

If that works you have multiple options (again): Either rename the teensy binary, replace it with a script of the same name and do a relayed call, so to speak, with the LD_LIBRARY_PATH set and all that, or make the LD_LIBRARY_PATH more permanent by adding it to something along the lines of ~/.bashrc (depending on what shell your user account runs with). Then you won't need the proxy-script.

Instead of trying to extract the binary library you might try to compile it yourself; what you do with it once it is compiled is up to you again: Install it to the default path using root will mess with your system image, or you go the above described local user route (i.e. can use "~/" as prefix during the configuration step and then have it somewhere in ~/lib/, but will also add more directories; use "~/libpng12" as prefix and all the files will be better contained).
 
I came to chime in with the same problem and a solution.

Problem: After upgrading from Ubuntu 16.04 to 16.10 I can't upload to Teensy. The teensy loader no longer opens.

The error on the Arduino console says:
Opening Teensy Loader...
Unable find Teensy Loader. Is the Teensy Loader application running?
Error compiling for board Teensy 3.2 / 3.1.


Reason: Ubuntu 16.10 has dropped support for libpng12 in favor of libpng16; the teensy loader requires libpng12.

Solution: you can manually compile libpng12 from source the old-fashioned way. Here's what I did:
1. Go to Canonical's launchpad site for libpng: https://launchpad.net/ubuntu/+source/libpng/1.2.54-1ubuntu1
2. Downloaded libpng_1.2.54.orig.tar.xz.
3. Unarchive the file, open a terminal, and cd to the source code folder.
4. Run the following commands in order:
./configure
make
sudo make install
sudo ldconfig

If this fails, sudo apt-get install build-essential and give it another go.

The install script will put libpng12 into /usr/local/lib folder where it should not conflict with libpng16.
 
I've added these libraries to the 1.31 installer. I tested briefly on Ubuntu 16.10. Hopefully this solves the problem for other Linux distros too?
 
Status
Not open for further replies.
Back
Top