Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Sunday, January 29, 2017

making a HP Color LaserJet printer wireless with a Raspberry Pi 3



My old HP Color LaserJet 2820 is still working great, however it only supports being connected via ethernet or USB. As a workaround I've been using "Power Line Communication" to bridge directly from my router to the printer over the electrical wires.
Recently I've been revamping the home network and wanted to get rid of these last power line connections. Ideally I'd want the printer to join the wireless network.

The arrival of the Raspberry Pi 3 with builtin WiFi seems like a good opportunity to implement this.
The raspberry Pi is connected with it's Ethernet port to the printer. The WiFi is connected to the local LAN where I configured the router to give it a fixed IP address.

Approach 1: Cups printer server


I install the cupsys printing system on the Raspberry Pi, and configure it to properly support the printer (using HPLIP). Besides that, I install a DHCP server to serve the printer an IP address on it's own private network: The cable between Raspberry Pi and printer.
I change the configuration of the printer in Cups on the Raspberry Pi to make the printer shared on the LAN.
Now all other computers can just use that shared printer to print.
This works really good for printing, however it doesn't work at all for scanning.
When scanning the scanning software (SANE) seems to want to connect directly to the printer and this of course isn't possible when the printer is on a different network and there is no routing.

Approach 2: Routing


I updated the Raspberry Pi to do routing, by enabling IP forwarding.
(uncomment the net.ipv4.ip_forward=1 line in /etc/sysctl.conf )
I also configure my router with an extra route to have it know about the network that is now reachable via the Raspberry Pi.
Now the printer can be directly communicated with. This allows me to configure the printer directly again on my Linux laptop.
Printing still works fine. However scanning still doesn't work.
When I tell the scanner software the IP address of the printer explicitly, it sometimes works, but most of the time it doesn't work at all.
My guess is that the scanner software relies on some communication that doesn't work outside it's own network.

Approach 3: Proxy ARP

To learn more about the technicalities of proxy ARP, read here on Wikipedia, and here on wiki.debian.org. In summary it is a trick that makes it seem to the rest of the network that the Raspberry Pi and the printer are the same.
In order for this to work I want the printer to have an address in the same network as the local net.
First remove the DHCP server installed for the previous approaches, then install a DHCP proxy. This is easily installed (apt-get install dhcp-helper) and configured (DHCPHELPER_OPTS="-b wlan0" in /etc/default/dhcp-helper).
There are multiple ways to enable Proxy ARP. The easiest is to install (apt-get install parprouted) and configure it.
My /etc/network/interfaces now looks like this:

auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet dhcp
  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  post-up /usr/sbin/parprouted eth0 wlan0
  post-down /usr/bin/killall /usr/sbin/parprouted
  post-up /sbin/ip addr add $(/sbin/ip addr show wlan0 | perl -wne 'm|^\s+inet (.*)/| && print $1')/32 dev eth0
  post-down /sbin/ifdown eth0


With proxy ARP in place the printer still works great, and finally the scanner also works in a stable way.


Alternative approaches


I could try hooking the printer to the Raspberry Pi via USB. As I've never used the printer in this way, I've not attempted this.

Tuesday, August 13, 2013

Experiments with Bluetooth Low Energy (4.0) under Linux

With iPhônes liberated from the apple authentication chip by it, and Android also having added support in the latest Android 4.3, Bluetooth Low Energy (4.0) is starting to look more interesting.

In this blog post I'm going to use a bluegiga BT111 based USB bluetooth dongle on Linux as a client and a TI CC2541 SensorTag as server.

USB dongle in computer
The SensorTag is a nice little bluetooth 4 example device provided by Texas Instruments.

Device

First step is put the device in the computer. As my laptop already has an existing bluetooth device build-in, the new one will enumerate as "hci1". This can be found out also by using hcitool.


$ hcitool dev
Devices:
        hci1    00:07:80:60:CE:4D
        hci0    EC:55:F9:F4:A0:xx

In this case the bluetooth mac address of the BT111 is 00:07:80:60:CE:4D.

Scanning for a device

Normal bluetooth scanning is done with hcitool scan. Low Energy scanning is done with hcitool lescan.
Make sure to press the button on the side of the SensorTag first to make it discoverable. Scanning is continuous to stop it with Ctrl-C. Low Energy devices require root access hence the sudo. I would expect being in the bluetooth group to be enough but for some reason it isn't.


$ sudo hcitool -i hci1 lescan
LE Scan ...
BC:6A:29:AC:2E:B4 (unknown)
BC:6A:29:AC:2E:B4 SensorTag
BC:6A:29:AC:2E:B4 (unknown)
BC:6A:29:AC:2E:B4 SensorTag
BC:6A:29:AC:2E:B4 (unknown)
^C

Using gatttool to access the device

Now we know the address of the SensorTag: BC:6A:29:AC:2E:B4. In contrast with regular Bluetooth where there are a whole range of protocols, with Bluetooth Low Energy there is only one protocol at the top and it is GATT (Generic Attribute).

The actual functionality of a device is implemented by means of attributes which can be read, written to or notification/indication enabled for, depending on the attribute.

gatttool is a simple Linux tool that can be used to manipulate these attributes with a Bluetooth Low Energy device. It can be used as a simple command line tool but I find it easier to use it in it's interactive mode.

Let's enter the interactive mode.




$ sudo gatttool -i hci1 -b BC:6A:29:AC:2E:B4 -I
[   ][BC:6A:29:AC:2E:B4][LE]>

It returns us a prompt. Let's connect to the device.


[   ][BC:6A:29:AC:2E:B4][LE]> connect
[CON][BC:6A:29:AC:2E:B4][LE]>

The CON indication tells us that the connection is established.
Now the primary command can be used to find the primary services of the device.

[CON][BC:6A:29:AC:2E:B4][LE]> primary
[CON][BC:6A:29:AC:2E:B4][LE]> 
attr handle: 0x0001, end grp handle: 0x000b uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x000f uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0010, end grp handle: 0x0022 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle: 0x0023, end grp handle: 0x002a uuid: f000aa00-0451-4000-b000-000000000000
attr handle: 0x002b, end grp handle: 0x0035 uuid: f000aa10-0451-4000-b000-000000000000
attr handle: 0x0036, end grp handle: 0x003d uuid: f000aa20-0451-4000-b000-000000000000
attr handle: 0x003e, end grp handle: 0x0048 uuid: f000aa30-0451-4000-b000-000000000000
attr handle: 0x0049, end grp handle: 0x0054 uuid: f000aa40-0451-4000-b000-000000000000
attr handle: 0x0055, end grp handle: 0x005c uuid: f000aa50-0451-4000-b000-000000000000
attr handle: 0x005d, end grp handle: 0x0061 uuid: 0000ffe0-0000-1000-8000-00805f9b34fb
attr handle: 0x0062, end grp handle: 0x0068 uuid: f000aa60-0451-4000-b000-000000000000
attr handle: 0x0069, end grp handle: 0xffff uuid: f000ffc0-0451-4000-b000-000000000000

Attributes in GATT have uuids and handles. UUIDs (unique identifiers) define a certain type of entry, handles can be used to access a value. To make things more complicated there is also nesting involved. Certain UUIDs are defined in the standard and always have to be provided. Others can just be vendor specific and provide the actual data for the service. It's beyond the scope of this blog post to further look into how all that fits together.

SensorTag attributes

Luckily for us, the meaning of the sensortag attributes are defined on the user guide at http://processors.wiki.ti.com/index.php/SensorTag_User_Guide.

For this blog I'm looking at the humidity sensor as it is the easiest and the values shown in the document are actually correct :) http://processors.wiki.ti.com/index.php/SensorTag_User_Guide#Humidity_Sensor_2

As you can see on that page, there are 3 important handles for the humidity sensor, Data (0x38), DataNotification (0x39) and Config (0x3C).

Let's try reading from the Data handle:

[CON][BC:6A:29:AC:2E:B4][LE]> char-read-hnd 38
[CON][BC:6A:29:AC:2E:B4][LE]> 
Characteristic value/descriptor: 00 00 00 00

So far so good, but no useful data. We first need to enable the sensor. This is done by writing 1 in the Config handle.

[CON][BC:6A:29:AC:2E:B4][LE]> char-write-req 3c 01
[CON][BC:6A:29:AC:2E:B4][LE]> Characteristic value was written successfully

Let's retry reading the value now.

[CON][BC:6A:29:AC:2E:B4][LE]> char-read-hnd 38
[CON][BC:6A:29:AC:2E:B4][LE]> 
Characteristic value/descriptor: 68 68 4e 72

That's more like it. Using the math provided on the website and a python script, this gives the temperature and the humidity.

>>> -46.85 + 175.72/65536 * 0x6868
24.8151025390625
>>> -6.0 + 125.0/65536 * (0x72e4 & ~3)
50.09893798828125

So 25 Celsius and 50% humidity. That agrees with my local weather sensor. Nice :)

Instead of reading values it is also possible to use notifications.


[CON][BC:6A:29:AC:2E:B4][LE]> char-write-req 39 0100
[CON][BC:6A:29:AC:2E:B4][LE]> Characteristic value was written successfully

Notification handle = 0x0038 value: 68 68 f6 71 
[CON][BC:6A:29:AC:2E:B4][LE]>
...
This will provide the temperature and the humidity every second automatically. Let's disable it again it is spamming me :)

[CON][BC:6A:29:AC:2E:B4][LE]> char-write-req 39 0000
[CON][BC:6A:29:AC:2E:B4][LE]> Characteristic value was written successfully

Finally let's disable the sensor and disconnect.

[CON][BC:6A:29:AC:2E:B4][LE]> char-write-req 3c 00
[CON][BC:6A:29:AC:2E:B4][LE]> Characteristic value was written successfully
[CON][BC:6A:29:AC:2E:B4][LE]> disconnect 
[   ][BC:6A:29:AC:2E:B4][LE]>

Conclusion

Bluetooth Low Energy might look a bit different/strange at first but it is really quite nice! I'm certainly going to explore it further!

Shameless plug!

Don't forget to check out the very nice BT111 based USB dongle available for sale at my tindie store!



Tuesday, July 30, 2013

adding a new device to avrdude

So I made a little breakout for the new Atmel AtXmega E5 series. More specifically I'm testing it with the atxmega16e5.

This is a new chip that is not yet supported by the latest avrdude.

Making it work turned out to be reasonably straightforward.

First let's open avrdude.conf, the config file of avrdude.
Let's find a section of a chip that is reasonably similar, I've selected the atxmega16d4:

#------------------------------------------------------------
# ATxmega16D4
#------------------------------------------------------------

part parent ".xmegasmall"
    id  = "x16d4";
    desc = "ATxmega16D4";
    signature = 0x1e 0x94 0x42;
    has_jtag = no;

    memory "eeprom"
        size  = 0x0400;
        offset  = 0x08c0000;
        page_size = 0x20;
        readsize = 0x100;
    ;

    memory "application"
        size  = 0x00004000;
        offset  = 0x0800000;
        page_size = 0x100;
        readsize = 0x100;
    ;

    memory "apptable"
        size  = 0x00001000;
        offset  = 0x00803000;
        page_size = 0x100;
        readsize = 0x100;
    ;

    memory "boot"
        size  = 0x00001000;
        offset  = 0x00804000;
        page_size = 0x100;
        readsize = 0x100;
    ;

    memory "flash"
        size  = 0x00005000;
        offset  = 0x0800000;
        page_size = 0x100;
        readsize = 0x100;
    ;
;

copy this to a new section and change the id to x16e5 and the desc to ATxmega16E5.
Find the signature like by hooking up the PDI to your x16e5 board and doing:

avrdude -P usb -c avrispmkII -p x16d4

It will now say that it is the wrong signature and will print you the signature it actually found:

 0x1e 0x94 0x45

Use that in the config section.

Now find the XML files distributed as part of Atmel AVR Studio that contain the device descriptions of the two devices: ATxmega16D4.xml and ATxmega16E5.xml

Now look at the differences and make the necc. changes. The only changes I made are the eeprom size,  the page_size and readsize settings. The x16e5 uses 128 byte pages and the x16d4 256 byte pages.

This gives as a result:


#------------------------------------------------------------
# ATxmega16E5
#------------------------------------------------------------

part parent ".xmegasmall"
    id  = "x16e5";
    desc = "ATxmega16E5";
    signature = 0x1e 0x94 0x45;
    has_jtag = no;

    memory "eeprom"
        size  = 0x0200; # J
        offset  = 0x08c0000;
        page_size = 0x20;
        readsize = 0x80; # J was 0x100
    ;

    memory "application"
        size  = 0x00004000;
        offset  = 0x0800000;
        page_size = 0x80;
        readsize = 0x80;
    ;

    memory "apptable"
        size  = 0x00001000;
        offset  = 0x00803000;
        page_size = 0x80;
        readsize = 0x80;
    ;

    memory "boot"
        size  = 0x00001000;
        offset  = 0x00804000;
        page_size = 0x80;
        readsize = 0x80;
    ;

    memory "flash"
        size  = 0x00005000;
        offset  = 0x0800000;
        page_size = 0x80;
        readsize = 0x80;
    ;
;

This seems to work fine for programming. I'm pretty sure some things are still missing concerning fuses and such though.

In order to get code compiled with gcc I use another atxmega target as chip as the x16e5 is not yet part of
the avr-gcc I'm using either.

./avrdude -C ./avrdude.conf -e -P usb -c avrispmkII -p x16e5 -U flash:w:blink.hex

And it blinks :)

Friday, May 24, 2013

madparts release 1.1

A new release of the madparts functional electronics footprint editor is available.

Important changes are:

  • py2exe simple Windows installation: just unzip the zip file and execute madparts.exe
  • linux packages for madparts and pyv8 for Debian and Ubuntu i386 and x86_64
  • a ton of bug-fixes
  • various internal code cleanups
  • simple built-in command line interface for listing of libraries and import and export of footprints
For downloads, and more details head over to the madparts.org website. As always, don't hesitate to contact me with questions or feedback at joost@madparts.org or use the github bugtracker.

The next release will normally contain support for KiCad, but I first I need to learn working with it :)

madparts running on macosx

Friday, March 29, 2013

madparts 1.0: first public release

I'm proud to present the first public release of madparts, the fully free software functional programmable electronics footprint editor.



Find all the details and downloads on the homepage at http://madparts.org/


Sunday, July 10, 2011

configuring X with xmonad without KDE/gnome

While configuring X11 to use the xmonad tiling window manager instead of the more usual KDE or GNOME, some things were somewhat less then obvious, and I document them here.

.xsession configuration


These are settings that all can be made permanent by adding them to the
.xsession file in your home directory.

disable CAPS, enable Compose


setxkbmap -option compose:caps


Now you can use the Caps Lock key to compose special characters. E.g.



  • <Caps> 'e   gives é
  • <Caps> e=  gives €
  • ...
... and as a bonus you can't accidentally press the Caps Lock key any more!



disable beep globally


xset b off



start gpg-agent on startup



eval `gpg-agent --daemon`


start ssh-agent on startup

eval `ssh-agent --daemon`

other things

dmenu

Install the suckless-tools package for dmenu among things.
Just use <alt>-p to quicklanch apps with dmenu.

xterm

I want to use plain xterm as terminal emulator as the tabbing of gnome-terminal and konsole is rather pointless in combination with the tiling.
The default font size was to small. To solve this I did a dirty hack like this:

  • update-alternatives -config xterm and change it to uxterm to have an UTF-8 terminal by default
  • edit /usr/bin/uxterm and change the last line by adding -fn 10x20 to it.


email

At the moment I'm still using kmail as email client (and accidentally akregator as RSS feed agregator). I'm still thinking about switching that as well.

... to be continued ...

Wednesday, July 18, 2007

Linux Debian 4.0 / Lite-on Lightscriber

To get the lightscriber dvd/cd writer I recently bought to write labels under amd64 debian linux 4.0 I had to do the following things:


  • download the basic lightscriber library from http://www.lightscribe.com/
  • download the 4L lightscriber label software from LaCie
  • convert both rpms with alien to deb files in a debian 4.0 ia32 schroot
  • extract both deb files with dpkg-deb -x / towards the root of your amd64 system
  • make sure the ia32 chroot libraries are available in the librarypath for the tool
  • run the GUI, as root if you want to burn the label on the CD


Use the gimp to make the labels, there are templates with the correct available together with the LaCie software.

Saturday, June 16, 2007

Dell Precision M65 and xorg and synaptics

Out if the box the settings for the synaptics touchpad are horribly bad. Especially since this laptop has a native resolution of 1920x1200.

Thanks to this webpage it now works great!

This is the relevant section of my /etc/X11/xorg.conf:


Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "InputFashion" "Mouse"
Option "SendCoreEvents" "false"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
Option "SHMConfig" "on"
Option "RTCornerButton" "0"
Option "RBCornerButton" "0"
Option "TapButton1" "0"
Option "TapButton2" "0"
Option "TapButton3" "0"
Option "Buttons" "8"
Option "ZAxisMapping" "4 5 6 7"
Option "TopEdge" "100"
Option "BottomEdge" "670"
Option "LeftEdge" "100"
Option "RightEdge" "950"
Option "MaxSpeed" "2.0"
Option "MinSpeed" "0.5"
Option "AccelFactor" "0.05"
EndSection



This is great!

linux & logitec media keyboard Y-BN52

To make it work, set the following xmodmappings:


keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 160 = XF86AudioMute
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 236 = XF86Mail
keycode 130 = XF86HomePage
keycode 223 = XF86Sleep
keycode 161 = XF86Calculator
keycode 230 = XF86Favorites


E.g. add this to a file in your homedir and load it with xmodmap from your .xsession file.

Monday, May 28, 2007

kernel mode pppoe

Kernel mode pppoe, the debian way:


/etc/ppp/peers/dsl-provider:
plugin rp-pppoe.so eth1
noipdefault
defaultroute
hide-password
lcp-echo-interval 60
lcp-echo-failure 3
noauth
persist
mtu 1492
mru 1492
user "xxx@PROVIDER"

/etc/ppp/pap-secrets:
"xxx@PROVIDER" * "myfunkypass"

/etc/network/interfaces:
auto mydsl
iface mydsl inet ppp
    provider dsl-provider


Replace eth1 by your dsl ethernet link device name, xxx by username, PROVIDER by your provider, and myfunkypass by your password.
Enable with ifup mydsl, disable with ifdown mydsl.

Monday, April 30, 2007

debian in kvm mini howto

I started by downloading the debian-40r0-i386-CD-1.iso via jigdo.
Then I created a disk image file like this:

qemu-img create vdisk.qcow 1G

Then I boot kvm like this:

kvm -hda vdisk.qcow -cdrom debian-40r0-i386-CD-1.iso -boot d -m 256

(It may be needed to change the permissions of /dev/kvm)

Proceed with installation as a normal debian installation. I only installed the minimum.
The default kvm uses a build-in user space networking. However I'd like to have bridged
networking.
First I create a tap0 device in /etc/network/interfaces:

iface tap0 inet manual
pre-up tunctl -b -u <my_user_name> -t tap0
pre-up ifconfig tap0 up
post-down tunctl -d tap0

Make sure you have tunctl installed, its part of the uml-utilities package.
Replace the <my_user_name> by the user you want to run kvm as.
Normally my network interface is configured via DHCP, soo I want to keep that.
However I want kvm to be also able to access my LAN. Therefor I create a bridge interface:

iface br0 inet dhcp
bridge_ports eth0 tap0
bridge_maxwait 0

Which I bring up via DHCP. Of course I'll have to change eth0 also:

iface eth0 inet manual

Finually make sure they are brought up in the right order:

auto lo eth0 tap0 br0

In total this gives an /etc/network/interfaces like this:

auto lo eth0 tap0 br0

iface lo inet loopback

iface br0 inet dhcp
bridge_ports eth0 tap0
bridge_maxwait 0

iface eth0 inet manual

iface tap0 inet manual
pre-up tunctl -b -u <my_user_name> -t tap0
pre-up ifconfig tap0 up
post-down tunctl -d tap0

Finually edit the file /etc/kvm/kvm-ifup and put everything in it in comments.
Now bring down the network and bring it up again:

ifdown -a
ifup -a

And then start the kvm:

kvm -net nic -net tap,ifname=tap0 -hda vdisk.qcow -m 256 -localtime

Once booted, log in and change the /etc/network/interfaces file in the image to use DHCP:

iface eth0 inet dhcp

If you bring down the net and bring it up again (within the kvm!):

ifdown -a
ifup -a

you should get a DHCP lease from your LAN and the kvm is available on the LAN.

Now it's time to start using it!

Wednesday, March 21, 2007

sound and jackd on the dell precision m65

In order to get the intel-hda soundcard to work properly it is imporant that the software modem is enabled in the BIOS.

To make jackd work without xruns, add the following kernel options to the boot line in your grub config: noacpi acpi=off.

After this jack runs fine with the following settings in qjackctl:


  • Realtime
  • H/W Monitor
  • H/W Meter
  • Frames/Period: 256
  • Sample Rate: 44100
  • Periods/Buffer: 3
  • Interface: hw:0


This gives a jackd commandline like this:

/usr/bin/jackd -R -dalsa -dhw:0 -r44100 -p256 -n3 -H -M

Thursday, March 15, 2007

Debian udev and eth0 versus eth2

Lately I've been playing with booting Linux from an USB stick.

One wierd thing I noticed that for some reason in dmesg I see the network interface detected as eth0, but eth0 didn't work.
Today I found out that the actual device is eth2!
Turns out that udev automatically adds mac address based mappings to the file

/etc/udev/rules.d/z25_persistent-net.rules

As I booted the USB stick once before in another laptop, the mac addresses of that machine already got eth0 and eth2, therefor the mac address of the new machine was mapped on eth2.

Just clearing this file and let it be populated again after a fresh boot fixes it.
Alternatively just edit the interface names in this file to match your liking.

Thursday, February 15, 2007

vim embedded commands

A neat trick I use sometimes: it's possible to customize the settings of the vim editor by embedding commands in the file. Put them on the last line after a comment character (which depends on the language of course).
For example for python I like:

# vim:ts=4:noet

which makes sure tabs are not expanded and tabstops are at 4 characters.

Wednesday, January 10, 2007

gvim, kde and session restore

When I have open gvim editors in KDE and I log out and log in again, the editors are not restored properly in the sense that they are started, but without the document I was editing.

It turned out the solution is really easy:


# apitude install vim-gnome
# update-alternatives --config gvim


and make sure you pick the gnome version as prefered version of gvim in the update-alternatives menu. Aparantly the gnome version is also KDE session aware.

Sunday, January 7, 2007

debian ,wifi, wpa supplicant and /etc/network/interfaces

Already a few people asked me how to configure Wifi properly under debian using
the /etc/network/interfaces file.
It's not yet documented in the manual page of the file, but it is documented in the file
/usr/share/doc/wpasupplicant/README.modes.gz

An example setup for wpa2:

auto ath0
iface ath0 inet dhcp
wpa-driver madwifi
wpa-ssid fredsnet
wpa-passphrase fred was here
wpa-key-mgmt WPA-PSK
wpa-pairwise TKIP CCMP
wpa-group TKIP CCMP
wpa-proto WPA RSN

Tuesday, December 12, 2006

wine on amd64

I run a pure64 installation of Debian GNU/Linux.
However I'd like to play some games from time to time and rebooting in the Evil OS(tm) is a pain. This morning I got wine working on my amd64 system in quite a trivial way:

1) install a 32 bit debian in a chroot (with debootstrap and friends)
2) install wine in the chroot
3) copy /my/chroot/location/usr/bin/wine out of the chroot towards a private bin directory
4) edit the wine file and adapt the PATHS in it to point towards the full location in the chroot

Now use that edited wine script to run wine, it should work just fine!

Monday, December 4, 2006

/dev/pts missing in a chroot

You have a linux installation in a chroot, and when you enter the chroot some applications seem to hang forever (e.g. apt-get or aptitude) or su is not working?

This probably means your chroot shell no longer has a pseudo terminal attached, and some applications need this.

Just add a line like this to your /etc/fstab in order to fix it:


devpts32        /my/chroot/location/dev/pts devpts defaults    0       0


Of course you also have to mount it.