NMON – Command Line Performance Monitoring Tool nmon is really handy as it lets you see lots of info in a single unified app. Install nmon To run nmon Use the keyboard commands to toggle individual sections on and off: ‘t’ = Top-processes ‘m’ – Memory S ‘j’ = Filesystems ‘d’ or ‘D’ = Disks (capital D shows […]
All posts by
Expand Filesystem Issues
Getting "There was an error running option 1 expand filesystem" This is based on https://www.chrisnewland.com/resize-raspberry-pi-sd-card-partition-to-fill-32gb-card-from-a-running-raspberry-pi-245 but here for our own reference in case the other page ever goes away! Backup your SD card to an image file first! Enter this to see the current partition usage: df E.g. Filesystem 1K-blocks Used Available Use% Mounted on rootfs 3698504 […]
Resizing Partitions & Disks
You may want to resize your partition to solve an issue with Win32 Disk Imager not being able to write to a new card due to it being slightly too small, or to change to a smaller SD card. Here’s what we want to do: Resize the linux partition on the SD card to fit within the […]
Get free disk space
Get free disk space int64_t free_disk_space; get_int64_value_from_ascii_string(do_console_command_get_result((char*)"df -k /tmp | tail -1 | awk '{print $4}'"), 0, &free_disk_space); //Get free space in kB std::cout << "Free disk space: " << free_disk_space << "kB" << std::endl; int get_int64_value_from_ascii_string (string source_string, int char_index, int64_t *result) { int32_t value = -1; int32_t value_last = 0; char *p_source_string; […]
Serial over Bluetooth
Once you have your RPi paired with another device you have a Bluetooth link, but you still need to set up another protocol over the Bluetooth called "RFCOMM" to provide an emulated serial connection between the two devices. Setting The RPi to create a serial connection to a Bluetooth device at startup Enter the command: sudo […]
Check interface connection and trigger reconnect
If WiFi is lost raspbian doesn't seem to currently reconnect if an access point is available again. You need to setup a script to check it and cause it to be reset if it has dropped out. See here. C Code To Check Connection Status & Trigger Reconnect Of Dropped WiFi Interface #define TCPIP_INTERFACE_RESET_SECONDS_TIME (5 * 60) //If interface is […]
Networking Commands
List Network Adaptors Is Network Interface Connected Indicates the interface operational state, possible values are: “unknown”, “notpresent”, “down”, “lowerlayerdown”, “testing”,”dormant”, “up”.”no such file or directory” You can test for “up”. Will give a result of 0, 1 or a ‘no such file or directory’ error message. NOTE – we have seen this commant return a […]
Adding A 2nd Fixed IP Address To The Ethernet Port
For example, say you want the RPi Ethernet port to use DHCP, but to also have a fixed IP address so you can connect to it using a direct cable connection from a laptop. sudo nano /etc/network/interfaces Use this for the eth0 adaptor: auto eth0 allow-hotplug eth0 iface eth0 inet dhcp auto eth0:1 iface eth0:1 […]
Update Packages
As well as wanting to regularly check for updates so any security vulnerabilities are patched, you should also check for updates before installing anything new as often applications rely on the system being up to date to be able to install correctly. Updating all installed packages or Update Operating System Distribution apt-get update will not […]
.Installing Bluetooth
WARNING – Bluetooth on the RPi can be a nightmare and result in massive time loss! If it just works for you then great (and consider sharing how). If it doesn't and after hitting your head against a wall for hour after hour it still doesn't it isn't just you (search online RPi forums for 'bluetooth' […]