Update to Rom/Kernel/TWRP building guide!

Hey everyone!

Just wanted to let you know that I was able to finish and upload another hour worth of videos! That’s right, currently there is more than 9 hours of video tutorial available. As promised, this was added to the series:

* Installing/using VirtualBox
* Fixing a VB Ubuntu problem with screen resolution
* Syncing minimal LineageOS or Omni for building TWRP
* Converting an Omni TWRP device to LineageOS/CM and building it.
* Custom TWRP mods with fonts/icons/splash screens/etc….

twrp

Hope that you are enjoying the series, but mostly, I hope that it is informative and gets you building!
I did try to up the video quality, but I had to tone it back down a bit, as the files became a bit large for uploading and handling. The quality is a little better than the first videos, but not exactly 1080p! 

Thanks again for all of the thanks button slaps and YouTube subscriptions. That lets me know that you guys really appreciate the videos. Be sure to check out my Video Tutorial section in the menu for links to the videos!

Linux – keep it simple.

Advertisements

Using A NetGear AC600 (A6100) With Linux Successfully!

Due to a few changes at work, I was in need of an USB WiFi adapter for my desktop computer. Of course, I’m running Linux, and while that shouldn’t make things complicated, when it comes to hardware, sometimes it does.

There are tons of great WiFi adapters that work great out of the box with Linux. There are even numerous Open Source, and some Open Hardware versions too. However, in Alaska, you typically have to order out for something like that. Instead, I needed a WiFi adapter today, not in the mail.

A quick run to a local “buy your groceries and everything else” (Jack of all trades, master of none) store provided me with few options. However, a quick web search proved that the AC600 (model A6100) USB adapter was working for others on Linux, so I picked that up.

41WBoY-N-0L._SL160_

Unfortunately, my first web search led me to source code which I downloaded and compiled, but it did not work. Apparently there are more than one generation with the same model number, and those drivers didn’t help me. However, further search lead me here: https://wikidevi.com/wiki/Netgear_A6100, which lead me here: https://github.com/abperiasamy/rtl8812AU_8821AU_linux .

I don’t want to rehash the already great instructions provided, so you can read that page for the full details, but here is my history from my terminal:

2015 git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux
2016 cd rtl8812AU_8821AU_linux/
2017 make
2018 sudo make install
2019 sudo modprobe -r 8812au
2020 sudo modprobe -a rtl8812au
2021 sudo iwconfig
2022 history
2023 sudo nano /etc/modules
2024 sudo apt-get update
2025 sudo apt-get install dkms
2026 sudo cp -R . /usr/src/rtl8812AU_8821AU_linux-1.0
2027 sudo dkms add -m rtl8812AU_8821AU_linux -v 1.0
2028 sudo dkms build -m rtl8812AU_8821AU_linux -v 1.0
2029 sudo dkms install -m rtl8812AU_8821AU_linux -v 1.0

Long story short: If you follow the instructions, you will have this installed in under 15 minutes, and it does work! So, if you happen to have one of these, or need to use one on Linux, it is fairly simple and does function great!

Linux – keep it simple.

Video to Gif Command Line Conversion

This is really just a side note for myself. I tend to do something only once in a blue moon, and then consequently forget how to do that again later. So, I’m writing this one down for my own future reference. Hopefully you will find it useful too.

Of course, I am using WordPress for this technical blog. And, because I am “resourceful” (a fancy term for frugal or cheap) I can’t upload videos to my free blog. Maybe someone else has this problem also, and has wondered how to get around it.

Most often, I don’t need a video for the things I post, but occasionally, I can’t show something with just a picture. Thus, I’ve found a good “cheat” is to convert the video into an animated gif file instead.

Previously, I was using online tools, such as ezgif.com, or others. But that takes up an excessive amount of internet, as you upload a video, burning my limited internet allotment (yes, there are still places on the planet where internet is not unlimited). Then you have to download the gif, only to find an issue with the settings, or a tweak you want to do, which starts the process over again.

So, I decided to do some research, and while this is nothing new, here is how I’ve found is a good way to make the conversion on your Linux computer:

~/Downloads$ ffmpeg -i autostart.mp4 -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm – | convert -delay 8 -loop 0 – output.gif

Where:

  • ffmpeg is the program
  • -i autostart.mp4 is the input file video name
  • -vf scale=320:-1 scales the video to a 320 by whatever video to preserve aspect ratio. Note that you can use 640, or whatever scaled size you desire.
  • -r 10 is the frame rate. Most cell phone video is recorded at 30 fps, so choosing 15 would be every other frame, or in this case 10, every third frame.
  • -f format and pipes, redirecting to the convert tool.
  • -delay 8 is the number of milliseconds between frames. This sets the flow and speed of the gif.
  • -loop 0 is the setting for continuous loop, however, most modern browsers use a continuous loop anyways, unless you specify something else.
  • – output.gif is the name of the output file.

The output at the console will look something like this:

~/Downloads$ ffmpeg -i autostart.mp4 -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm – | convert -delay 8 -loop 0 – output.gif
ffmpeg version 2.8.14-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
configuration: –prefix=/usr –extra-version=0ubuntu0.16.04.1 –build-suffix=-ffmpeg –toolchain=hardened –libdir=/usr/lib/x86_64-linux-gnu –incdir=/usr/include/x86_64-linux-gnu –cc=cc –cxx=g++ –enable-gpl –enable-shared –disable-stripping –disable-decoder=libopenjpeg –disable-decoder=libschroedinger –enable-avresample –enable-avisynth –enable-gnutls –enable-ladspa –enable-libass –enable-libbluray –enable-libbs2b –enable-libcaca –enable-libcdio –enable-libflite –enable-libfontconfig –enable-libfreetype –enable-libfribidi –enable-libgme –enable-libgsm –enable-libmodplug –enable-libmp3lame –enable-libopenjpeg –enable-libopus –enable-libpulse –enable-librtmp –enable-libschroedinger –enable-libshine –enable-libsnappy –enable-libsoxr –enable-libspeex –enable-libssh –enable-libtheora –enable-libtwolame –enable-libvorbis –enable-libvpx –enable-libwavpack –enable-libwebp –enable-libx265 –enable-libxvid –enable-libzvbi –enable-openal –enable-opengl –enable-x11grab –enable-libdc1394 –enable-libiec61883 –enable-libzmq –enable-frei0r –enable-libx264 –enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘autostart.mp4’:
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2018-04-20 14:05:43
Duration: 00:00:25.96, start: 0.000000, bitrate: 6103 kb/s
Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280×720, 6448 kb/s, SAR 1:1 DAR 16:9, 29.88 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2018-04-20 14:05:43
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 48 kb/s (default)
Metadata:
creation_time : 2018-04-20 14:05:43
handler_name : SoundHandle
Output #0, image2pipe, to ‘pipe:’:

Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf56.40.101
Stream #0:0(eng): Video: ppm, rgb24, 320×569 [SAR 5121:5120 DAR 9:16], q=2-31, 200 kb/s, 10 fps, 10 tbn, 10 tbc (default)
Metadata:
handler_name : VideoHandle
creation_time : 2018-04-20 14:05:43
encoder : Lavc56.60.100 ppm
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> ppm (native))
Press [q] to stop, [?] for help
frame= 39 fps=0.0 q=-0.0 size= 20805kB time=00:00:03.90 bitrate=43700.4kbitsframe= 80 fps= 80 q=-0.0 size= 42676kB time=00:00:08.00 bitrate=43700.4kbitsframe= 121 fps= 80 q=-0.0 size= 64548kB time=00:00:12.10 bitrate=43700.4kbitsframe= 159 fps= 79 q=-0.0 size= 84819kB time=00:00:15.90 bitrate=43700.4kbitsframe= 200 fps= 80 q=-0.0 size= 106690kB time=00:00:20.00 bitrate=43700.4kbitsframe= 241 fps= 80 q=-0.0 size= 128562kB time=00:00:24.10 bitrate=43700.4kbitsframe= 245 fps= 80 q=-0.0 Lsize= 130696kB time=00:00:24.50 bitrate=43700.4kbits/s dup=0 drop=483
video:130696kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
~/Downloads$

Hopefully that is a tidy explanation. Keep in mind, the higher the -vf, the bigger the gif appears, but also the larger the file. The -r value will make the gif smoother as it goes up, but will also increase the gif size in MB!

Linux – keep it simple.

Chromium: ERROR:browser_gpu_channel_host_factory.cc(121)

Today I had a strange occurrence. I couldn’t launch Chromium-browser on my Ubuntu desktop machine. The error I got was this:

ERROR:browser_gpu_channel_host_factory.cc(121)

And something about the profile was already open, so it wouldn’t launch again, to avoid corrupting my session or profile. Odd, I thought.

So, I did a quick history |grep chromium and got nothing in return. It believed that Chromium was open, but it wasn’t. Really odd.

Then, while typing in the terminal, I hit tab to autocomplete the program, and it said that bin/bash didn’t have enough space to complete this action, something like this:

bash: cannot create temp file for here-document: No space left on device”

Ah. How foolish of me. I then ran df -h, and sure enough, my root partition was full. All of my web page experiments were taking a toll on the /var directory, where I did not separate it from root.

So, if you see something like that. Be sure to check if your drive is full. After clearing some space, Chromium fired right up!

Linux – keep it simple.

Ubuntu Touch: Making the plunge.

I recently took the plunge, and jumped in on a used Oneplus One phone, converting it to UBPorts community maintained Ubuntu Touch distro. Yes, I now have a true Linux phone. Arguably, Android is Linux, since Linux is really just a kernel, but in most people’s minds, when they say Linux, they mean GNU Linux. Feel free to debate it in the comments. Either way, my phone is now Linux and a flavor of GNU/Linux.

With the plunge came many advancements, and several drawbacks. I’d like to take a few minutes to discuss what those are for potential end users and enthusiasts. I gave it a pretty intensive test by switching to UT cold turkey, and using that as my daily driver for over a week, part of which was while at work. It’s still on my phone, and I think it will be for quite some time.

First and foremost, it did everything a cellular phone should do. I made and received phone calls, I sent text messages, I sent MMS messages, I received the same in return. For a cellular phone, it quite literally was perfect. It took a while to get used to the interface, as it is different from Android or iOS. Once used to it, though, the interface itself was fairly pleasant. To be honest, I now am struggling when trying to use an Android interface on one of my other old phones!

There really were only two major problems with using it. Apps and programs. Due to these issues, I actually was going to give up on it, but decided to stick with it, and now I’m glad I did.

Don’t get me wrong, there are some really great apps on this thing, but there are many apps missing for my daily routine. I use my phone to Jabber (XMPP), but there wasn’t an app for that. I often grab a quick game of Chess on FICS, but there wasn’t a chess app that allowed me to do that. My email from some contacts is sometimes encrypted, but there wasn’t an app that could handle that. So, while it works great as a cellular phone, it didn’t meet my day to day app needs. I was fortunate enough to find several work-arounds for these issues, the details of which I’ll plan on sharing in another article.

Just to give you an idea though, I got really creative. I added onto my ejabber2 server with nginx, and hosted my own webmail client, although I’m still ironing out all the pgp encryption details, it is getting the job done for now. I also hosted a page with convers.js built in, it is a web based xmpp client. Eventually I converted it to it’s own HTML app for the phone as well. As for FICS and online chess, well, there is already an UT app for Chess.com, so I went that route. Don’t worry, if you are looking for details, I’ll be sure to dive into those in future posts.

The only other issue was the desktop app function. Since it is Ubuntu, you can run desktop apps inside a scope’s compatibility function. This is a great idea, and I made numerous apps work, and work fairly well. However, I had some great difficulty with several of the “regular” desktop apps.

For instance, I tried to load three different desktop email clients to work around the email encryption issue (I really was trying to make this my daily driver). However, on all three email programs, I would get to a point where I needed to enter a password, and for some reason, when I clicked in the password fields, the automatic hiding keyboard would not show up so I could type. If you are trying this out yourself, Claws-mail was working for me.

In several programs the keyboard would refuse to auto hide, making half of the screen the keyboard. However, it was only my inexperience that led to this, as I found I could “swipe” down to hide the keyboard. It’s a little clunky, but then again, using a desktop application on your phone, regardless of the OS, is a bit clunky in and of itself.

In an attempt to work around the missing jabber (XMPP) client, I loaded Gajim, an excellent desktop program for this purpose, and it did work! Unfortunately, one of my main contacts required me to install a pidgin plug-in, which, after loading, caused Gajim to crash the phone every time I opened it.

Gimp, however, worked flawlessly, and I was able to utilize it very well. One of the shortcomings I found though, was that the desktop apps and the phone apps are separate, and so are the file systems. So, if you download a picture in an email on the phone side, you can’t see it in the gimp desktop app, since the files are in different containers.

But overall it works really great as a modern day smart phone. The testament to this fact is that I’m still using it. They also have a really great OpenStore with the typical app updating features, manual or automatic, which is really nice, as well as the usual fare of apps, Telegram, Instagram, etc.

The UT team also did a great job with Google integration, if you are into that. If you wanted to sync your calendar and contacts from Google, which can make the switch from Android to UT very easy. The Web Browser app was really intuitive and functioned well. I never once had an issue with it playing or functioning. The camera app was really straight-forward and was flawless in function, which was great!

Later I’ll be talking specifically about the Oneplus One’s function, which I feel is separate from the Ubuntu Touch interface.

Linux – keep it simple.

Fool’s Mate Friday: Ubports (Ubuntu Touch) Chess, with a hint of Cinnamon.

As I dive into the realm of making my Just Chess Engine playable, I was taking a look at some of the other chess interfaces out there, to see what kind of features I should implement.

Recently, I decided to test drive Ubuntu Touch on my Oneplus One, and it was during that trial run that I tried out the chess program that they have in their OpenStore.  The app was called Chess, written by Andima Landaluze. You can check out the source code here: https://github.com/Hankamotz/xake-chess.git

Sometimes, when you open a chess app, you are overwhelmed with 3000+ options. You end up scrolling through dozens of menus, and in the end, you just wanted to play a quick game of chess. Don’t get me wrong, sometimes you need those extra options for critical thinking and deep play, but if you are playing on your cell phone, you probably just sat down on the bus for 15 minutes and decided to play a short match.

That is one of the things I like about this app. The simplicity of it. While I don’t think my app will look overall like this one, I feel I can draw from this app a little note from the simplicity. The app features the Cinnamon chess engine.

I also took a moment to look at the Chess Clock program by Michele Castellazzi. It has all the standard features of a chess clock, and worked flawlessly when I tested it out. Again, the interface was focused on simplicity, which made for a very appealing and smooth interface.

If there was anything to take specifically from the clock application, it would have to be the pause feature. Setting up my own interface for play, it might be nice to be able to pause the game, but further thought brought me to the idea of pausing the game if you press the home button as well. Perhaps that might be a handy feature, as well.

Linux – keep it simple.

Getting permission to program the Bluefruit Feather board in Ubuntu

bf_f_1st program

I am learning more every day by simply trying to play with my new toy: a Bluefruit Feather board! As I mentioned before, my brother got this little gadget for me as a Christmas present, and it has been a lot of fun to play with!

I was having a bit of trouble uploading my program to it, though, until I figured out my problem. Since this took me a while, I thought I would share it with you, so perhaps you can save a little bit of time on this issue.

TL,DR: Make sure you add your username to the dialout group, so you will have permission to use the ttyUSB0 interface.

I was attempting to upload a little program (the default beginner program, slightly tweaked to change the blink time) to the board. I had the drivers installed, I could hook to the board and pull the boards data, but I couldn’t upload the new program to it.

I kept getting an error that suggested I needed to put the device in DFU mode, but that didn’t turn out to help me. The issue was simply one of permission. My username did not have permission to use the ttyUSB0 interface. So, usermod myself into the dialout group, and after logging out and back in, I was good to go!

Here is the little program that I uploaded to the board:

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(5000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

It just causes the red led to flash for 5 seconds, turn off for 1 second, and repeat endlessly. It worked great! But, that wasn’t cool enough…. So I looked over some examples and made it fade in and out with this code:

 

int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
analogWrite(LED_BUILTIN, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}

Now I have my own mini Cylon with a glowing, fading red eye saying, “By your command!” (Okay, so I may be having way too much fun with this….)

Linux – keep it simple.

Setting up the Arduino-IDE for the Bluefruit Feather in Ubuntu

arduino1.8.5

There are a lot of neat tools available to program/hack/reprogram/work with this nifty little Bluefruit Feather board! One of them is the Arduino-IDE, a development environment that allows you create and then flash your new programs to the board. I was faithfully following along in the Bluefruit Feather Arduino setup instructions, which are here:

https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/arduino-bsp-setup

But I ran into an issue right out of the gate with step #1: Install the Arduino-IDE. In the instructions it states that it must be version 1.6.12+, something that I missed the first go around. Using Ubuntu’s regular package manager, I just used apt-get install to download  and install the Arduino-IDE.

When I moved on to the next step, where you are to put in the “Additional Board Manager URL”, I ran into a snag. There was no place to do that. The block that should have been displayed there in the preferences didn’t exist. So I re-read the instructions. Turns out that the Ubuntu repository only has Arduino-IDE version 1.0.5! So it was a little out of date.

Fortunately, on the bsp setup page above, there was a direct link to download and install the newer version of the software. A quick download, unzip/untar, and a quick $ sh ./install.sh command allowed me to install the latest version in minutes. Hopefully you can avoid that same pitfall. Now, back to those instructions….

Linux – keep it simple.

Geany: the little IDE that could!

geany_ide.png

Recently, while working with some older equipment, I needed a lightweight java IDE to compile some java projects. I really wasn’t looking for something quite as big as eclipse or netbeans, I just wanted a simple, one stop solution that would allow me to build java programs on an older laptop.

So, I rubbed a magic lamp, and out popped Geany!

Well, more specifically, the laptop is running Debian Wheezy, and had openJDK already installed. With that alone, I could have built java programs from the command line, but it can get a little tedious. So, I looked on the repositories for an IDE that wasn’t too large.

Thus enter Geany. I first used Geany a long time ago as a text editor on #! (CrunchBang) Linux, but revisiting the program revealed that I was not using it to it’s full potential. Specifically, you can compile, build, and run various program types from within Geany. Of course, it only outsources the commands for you, so you need a java jdk in order to compile java, or a c++ compiler to compile c++. Geany just does all the command line work for you.

What Geany does accomplish for you, however, is a great user interface with templates and the ability to organize projects or view code with different filters. As you can see in the picture, I was testing out Logic Crazy’s Alpha Beta Chess program.

As well as showing you the code, it can do parenthesis highlighting, colors for different code type, and a class and method tree on the side. It really is a great program if you need a lightweight IDE. I know that I’ll be putting it to good use.

Linux – keep it simple.

Take out the papers and the trash….

Every now and then I do something that I shouldn’t. Okay, probably more often than that. Either way, I really shouldn’t open up a file explorer as root, and I REALLY shouldn’t “delete” stuff while in an open file explorer as root. The reason that you shouldn’t do that is because file explorers don’t actually “delete” things. They put them in the trash. This gets doubly complicated when you use sudo to open your file explorer, because then the root “trash” ends up in your home trash.

That’s really annoying because when you right click the trash can and choose “empty”, you get an ugly pop up window explaining why you don’t have permission to empty your own garbage.

What’s worse, if you sudo open your file explorer again, you can’t get to the trash, because it is not a “real place”. Opening trash:/// in your file explorer just brings up more ugly pop up windows.

Fortunately, the answer is easy.

$ cd ~/.local/share/Trash/

Now you are in your trash can. If you look into your ./files/ folder, you will see the culprits. So, the simple thing to do is:

$ sudo chown -Rv <yourusername>:<yourusername> ./files/

or sudo chown -Rv alaskalinuxuser:alaskalinuxuser ./files/ in my case.

Now all the files in your trash can have been modified to be yours. Yes, now it is your mess to clean up, and to take out the trash you can once again right click on the trash can and say “empty”.

Linux – keep it simple.