Posts Tagged pcengines

3G connectivity for PC Engines APU (DW5550)

In addition to Sierra Wireless MC8775 3G modem, there’s now a new offering for Dell DW5550 (or Ericsson F5521gw, which is the same hardware) mini-PCIe 3G cards at, in the price range of $20. This is a newer hardware (the ones I received were manufactured in mid-2012), and it supports higher UMTS speeds and an CDC Ethernet interface in Linux.

This page refers to Ericsson F3507g card, but all instructions are relevant for DW5550. The device identifies itself as Dell DW5550, firmware version R3B01 (Command for retrieving the version: AT+CGMR).

Default Linux kernel 3.2.0 in Debian Wheezy names the CDC Ethernet interface as usb0, and 3.16.0 from Wheezy backports names it as wwan0. Other than that, everything else works the same.

Out of 3 ordered cards, two worked immediately, and one was broken. The seller has kindly offered a replacement for additional $10.

for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done

usb0 : Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card Network Adapter
ttyACM0 : Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card Modem
ttyACM1 : Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card Data Modem
ttyACM2 : Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card GPS Port
cdc-wdm0 : Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card Device Management
cdc-wdm1 : Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card USIM Port

The following commands initiate a 3G connection for a SIM card:

apt-get install -y picocom ppp
picocom -b 115200 /dev/ttyACM1


Ctrl-a Ctrl-x
dhclient usb0

This Debian wiki page explains how to bring up the connection automatically at Linux startup:

cat >/etc/chatscripts/sunrise.DW5550 <<'EOT'
\dAT+CGDCONT=1,"IP","internet" OK
\d\d\dAT*ENAP=1,1 OK

cat >/etc/chatscripts/gsm_off.DW5550 <<'EOT'

vi /etc/network/interfaces

allow-hotplug usb0
iface usb0 inet dhcp
    pre-up /usr/sbin/chat -v -f /etc/chatscripts/sunrise.DW5550 >/dev/ttyACM0 </dev/ttyACM0
    post-down /usr/sbin/chat -v -f /etc/chatscripts/gsm_off.DW5550 >/dev/ttyACM0 </dev/ttyACM0

, , , ,


mSATA drives for PC Engines APU

Drives with problems:

  1. KingSpec 16GB (Model Number: KingSpec KSM-mSATA.7i-016MJ, Firmware Revision:  SVN454): quite often, the kernel times out to boot at the start.
  2. SuperSSpeed S238: with the old firmware, TRIM operation erased the boot sector. The newer firmware disables TRIM.

Drives without problems (everything works fine with TRIM)

  1. MyDigitalSSD Super Boot Drive (Model Number:  SB mSATA SSD, Firmware Revision: S9FM01.8)
  2. SanDisk X110 (Model Number: SanDisk SD6SF1M032G1022I, Firmware Revision: X231200)
  3. Kingston Now (Model Number: KINGSTON SMS200S330G, Firmware Revision: 524ABBF0)

The testing procedure is quite simple: a background process is massively creating and deleting a small file, and another process calls fstrim every few seconds. Then the health of the filesystem is checked after an hour or so.

while true; do echo xxxxxxxxxxxxxxxxxxxxxxxx >xxx; done &
while true; do fstrim -v /; sleep 10; done



Leave a comment

3G connectivity for PC Engines APU (MC8775)

PC Engines’ APU board has its mPCIe slot 2 wired to the SIM card socket, which allows using any standard mPCIe 3G modem. Most of modern modems are quite expensive, but there are plenty of Sierra Wireless MC8775 cards at for around $20 apiece. This is a decent hardware, manufactured around 2007-2011. It doesn’t deliver the highest UMTS speeds possible, but still can be used in situations where speed is unimportant.

The cards that I bought came with firmware version 1_1_8_15, dated 2007/07/17. I didn’t test it fully, but there are some failure reports in the internet.

The firmware upgrade requires an adapter with a SIM card slot. I got mine from this eBay seller.

This page describes the firmware upgrade process. The links to are still valid, but you need to remove # (%23) from the URLs. The 3G watcher for the AirCard 875 is unavailable at its original place, but easy to find with Google. I got mine at this site. The upgrade requires a 32bit Windows machine, and takes about 20 minutes. I upgraded the firmware successfully with my old Vista laptop.

Also I bought the 3G antenna and the pigtail cable at aliexpress.

After inserting the 3G modem into mPCIe slot 2 and booting Debian Wheezy, the device was immediately visible as three serial USB interfaces (/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2). ttyUSB0 is used for data, and ttyUSB2 can be used for controlling the device with AT commands. The command “AT^CARDMODE” will tell if the SIM card is inserted, and “AT!GSTATUS?” displays the network status information. “AT+GMR” displays the current firmware version. Ctrl-a Ctrl-x sequence will finish the picocom session.

apt-get install -y wvdial picocom
picocom -b 115200 /dev/ttyUSB2 
Ctrl-a Ctrl-x

The following /etc/wvdial.conf works with 3G network:

[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Phone = *99#
Username = ''
Password = ''
Ask Password = 0
Stupid Mode = 1
Compuserve = 0
Idle Seconds = 0
ISDN = 0
Auto DNS = 1 

Execute “wvdial” comand from the command line, and it should immediately connect to the internet. The rest is easy: you can place wvdial into a startup script and execute it automatically at boot time.

, , , , ,

Leave a comment

FreeSWITCH performance test on PC Engines APU

This test is analogous to the one I described for Intel Atom CPU.This time it’s the new APU board from PC Engines, the maker of famous ALIX and WRAP boards. APU is a fanless appliance board, with a dual-core 1GHz AMD G series CPU. The overall performance is comparable to that of Intel Atom.

In these tests, FreeSWITCH was forwarding the call to itself on request by pressing *1. Each such forwarding resulted in creating four new channels in G722 and G711, thus resulting in transcoding to G711 and back. For example, if “show channels” shows 5 channels, it’s equivalent to 2 simultaneous calls with transcoding.

Test result: 57 channels were running completely fine, 65 channels had slight distortions, and with 85 channels the speech was still recognizable, but with significant distortions. With Speex instead of G722, distortions were quite annoying at 25 channels. Thus, the APU platform can easily be used as a small-to-medium business PBX for  20-30 simultaneous calls if there’s not too much transcoding.

Test details follow.

Read the rest of this entry »

, , , ,

1 Comment

PC Engines APU board: installing Debian on mSATA drive

PC Engines started shipping its new APU board in 2014. It can boot from an SD card (slow on writes), and it can also have an mSATA drive and boot from it (fast read-write, and more write cycles). Voyage Linux is well optimized for SD card.

Here I started my scripts for building a Debian CD and installing it on APU’s mSATA drive:


, ,


FreeSWITCH performance test on AMD Geode LX800

This is a proof-of-concept test to see if the PC Engines’ ALIX2 board is suitable for a basic VoIP application.

First I compiled the latest FreeSWITCH version from Git. It was a mistake to run the compilation on the ALIX board: the CPU is quite slow, and the whole compilation took several hours.  I should’ve done the compilation on a more powerful machine and then copy the binaries to the ALIX.

In these tests, I used the default dialplan that came with FreeSWITCH (highly insecure, with the password 1234 for all users). I added an external SIP profile to connect it to my other IP PBX, so that I can easily place incoming calls.

An Ubuntu notebook with Twinkle was used as the SIP client for the ALIX server.

FreeSWITCH was running with -rp option, assigning the process a high priority.

1. IVR prompts and voicemail worked immediately, and the flash memory speed delays were insignificant.

2. A call without transcoding. Both call legs were using PCMA codec:

# "vmstat 1" output:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
1  0   3792   4036  23204 187060    0    0     0    36 1205 1576  0  2 98  0
1  0   3792   4036  23204 187068    0    0     0     0 1205 1548  0  3 97  0

# "top" output
3187 freeswit  -2 -10 30504  12m 4148 S  6.9  5.0   0:16.60 freeswitch

3. A call with transcoding. One leg used G722@16000 codec, and the other leg was GSM@8000:

# "vmstat 1" output:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 1  0   3796   4320  22844 186712    0    0     0     0 1207 1333 14  3 83  0
 1  0   3796   4320  22844 186712    0    0     0     0 1205 1348 14  4 82  0

# "top" output:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 2909 freeswit  -2 -10 31240  12m 4188 S 21.3  5.1   1:18.38 freeswitch

4. A conference with 5 PCMA channels:

# "vmstat 1" output:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0      0 122888  36440  58244    0    0     0     0 1458  844  7  6 87  0
 0  0      0 122896  36440  58244    0    0     0     0 1440  814  6  4 90  0

# "top" output:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 8124 freeswit  -2 -10 34208  13m 4224 S 12.1  5.5   1:29.85 freeswitch

Outcome: it’s possible to build a pretty decent small PBX for SOHO usage with this hardware. In all cases the voice quality was absolutely fine.

UPD1: a conference call with automatic recording into MP3: the CPU load jumps to 60% every few seconds, and the conference experiences significant delays and clippings. With WAV recording, everything runs smoothly, and not much different from the above results.

, , ,


Cloning a Voyage Linux host

After you made all your customizations to a Voyage Linux installation, you may want to replicate it to other boards. The procedure is tested with PC Engines’ ALIX2 boards.

The dump can also be easily piped through SSH to/from your backup server. This way it’s easy to organize snapshots for your lab testing and backups. Do not use any compression inside ALIX — the CPU is quite slow, and it’s faster to transfer uncompressed data over SSH and compress it on the target host if needed (assuming the target host is a usual modern machine).

# get dump and restore
apt-get install dump

# make sure your source filesystem is read-only

# The target CF card is attached as /dev/sdb in a USB card reader

/usr/local/sbin/ -t $CF -b 1 -y
mkdir /tmp/cf
mount $CF1 /tmp/cf
cd /tmp/cf
dump -0 -f - /dev/hda1 | restore -r -f -

# let the new system re-generate SSH keys
rm /tmp/cf/etc/ssh/ssh_host_*
touch /tmp/cf/voyage.1st

# Populate a new hostname
vi /tmp/cf/etc/hostname
vi /tmp/cf/etc/hosts

# Install the boot loader (assuming Partition 1 is used for boot filesystem)
echo "(hd0) $CF" > /tmp/cf/boot/grub/
mount -o bind /dev /tmp/cf/dev
chroot /tmp/cf /usr/sbin/grub --device-map=/boot/grub/ <<EOM
setup (hd0) (hd0,0)
umount /tmp/cf/dev

# finished preparing the filesystem
cd /
umount $CF1

, ,


Tweaking Voyage Linux on PC engines’ ALIX

ALIX is a small-factor, low-power x86 platform designed and sold by PC Engines. I’ve set up one such system with my call-home scripts, and I plan to use it instead of (or alongside) those netbooks: it’s more compact, and it’s cheaper (around $150 for a box).

Voyage Linux is a Debian OS distribution adapted for such small-factor platforms. It mounts the flash drive in read-only mode by default, and also the kernel loads all necessary modules to support the ALIX board.

After setting up Voyage as described in their README, I do the following steps to optimize the setup (after issuing remountrw command):

0. Edit /etc/apt/sources.list and select a nearer mirror, e.g.

deb squeeze main contrib non-free

1. Adapt the DHCP client configuration so that it re-tries faster if DHCP service is unavailable:

# /etc/dhcp/dhclient.conf
# <other options skipped>
timeout 10;
retry 20;

2. Install NTP service. This is important because the board does not have a battery-powered RTC clock.

apt-get update
apt-get install ntp

3. Add a user for myself, add it to sudoers with NOPASSWD: option, and then remove the root password completely.

4. If I want to use X11 forwarding through SSH, there’s one problem: my home directory is by default on a read-only filesystem, and xauth tries to create .Xauthority in my home directory. To avoid that, I do the following:

sudo apt-get install xauth
sudo cat >> /etc/ssh/sshd_config <<EOT
PermitUserEnvironment yes
sudo service ssh restart
cat >.ssh/environment <<EOT

5. Install additional stuff as needed:

sudo apt-get install dump git wireshark

6. Reboot, test, and backup the filesystem by using dump command (don’t use dump compression, as the CPU is rather slow).

, , ,

Leave a comment