I have had this error a couple of times, and each time it took a while to figure out the problem.

Symptom

Guile, gnutls or some other package fails to find libunistring during the configure stage of emerge.

Sollution

Compile libunistring locally (belt and suspenders version):

FEATURES="-ditcc -distcc-pump" MAKEOPTS="-j1" emerge -j1 libunistring

These instructions will enable lcdproc to display computer status on Debian stretch using a Digispark microcontroller board, an I2c to HD44780 interface, and a 20x4 HD44780 chracter LCD.

lcdproc support the HD44780 LCD connected via I2C but uses a pin mapping that is different from the above board. However, an updated driver exists, allowing customising the pin mapping of the I2C to HD44780 interface. To use this driver the Debian package has to be rebuild substituting the driver sources.

Preparations

Digispark

Information on installing the I2C-tiny-USB firmware can be found here: https://github.com/harbaum/I2C-Tiny-USB/tree/master/digispark

Connecting the Digispark to the I2C to HD44780 module

Below is a table of the connections needed:

Digispark pin ATtiny85 pin I2C to HD44780 pin
GND N/A GND
5V N/A VCC
P0 AREF, SDA, DI, PWM SDA
P2 D/A, SCK SDL

The Digispark pin, and the ATtiny85 pin are both printed on the silkscreen of my Digispark clone. One set on the top-, and one on the bottom side.

Debian Machine

Install the required dependencies to build the debian package:

apt install build-essential autotools-dev cme debhelper dh-systemd libg15-dev libg15daemon-client-dev libg15render-dev liblircclient-dev libncurses5-dev libusb-1.0-0-dev libxosd-dev pkg-config libftdi-dev libusb-dev i2c-tools

Download and unpack the Debian package source:

wget http://http.debian.net/debian/pool/main/l/lcdproc/lcdproc_0.5.7.orig.tar.gz
wget http://http.debian.net/debian/pool/main/l/lcdproc/lcdproc_0.5.7-7.debian.tar.xz

tar xvzf lcdproc_0.5.7.orig.tar.gz lcdproc-0.5.7/
cd lcdproc-0.5.7/
tar xvJf ../lcdproc_0.5.7-7.debian.tar.xz 
cd ..

Clone the modified I2C HD44780 driver:

git clone https://github.com/wilberforce/lcdproc

Copy the modified driver source into the Debian sources:

cd lcdproc
cp -rv docs server ../lcdproc-0.5.7/.
cd ..

Building the package

cd lcdproc-0.5.7
dpkg-buildpackage -b

Installing the package

cd ..
dpkg -i lcdproc_0.5.7-7_i386.deb

Finding the I2C LCD

First load the needed I2C kernel moduled: modprobe i2c-dev modprobe i2c-tiny-dev

Next, find the I2C device that the LCD is attached to, use i2cdetect -l to list all I2C devices in the system:

$ i2cdetect -l
i2c-1   i2c             i2c-tiny-usb at bus 001 device 004      I2C adapter
i2c-0   smbus           SMBus Via Pro adapter at 5000           SMBus adapter

The adapter we are looking for is the i2c-tiny-usb with bus number 001 and available at device node /dev/i2c-1.

The address of the LCD is also found using i2cdetect. This time called with the -y parameter followed by the bus number found above.

$ i2cdetect -y 1
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

From the above output, the address is the default of 0x27.

Configure

Add the following lines to /etc/modules to load the needed I2C modules at boot:

i2c
i2c-tiny-usb

Edit /etc/LCDd.conf to look like below. Adjust Device, andPort` with the values learned above.

[server]
DriverPath=/usr/lib/i386-linux-gnu/lcdproc/
Driver=hd44780
NextScreenKey=Right
PrevScreenKey=Left
ReportToSyslog=yes
ReportLevel=2
ToggleRotateKey=Enter
WaitTime=3
ServerScreen=no


[menu]
DownKey=Down
EnterKey=Enter
MenuKey=Escape
UpKey=Up

[hd44780]
ConnectionType=i2c
Device=/dev/i2c-1
OutputPort=no
Port=0x27
Backlight=no
Size=20x4
DelayBus=false
DelayMult=1
Keypad=no
# edit the pin configurations for your i2c module (Note2)
i2c_line_RS=0x01
i2c_line_RW=0x02
i2c_line_EN=0x04
i2c_line_BL=0x08
i2c_line_D4=0x10
i2c_line_D5=0x20
i2c_line_D6=0x40
i2c_line_D7=0x80

My /etc/lcdproc.conf contains the following:

# LCDproc client configuration file

## general options ##
[lcdproc]
# address of the LCDd server to connect to
Server=localhost

# Port of the server to connect to
Port=13666

# set reporting level
ReportLevel=2

# report to syslog?
ReportToSyslog=false

# run in foreground [default: false; legal: true, false]
#Foreground=true

# PidFile location when running as daemon [default: /var/run/lcdproc.pid]
#PidFile=/var/run/lcdproc.pid

# slow down initial announcement of modes (in 1/100s)
#delay=2

# display name for the main menu [default: LCDproc HOST]
#DisplayName=lcdproc


## screen specific configuration options ##

[CPU]
# Show screen
Active=True
OnTime=1
OffTime=2
ShowInvisible=false


[Iface]
# Show screen
Active=True

# Show stats for Interface0
Interface0=eth0
# Interface alias name to display [default: <interface name>]
Alias0=LAN

# Show stats for Interface1
Interface1=eth1
Alias1=WAN

# Show stats for Interface2
Interface2=tun0
Alias2=VPN

# for more than 3 interfaces change MAX_INTERFACES in iface.h and rebuild

# Units to display [default: byte; legal: byte, bit, packet]
unit=byte

# add screen with transferred traffic
transfer=TRUE


[Memory]
# Show screen
Active=True


[Load]
# Show screen
Active=True
# Min Load Avg at which the backlight will be turned off [default: 0.05]
LowLoad=0.05
# Max Load Avg at which the backlight will start blinking [default: 1.3]
HighLoad=1.3


[TimeDate]
# Show screen
Active=True
# time format [default: %H:%M:%S; legal: see strftime(3)]
TimeFormat="%H:%M:%S"
# date format [default: %x; legal: see strftime(3)]
DateFormat="%x"


[About]
# Show screen
Active=false


[SMP-CPU]
# Show screen
Active=false


[OldTime]
# Show screen
Active=false
# time format [default: %H:%M:%S; legal: see strftime(3)]
TimeFormat="%H:%M:%S"
# date format [default: %x; legal: see strftime(3)]
DateFormat="%x"
# Display the title bar in two-line mode. Note that with four lines or more
# the title is always shown. [default: true; legal: true, false]
#ShowTitle=false


[BigClock]
# Show screen
Active=False


[Uptime]
# Show screen
Active=True


[Battery]
# Show screen
Active=false


[CPUGraph]
# Show screen
Active=True


[ProcSize]
# Show screen
Active=false


[Disk]
# Show screen
Active=True


[MiniClock]
# Show screen
Active=False
# time format [default: %H:%M; legal: see strftime(3)]
TimeFormat="%H:%M"


# EOF

Testing

By issuing the following command the server and the lcdproc client is started in the foreground running until you press CTRL+C. The LCD should start displaying the screens configured in /etc/lcdproc.conf.

service LCDd start
lcdproc -f

Making it survive reboots

Enable LCDd at boot:

systemctl enable LCDd

Edit /etc/rc.local and add /usr/bin/lcdproc towards the end before the line exit 0 to have the lcdproc client start at boot.

If your DigiSpark is no longer getting programmed from the Arduino IDE, when plugging it in, you might have to re-program the Micronucleus bootloader. You can do this using the Raspberry Pi if you do not have an AVR programmer.

Preperation

Install the AVRDUDE programmer on the Raspberry Pi:

apt-get install avrdude

Copy the default AVRDUDE configuration file to your home directory.

cp /etc/avrdude.conf ~/avrdude_gpio.conf
nano ~/avrdude_gpio.conf

Add this to the end of the file to make AVRDUDE use the Raspberry Pi GPIO port as programming port.

# Raspberry PI GPIO configuration for avrdude.
# Change the lines below to the GPIO pins connected to the AVR.
programmer
  id    = "rpi";
  desc  = "Use the Linux sysfs interface to bitbang GPIO lines";
  type  = "linuxgpio";
  reset = 12;
  sck   = 24;
  mosi  = 23;
  miso  = 18;
;

Next, download the Micronucleus bootloader file called micronucleus-1.06.hex.

wget https://github.com/micronucleus/micronucleus/raw/80419704f68bf0783c5de63a6a4b9d89b45235c7/firmware/releases/micronucleus-1.06.hex

Connect the DigiSpark to the Raspberry Pi using the table below.

AVR pin name DigiSpark pin name RPI pin name RPI pin number
ICSP VCC 5V 5V 2
ICSP GND GND Ground/GND 6
ICSP RESET P5 GPIO #12 32
ICSP SCK P2 GPIO #24 18
ICSP MOSI P0 GPIO #23 16
ICSP MISO P1 GPIO #18 12

When the DigiSpark is connected run this command from your home directory to program the AVR with the bootloader.

sudo avrdude -p attiny85 -C avrdude_gpio.conf -c rpi -U flash:w:micronucleus-1.06.hex:i -U lfuse:w:0xF1:m -U hfuse:w:0x5F:m

AVRDUDE should respond something like this:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e930b
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "micronucleus-1.06.hex"
avrdude: writing flash (8162 bytes):

Writing | ################################################## | 100% 1.28s

avrdude: 8162 bytes of flash written
avrdude: verifying flash memory against micronucleus-1.06.hex:
avrdude: load data flash data from input file micronucleus-1.06.hex:
avrdude: input file micronucleus-1.06.hex contains 8162 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.09s

avrdude: verifying ...
avrdude: 8162 bytes of flash verified
avrdude: reading input file "0xF1"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xF1:
avrdude: load data lfuse data from input file 0xF1:
avrdude: input file 0xF1 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0x5F"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0x5F:
avrdude: load data hfuse data from input file 0x5F:
avrdude: input file 0x5F contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified

avrdude: safemode: Fuses OK (E:FE, H:5F, L:F1)

avrdude done.  Thank you.

After which the Arduino IDE should be able to program it again.

Serial

The MD87050 has a RS323 connection on the processor board close to the hard disk USB B socket. The labelling of the pins seems to be switched, at least in my version.

Telnet

The MD87050 has a telnet server running which is accessible from its own WLAN and the WLAN it is connected to if any.

Credentials

The root credentials are as follows:

  • User name: root
  • Password: 20080826

Boot message

MTD layout

 cat /proc/mtd
 dev:    size   erasesize  name
 mtd0: 00800000 00010000 "ALL"
 mtd1: 00030000 00010000 "Bootloader"
 mtd2: 00010000 00010000 "Config"
 mtd3: 00010000 00010000 "Factory"
 mtd4: 00180000 00010000 "Kernel_RootFS"
 mtd5: 00010000 00010000 "params"
 mtd6: 00010000 00010000 "user_backup"
 mtd7: 00010000 00010000 "user"
 mtd8: 00600000 00010000 "Rootfs"

To back up all the devices insert a fat formatted SD card in the slot and run the following commands.

   # dd if=/dev/mtd0 of=/data/UsbDisk1/Volume1/mtd0.img
   16384+0 records in
   16384+0 records out
   # dd if=/dev/mtd1 of=/data/UsbDisk1/Volume1/mtd1.img
   384+0 records in
   384+0 records out
   # dd if=/dev/mtd2 of=/data/UsbDisk1/Volume1/mtd2.img
   128+0 records in
   128+0 records out
   # dd if=/dev/mtd3 of=/data/UsbDisk1/Volume1/mtd3.img
   128+0 records in
   128+0 records out
   # dd if=/dev/mtd4 of=/data/UsbDisk1/Volume1/mtd4.img
   3072+0 records in
   3072+0 records out
   # dd if=/dev/mtd5 of=/data/UsbDisk1/Volume1/mtd5.img
   128+0 records in
   128+0 records out
   # dd if=/dev/mtd6 of=/data/UsbDisk1/Volume1/mtd6.img
   128+0 records in
   128+0 records out
   # dd if=/dev/mtd7 of=/data/UsbDisk1/Volume1/mtd7.img
   128+0 records in
   128+0 records out
   # dd if=/dev/mtd8 of=/data/UsbDisk1/Volume1/mtd8.img
   12288+0 records in
   12288+0 records out

As seen in the list of MTD devices above mtd0 contains all data. Analysing mtd0.img with binwalk confirms this:

binwalk mtd0.img

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             uImage header, header size: 64 bytes, header CRC: 0x72E03075, created: 2013-10-22 01:51:02, image size: 127844 bytes, Data Address: 0x80200000, Entry Point: 0x80200000, data CRC: 0xEEE7DEAB, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: none, image name: "SPI Flash Image"
104496        0x19830         U-Boot version string, "U-Boot 1.1.3 (Oct 22 2013 - 09:50:58)"
104976        0x19A10         CRC32 polynomial table, little endian
327680        0x50000         uImage header, header size: 64 bytes, header CRC: 0x65E07CA2, created: 2013-11-01 05:36:56, image size: 1442332 bytes, Data Address: 0x80000000, Entry Point: 0x80441000, data CRC: 0x8EFB6500, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "Linux Kernel Image"
327744        0x50040         LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 4608121 bytes
2031632       0x1F0010        gzip compressed data, maximum compression, from Unix, last modified: 2017-06-06 09:44:49
2097152       0x200000        Squashfs filesystem, little endian, non-standard signature, version 3.0, size: 4736074 bytes, 1168 inodes, blocksize: 65536 bytes, created: 2013-12-10 09:54:46

A dump of the MTD devices and an extraction of recognisable data using binwalk is available in md87050-mtd-dump.tar.bz2

Sources:

Debian on the Intenso Memory 2 Move

From fellow classmates I have been asked to show how to install PyQT5 on a Windows 10 system for use in Python 3 in our programming classes. Coming from Linux I initially just said "Well, install it" but it turns out to be a little more involved than that. The PyQT homepage, seems to no longer have Windows binaries available for download, there are other sources, but I wanted to find something that was as reliable as installing the package on a Linux system.

There are probably easier ways of achieving this, but this is the method I settled on:

Find your Python 3 directory

Python will install itself under your user directory. My Windows user name is olebole, and Python 3.6 is at:

C:\Users\olebole\AppData\Local\Programs\Python\Python36

When using the Windows Explorer you will have to enable showing hidden folders and files to see the AppData folder in your home directory.

You need to find your Python location since this is where pip is installed. Pip is used to install packages from PyPI - the Python Package Index.

Install PyQT5

Now that you have your Python installation path, proceed to start a command shell (Win+R, cmd, Enter) and change into the Scripts directory in the Python installation directory and use pip.exe to install PyQT5.

cd c:\Users\oblivion\AppData\Local\Programs\Python\Python36\Scripts

pip install PyQT5

Setting the PATH

If you expect on doing this a lot it would be a good idea to add the path of pip.exe to the PATH environment variable. I leave this as an exercise to the reader, while I hurry back to my trusted terminal window.

I have made a gist with a script I am using to deploy Flask applications to VirtualBox:

https://gist.github.com/deadbok/155bd5906b30bc34b75180b240e326ac

I used the following beep sequence to remotely play "Happy birthday" for a friend at his office through VPN.

beep -f 261.6 -n -f 261.6 -n -f 293.7 -n -f 261.6 -n -f 349.2 \
     -n -l 500 -f 329.6 -n -f 1 -n -f 261.6 -n -f 261.6 -n -f 293.7 \
     -n -f 261.6 -n -f 392.0 -n -l 500 -f 349.2 -n -f 1 -n -f 261.6 \
     -n -f 261.6 -n -f 523.2 -n -f 440.0 -n -f 349.2 -n -f 329.6 \
     -l 200 -n -f 293.7 -n -f 1 -n -f 523.2 -n -f 523.2 -n -f 440.0 \
     -n -f 349.2 -n -f 392.0 -n -f 349.2

Generated on 2018-05-03 01:14:21.829668