Pages - Menu

Monday, May 7, 2018

Wifi latency using RALink RT3090 (rt2800pci)

After updating to Ubuntu 18.04 Bionic, I found my RALink RT3090 wireless card using the rt2800pci driver introduced latency. This was most noticeable as a delay while typing over SSH.

This is because power management is enabled on the card, which puts it into sleep mode and it takes some time to wake up again.

You can see the power management state of the card with:

sudo iwconfig

Amongst other things, this will show:

Power Management:on

You can test whether disabling power management solves the problem with:

sudo iwconfig DEV power off

Where DEV is the device name (eg: wlan0, wlp3s0)

If this solves the problem, then apply the setting on boot. Edit the file /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and change:

[connection]
wifi.powersave = 3


So it reads:

wifi.powersave = 2

Thursday, May 4, 2017

Commandline auto-login in Ubuntu 16.04

This is based on how RetroPie does its autologin and autostart which you can find in scriptmodules/supplementary/autostart.sh in the RetroPie-Setup source.

This works in Ubuntu and Raspbian, it probably works in any systemd distro.

mkdir -p /etc/systemd/system/getty@tty1.service.d/

Create a file at /etc/systemd/system/getty@tty1.service.d/autologin.conf with contents:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin USERNAME --noclear %I \$TERM


Replace USERNAME with the actual username to login.

You can now reboot and test this.

If you want to start something on startup, then create a file /etc/profile.d/10-runthing.sh with contents like:

if [ "$(tty)" = "/dev/tty1" ]; then
    THING
fi


Replace THING with the command to run. You could run tmux so you never forget. You could compile DOSBox so it runs on the framebuffer and you appear to have a DOS computer, which is why I wanted to do this.

Friday, March 24, 2017

3D Modelling Software on Ubuntu 16.04 (OpenSCAD, FreeCAD, gCAD3D, Blender)

In addition to the previous post with 3D printer control software, you will likely want something to make models with!

OpenSCAD


This modeller uses a C-like programming language to create models. For example, to create a 20mm cube you type cube([20,20,20]);

Install with:

sudo add-apt-repository ppa:openscad/releases
sudo apt update
sudo apt install openscad


Run with openscad

I also find the scad-utils repository to be useful, the morphology plugin has a fillet tool: https://github.com/openscad/scad-utils

OpenSCAD website: http://www.openscad.org/
OpenSCAD documentation: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language

FreeCAD


A graphical modeller. This has many more features than OpenSCAD though I don't like the interface as much. A good workflow might be to make shapes in OpenSCAD and then import into FreeCAD to polish.

Install with:

sudo add-apt-repository ppa:freecad-maintainers/freecad-stable
sudo apt update
sudo apt install freecad

Run with freecad

FreeCAD website: http://www.freecadweb.org/
FreeCAD documentation: https://www.freecadweb.org/wiki/Main_Page

gCAD3D


This looks like a simpler version of FreeCAD

A deb package download is provided on the website for 32-bit and 64-bit.

Once downloaded, install with:

sudo dpkg -i gCAD3D*.deb

Run with gcad3d

gCAD3D website: http://www.gcad3d.org/
gCAD3D documentation: http://www.gcad3d.org/doc/html/index_en.htm

Blender


I have not played with this much yet, but it's very popular

Install with:

sudo add-apt-repository ppa:thomas-schiex/blender
sudo apt update
sudo apt install blender

Run with blender

Blender website: https://www.blender.org/
Blender support and docs: https://www.blender.org/support/

Saturday, March 4, 2017

3D Printing Software on Ubuntu 16.04 (Cura, Slic3r, Pronterface, Repetier Host)

I recently got a cheap 3D printer and wanted to get started printing with Ubuntu. Some of the software is not so obvious to install, so here's how I got these popular applications going:

Cura


Cura is available in the https://launchpad.net/~thopiekar/+archive/ubuntu/cura PPA. To install, just:

sudo add-apt-repository ppa:thopiekar/cura
sudo apt update
sudo apt install cura

Launch with the cura command.

Cura website: https://ultimaker.com/en/products/cura-software

Slic3r (Slicer)


The version in repos is the latest (1.2.9) at the time of writing, however the package is missing some dependencies. This installs all that's required:

sudo apt install slic3r wx-common libopengl-perl libwx-glcanvas-perl

Launch the GUI with the slic3r --gui command

Slic3r website: http://slic3r.org/

Pronterface (aka Printrun)


This requires python-wxgtk2.8 which is removed in Ubuntu Xenial 16.04, and the replacement python-wxgtk3.0 does not work well with Printrun.

There are some instructions around the internet suggesting to install the Wily 15.10 version, but that led to messy dependencies for me.

Luckily, WebUpd8 package python-wxgtk2.8 for 16.04 in their PPA, thanks!

First, install the dependencies Printrun requires with:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install python-serial python-wxgtk2.8 python-pyglet python-numpy cython python-libxml2 python-gobject python-dbus python-psutil python-cairosvg git


Now change to the directory where you want the application to be and fetch the software with:

git clone https://github.com/kliment/Printrun.git

To run, change to the Printrun directory with cd Printrun and run the python pronterface.py command.

Pronterface website: http://www.pronterface.com/

Repetier Host


This uses Mono to run the Windows binary, install requirements with:

sudo apt install monodevelop libmono-system-serviceprocess4.0-cil

Download and uncompress:

tar xf repetierHostLinux_1_6_2.tgz
cd RepetierHost

Run with:

mono RepetierHost.exe

Repetier Host website: https://www.repetier.com/

Saturday, August 13, 2016

DOSBox Full Screen with proper Scaling and Aspect Ratio

It's quite confusing to get DOSBox to display games properly on modern hardware, partially because CRT monitors often displayed in non-square pixel modes, and partially because modern LCD displays don't scale well or support all the resolutions that CRTs did.

This post discusses the settings required in dosbox.conf to get DOS games displaying well.

fullresolution

Set this to your screen's native resolution such as fullresolution=1920x1200

output

The default surface cannot scale, so set this to output=overlay which can scale. If you have a decent graphics card you could also try output=openglnb

aspect

Set aspect=true to ensure the game is not stretched

scaler

Simple scaler=none will work, but you can experiment with the other scalers to see which performs well and which you like the look of.

The full config options are described at http://www.dosbox.com/wiki/dosbox.conf