Does a mobile cell phone booster really work?

As may be evident by the name of the blog, as well as my username, I live in Alaska. Alaska is a really big state. Alaska also has relatively poor cell phone coverage, in my opinion. Often when driving around, I will loose signal, drop calls, or even have no connectivity, which can be a real problem if there were to be an emergency.

So, I decided to do something about it. I decided to buy a “mobile booster”. Of course, I was really concerned about gimmicky devices that actually wouldn’t help me, and I wanted to make sure that I was buying something worth having, without paying an arm and a leg for it. So, here is what I bought (no paybacks for me if you click on it, just a link showing what I bought) :

Car Mobile Booster 850/1900mhz Cellular Signal Repeater Cell Phone Amplifier For Truck,RV
by Protone Led
Link: https://www.amazon.com/gp/product/B06XCBQ87T/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1

Why did I choose this one? Well, there are many types out there, particularly of interest is what bands it supports. This model doesn’t help with LTE bands, but it does help with the 3g bands that are in use in my area. I figure that I need this to make phone calls or send texts, not to surf the web. Aside from that, it had good reviews and seemed to me that people who actually owned it thought that it helped their signal.

Of course, I wouldn’t be writing this post if I didn’t give it a good test, of which I did two.

The first test I tried to use it at my home, where there was already fair signal, to see if it would “boost” it up to great signal. I couldn’t tell the difference with the thing on or off. I decided that I needed a better test.

For my second test, I took the unit to my work. At my work is a steel enclosed room, like a Faraday cage, in which I receive almost no cellular signal. As you can see from the screen shots, while in that room, I have -118 dbm of signal. With the booster off, I tried a speed test, but it would not receive a return. I then tried a phone call, which told me I had no available network. Great! Perfect for my test.

Then I set up the booster by placing the receiving antenna outside of the room, with the cord pinched in the door weatherstripping to the inside. I hooked up the unit and broadcasting antenna inside, but didn’t plug it in. I tried several more tests to make sure that the antenna itself was not somehow a “conduit” from which my phone would receive signal. Nothing, still no usable signal.

Then I plugged the unit in.

Immediately my signal strength maxed, and SatStat showed -89 dbm of signal! I then proceeded to make a phone call: success! I was able to connect and talk to the weather station via phone. Great! I decided to get more information by running a speed test. I was able to pull 0.46 Mbps downloads, and 0.02 Mbps uploads. Latency was also pretty high, as the ping took 248 ms to complete the trip. However, compared to 0 connectivity before, I thought that was a bit of an improvement.

I also did several tests based on proximity of my cell phone to the inside repeater antenna. It didn’t seem to matter. I could walk around anywhere in the small room and still have signal. Signal would degrade a bit, however, when I put my cell phone into some of the server racks (that seems reasonable to me, though).

So, overall impression: it really does work! However, it seems best suited for a “near nothing” situation, rather than to boost signal to a decent connection. I guess now I’ll have to try it out on the road.

Linux – keep it simple.

Advertisements

Building Android Oreo, error: ADDITIONAL_DEFAULT_PROPERTIES must not be set

So, round one of building Android Oreo. Specifically giving an early try for SlimRoms and OmniRom, both of which have started an Oreo build system. Obviously, anything at this stage is a pre-alpha, more or less just a rebranded AOSP build. Still, it’s fun to check it out and see what Oreo is all about.

That being easier said than done, here was the first error (not counting all the ones to set up the build environment to recognize the H811 phone as an option) :

[CODE]
out/build-slim_h811.ninja is missing, regenerating…
build/core/main.mk:245: error: ADDITIONAL_DEFAULT_PROPERTIES must not be set before here: ro.device.cache_dir=/data/cache.
07:23:13 ckati failed with: exit status 1
make: *** [run_soong_ui] Error 1
[/CODE]

So, I took a look at build/core/main.mk on line 245, and made a few edits:

[CODE]
#
# —————————————————————–
# Validate ADDITIONAL_DEFAULT_PROPERTIES.
# WJH ifneq ($(ADDITIONAL_DEFAULT_PROPERTIES),)
# WJH $(error ADDITIONAL_DEFAULT_PROPERTIES must not be set before here: $(ADDITIONAL_DEFAULT_PROPERTIES))
# WJH endif
[/CODE]

Now the build can continue. This is probably not the right way to fix this, but it is an easy bandaid until I figure that out.

Linux – keep it simple.

 

CompTIA Network+ N10-006 exam

Among other certifications, one of the certs that I needed to renew was my CompTIA Network+ exam. The current series is N10-006, and to take the test locally through Pearson View costs $295! That is a hefty chunk of change. However, I need this certificate for my work, so I had little choice but to renew the certification.

Fortunately, my work was willing to foot the bill, provided that I pass the test. Unfortunately, the test is still $295 even if I were to fail. Last time that I took this test, I just barely passed, and I didn’t want a repeat of that.

On the previous test, I was using an outdated study book that was for an older version of the test than was currently in place. Some of the areas I struggled in the most were fiber optics and wireless technologies.

This time I decided to do things right and get the latest study guide, with the intent of doing better than last time. One would think that since I’m working in the IT world, I would be up to date on the latest technology, but I guess that really depends on where you work.

In my case, most of our facilities have rules banning the use of wireless technologies. On to of that, in almost 8 years at my work, I’ve only troubleshot a fiber optic network once, and I’ve never actually installed one anywhere. However, ask me to convert base 10 to base 8, or decimal to binary, and I’m your man!

I can imagine how others in my field may fall into this trap as well. The technologies around us are changing, but our local area network is not. We are required to recertify, even though the scope of our job hasn’t changed in years. In a way, these certification requirements might seem tedious or overwhelming, but really they are a blessing in disguise, as they make is keep up with the times.

So of you are taking the N10-006 test, either for the first time, or as a renewal, here’s what I did to prepare for the test. Not saying this is the only way, but this worked for me. Not only that, but rather than barely passing, my score was decent this time.

Last time I used “exam cram” books. I guess it got me through, but I feel that those are better suited for the technician who does work on the full scope of equipment covered by Network+ on a day to day basis. I needed something with more meat on it to teach me about things I’ve never done, or done very little of. So, I purchased this book:

http://www.mypearsonstore.com/bookstore/comptia-network-plus-n10-006-cert-guide-9780789754080

I didn’t purchase it there, and of you look online, it can be found cheaper, much, much cheaper.

After buying the book, I took a highlighter and highlighted key portions in every chapter. This was a huge help to me on the day of the test, as I thumbed through the book, looking over my highlighted portions just before the exam.

The book comes with a CD and software for practice tests, but I didn’t use it. I have a Linux computer, and the software was for Windows machines. Instead, I used this free online resource to take some practice tests:

http://www.examcompass.com/comptia/network-plus-certification/free-network-plus-practice-tests

With 20 test of 25 questions each, those 500 questions gave new a feel for areas I was weak in. After each test, it tells you the questions you got right or wrong, as well as what the right answer was, which was helpful.

As for the test itself, it has changed since I took it last. Before, it was just a series of multiple choice questions. They still had many of those, but the new test implemented “simulations”, or pop up windows with diagrams and pictures of computers and consoles that you could drag and drop or type in. They seemed a bit buggy to me though, after making a selection the simulation would close, even though you were not done yet. However, opening the simulation again proved that everything you changed was still there.

Hopefully, if you are looking to take the Network+ exam, then some of these notes were useful for you.

Linux – keep it simple.

Using PicoLisp on your Android phone, the easy way!

Screenshot_20170829-084900

I’ve been spending some free time having fun and testing out a text adventure game by the Quiet Learner, called Dr. Theobold, written in PicoLisp. The problem I found though, was that I am not often at my main computer, where I have PicoLisp installed. I needed a solution to use PicoLisp on my Android cell phone, and thanks to Termux, I found it!

Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. A minimal base system is installed automatically – additional packages are available using the APT package manager.

As you can see in the quote from the their website, Termux is a great open source tool that allows you to have a terminal and Linux environment all wrapped up in an app.

To get PicoLisp working on Termux is quite simple. See below for the commands:

$ pkg install picolisp

That’s it! Now you can use picolisp just as you would on your Linux computer. If you want to check which version is available, you can simply type:

$ pkg search picolisp

Which, at the time of this writing, for my aarch64 phone is 17.8.7. Hopefully, that will get you up and running PicoLisp on your phone, should you need it.

Linux – keep it simple.

error: undefined reference to ‘wifi_start_fstman’

Ah, the continuing saga of the far far away dream of building OmniRom Nougat for the LG G4. Yet again, another set of errors:

[CODE]
system/qcom/softap/sdk/qsap.c:705: error: undefined reference to ‘wifi_start_fstman’
system/qcom/softap/sdk/qsap.c:714: error: undefined reference to ‘wifi_stop_fstman’
system/qcom/softap/sdk/qsap.c:722: error: undefined reference to ‘is_fst_enabled’
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[/CODE]

So I took a look at the lines in question of system/qcom/softap/sdk/qsap.c:

[CODE]
int qsap_prepare_softap()
{
ALOGD(“Starting fstman\n”);
return wifi_start_fstman(TRUE);
}

int qsap_unprepare_softap()
{
ALOGD(“Stopping fstman\n”);
return wifi_stop_fstman(TRUE);
}

int qsap_is_fst_enabled()
{
return is_fst_enabled();
}
[/CODE]

No big deal, I thought. I could just wrap them in an #ifdef (if defined) statement, and only use them if they are actually defined. So I did.

[CODE]
int qsap_prepare_softap()
{
/* WJH */
#ifdef wifi_start_fstman
ALOGD(“Starting fstman\n”);
return wifi_start_fstman(TRUE);
#endif
}

int qsap_unprepare_softap()
{
/* WJH */
#ifdef wifi_stop_fstman
ALOGD(“Stopping fstman\n”);
return wifi_stop_fstman(TRUE);
#endif
}

int qsap_is_fst_enabled()
{
/* WJH */
#ifdef is_fst_enabled
return is_fst_enabled();
#endif
}
[/CODE]

You are all probably smarter than me, and see the error of my ways, but non the less, I ran it as so, and this was my next set of errors:

[CODE]
system/qcom/softap/sdk/qsap.c:707:1: error: control reaches end of non-void function [-Werror,-Wreturn-type]
}
^
system/qcom/softap/sdk/qsap.c:716:1: error: control reaches end of non-void function [-Werror,-Wreturn-type]
}
^
system/qcom/softap/sdk/qsap.c:724:1: error: control reaches end of non-void function [-Werror,-Wreturn-type]
}
^
[/CODE]

The problem was that the in int qsap_is_fst_enabled(), int qsap_unprepare_softap(), and int qsap_prepare_softap() integers all return nothing, or are “null”. That’s no good for follow on code, they have to have some value. So, I thought about it for a while, and right or wrong, I decided to use an #ifndef (if not defined) flag.
If the functions were defined, they would be used, if they are not defined, then I gave a return value, arbitrary as they may be, but what I suspect is the “right answer”. Take a look:

[CODE]
int qsap_prepare_softap()
{
/* WJH */
#ifdef wifi_start_fstman
ALOGD(“Starting fstman\n”);
return wifi_start_fstman(TRUE);
#endif
#ifndef wifi_start_fstman
ALOGD(“Starting fstman\n”);
return 1;
#endif
}

int qsap_unprepare_softap()
{
/* WJH */
#ifdef wifi_stop_fstman
ALOGD(“Stopping fstman\n”);
return wifi_stop_fstman(TRUE);
#endif
#ifndef wifi_stop_fstman
ALOGD(“Stopping fstman\n”);
return 1;
#endif
}

int qsap_is_fst_enabled()
{
/* WJH */
#ifdef is_fst_enabled
return is_fst_enabled();
#endif
#ifndef is_fst_enabled
return 0;
#endif
}
[/CODE]

And viola! This time it worked. What result that will have in the end? I’m not sure. Hopefully it still functions properly, but that remains to be seen….

Linux – keep it simple.

 

Function “appears in overlay but not in the base package”

Ah, OmniRom. Yes, I am still working on it. Hopefully you are not getting tired of these errors, but I find it helpful to log them here, and hopefully others will also. Previously, we looked at ways to use <add-resource> to add functions into a rom, but here we are just going to disable an overlay that we can work on later.

[CODE]
FAILED: /bin/bash -c “(touch out/target/common/obj/APPS/framework-res_intermediates/zipdummy ) && ((cd out/target/common/obj/APPS/framework-res_intermediates/ && jar cf package-export.apk zipdummy) ) && (zip -qd out/target/common/obj/APPS/framework-res_intermediates/package-export.apk zipdummy ) && (rm out/target/common/obj/APPS/framework-res_intermediates/zipdummy ) && (out/host/linux-x86/bin/aapt package -u -x –private-symbols com.android.internal -z –pseudo-localize -M frameworks/base/core/res/AndroidManifest.xml -S device/lge/g4-common/overlay/frameworks/base/core/res/res -S frameworks/base/core/res/res -A frameworks/base/core/res/assets –min-sdk-version 25 –target-sdk-version 25 –product default –version-code 25 –version-name 7.1.2 –skip-symbols-without-default-localization -F out/target/common/obj/APPS/framework-res_intermediates/package-export.apk )”
device/lge/g4-common/overlay/frameworks/base/core/res/res/values/config.xml:277: error: Resource at config_supportDoubleTapWake appears in overlay but not in the base package; use <add-resource> to add.
[/CODE]

So, as you can see, we have something in our overlay that is supposed to lay over the top of some source code, but the base source code doesn’t have that function to be “overlayed”. Here is where we see the overlay in device/lge/g4-common/overlay/frameworks/base/core/res/res/values/config.xml:277:

[CODE]
<!– Whether device supports double tap to wake –>
<bool name=”config_supportDoubleTapWake”>true</bool>
[/CODE]

So, we changed it to:

[CODE]
<!– Whether device supports double tap to wake
<bool name=”config_supportDoubleTapWake”>true</bool> WJH –>
[/CODE]

By commenting it out, it will no longer “overlay” it onto something that doesn’t exist. Be sure to take a look at my other article for how to use <add resource> to actually add an overlay item to the base package.

Linux – keep it simple.

 

Failed to mmap at expected address

In the continuing OmniRom saga, another day with another fail:

[CODE]FAILED: /bin/bash -c “(mkdir -p out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/ && rm -f out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/package.odex ) && (find out/target/common/obj/APPS/CaptivePortalLogin_intermediates/ -maxdepth 1 -name \”classes*.dex\” | sort | xargs zip -0qjX out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/package.odex ) && (mv out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/package.odex out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/package.odex.input ) && (rm -f out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/package.odex ) && (mkdir -p out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/ ) && (ANDROID_LOG_TAGS=\”*:e\” out/host/linux-x86/bin/dex2oatd –runtime-arg -Xms64m –runtime-arg -Xmx512m –runtime-arg -classpath –runtime-arg \”&\” –boot-image=out/target/product/h811/dex_bootjars/system/framework/boot.art –dex-file=out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/package.odex.input –dex-location=/system/app/CaptivePortalLogin/CaptivePortalLogin.apk –oat-file=out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/package.odex –android-root=out/target/product/h811/system –instruction-set=arm64 –instruction-set-variant=generic –instruction-set-features=default –include-patch-information –runtime-arg -Xnorelocate –no-generate-debug-info –abort-on-hard-verifier-error –no-inline-from=core-oj.jar   –compile-pic ) && (rm out/target/product/h811/obj/APPS/CaptivePortalLogin_intermediates/oat/arm64/package.odex.input )”dex2oatd E 16505 16505 art/runtime/gc/heap.cc:324] Could not create image space with image file ‘out/target/product/h811/dex_bootjars/system/framework/boot.art’. Attempting to fall back to imageless running. Error was: Failed to load /system image ‘out/target/product/h811/dex_bootjars/system/framework/arm64/boot-telephony-ext.art’: Failed to mmap at expected address, mapped at 0x2b038dbfd000 instead of 0x70ddd000 : Requested region 0x70ddd000-0x70dde000 overlaps with existing map 0x70ddd000-0x70dde000 (/home/alaskalinuxuser/compile/20170727_aospa7/out/target/product/h811/dex_bootjars/system/framework/arm64/boot-telephony-ext.art)dex2oatd E 16505 16505 art/runtime/gc/heap.cc:324] 0x70ddd000-0x70dde000 rw- /home/alaskalinuxuser/compile/20170727_aospa7/out/target/product/h811/dex_bootjars/system/framework/arm64/boot-telephony-ext.art[/CODE]
It took me a while to figure this out, but the heart and soul of this problem lies with ART’s AOT (Ahead Of Time) preoptimization. Fortunately, I found a helpful tidbit on how to disable the preoptimization of this app. I did so here, in the /frameworks/base/packages/captiveportallogin/AndroidManifest.xml file:

[CODE]
    <application android:label=”@string/app_name” android:vmSafeMode=”true” >        <activity            android:name=”com.android.captiveportallog
[/CODE]
By adding android:vmSafeMode=”true”, the AOT of ART is disabled for this app. You can read more about that here: https://developer.android.com/guide/topics/manifest/application-element.html#vmSafeMode
Linux – keep it simple.

To skia or not to skia?

What is skia? Well, skia is used for drawing 2d graphics, and that is pretty important in Android.
More specifics can be read here at their website.
Essentially, it is used for making menus and drawings.

Now you are wondering why we are talking about it. Well, because we had an error:

[CODE]
ninja: error: ‘out/target/product/h811/obj_arm/STATIC_LIBRARIES/libqc-skia_intermediates/libqc-skia.a’, needed by ‘out/target/product/h811/obj_arm/SHARED_LIBRARIES/libskia_intermediates/LINKED/libskia.so’, missing and no known rule to make it
[/CODE]

As it turns out, the open source skia project was forked and some closed material was added for specific hardware, like qcom boards. So, with a few edits in ./external/skia/Android.mk, we changed it to go back to using the open source method, rather than qual comm’s specific one. All that is lost is a little bit of efficiency on qcom chips, which is actually important, but not more important than working at all.

[CODE]
#ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
# LOCAL_WHOLE_STATIC_LIBRARIES += libqc-skia
#endif
# WJH
[/CODE]

A few comments here and there, keeping it from checking if the board is a qcom board allows us to build and use the open source variant. Simple!

Linux – keep it simple.

use BUILD_PREBUILT instead!

OmniRoms Nougat. An elusive dream of mine is building OmniRoms for my devices. In the past I just couldn’t seem to get them to work. Well, I have decided to give it another go, and here was one of my first errors:

[CODE]
build/core/Makefile:34: *** Prebuilt apk found in PRODUCT_COPY_FILES: vendor/lge/g4-common/proprietary/priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk:system/priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk, use BUILD_PREBUILT instead!.
[/CODE]

So, I took a look at g4-common-vendor-blobs.mk:

[CODE]
vendor/lge/g4-common/proprietary/lib/libloc_ds_api.so:system/lib/libloc_ds_api.so \
vendor/lge/g4-common/proprietary/lib/libalhdri.so:system/lib/libalhdri.so \
vendor/lge/g4-common/proprietary/priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk:system/priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk \
vendor/lge/g4-common/proprietary/vendor/firmware/libpn547_fw_C9.so:system/vendor/firmware/libpn547_fw_C9.so \
vendor/lge/g4-common/proprietary/vendor/firmware/BCM4335_003.001.009.0117.0620_LGE_P1_EU.hcd:system/vendor/firmware/BCM43…..
[/CODE]

Here we can see that the file in question “qcrilmsgtunnel.apk” is being copied over with the vendor blobs. The error is telling us that we need to install it as a prebuilt app, instead of copying the app over as a normal file. So, I edited out that line in the g4-common-vendor-blobs.mk file, and edited g4-common-vendor.mk by adding it like so:

[CODE]
PRODUCT_PACKAGES += \
qcrilmsgtunnel \
qcnvitems \
qcrilhook
[/CODE]

Notice that I did not move the apk file around, just redefined how to get it moved into the rom. Well, that took care of that error! 1 down, untold dozens to go!

Linux – keep it simple.

 

Critical Velocity – an open source libGDX game that was crashing on small screens is now fixed!

Critical Velocity is a fun little open source arcade style scrolling game that I made after finishing my Android developer class. It was my first released game using the libGDX engine, an open source graphics engine that is great for making games. Due to my inexperience, however, I didn’t take into account that all screens are not created equal. Some screens are bigger than others, and some have lower resolution than the phone I built the game on.

This caused a problem. After releasing the game, I quickly was alerted to the issue through the GitHub issue tracker, where several players let me know that it was crashing on startup with their phones. It took a little bit of time to figure out, but I came to realize that the app was crashing on phones that were smaller than 800×480 screen resolution.

At first I thought there were all sorts of problems with graphic asset sizes, and memory issues. I tried numerous things to fix it, but nothing worked. Finally, I gave up. But, a few days ago, I decided to take another look. By God’s grace, this time I got it figured out! Before, I was working off of the information provided by people with smaller resolution screens, but I decided that I should load up the game in an emulator with a 320×240 resolution screen, and watch the logs. That’s when I found the problem.

The issue didn’t have anything to do with libGDX, the graphic assets, or the amount of memory the game takes (about 15 MB). As it turns out, the math just didn’t add up. Literally!

In the game, the upper and lower walls are separated by a gap. The size of the screen and the size of the gap is used to determine where the next set of walls opening can be (up or down) from the previous wall. The idea was that as you went faster, an opening at the top of the screen followed by an opening at the bottom of the screen is technically impossible to reach, so this math would keep it “near” the other opening within reason, but still allow it to be randomly placed, up or down from the previous one.

The math looked like this:

Place of the next wall opening = randomly based off of (1/2 of the screen height – the size of the gap) from the center of the screen.

This worked great on my test phone that had a screen resolution of 1920×1080. With the standard gap that I set of 450, the math looked like this:

Place of the next wall opening = randomly based off of (960 – 450 = 510) from the center of the screen.

But it didn’t work for a screen as small as 320×240 because:

Place of the next wall opening = randomly based off of (160 – 450 = -290) from the center of the screen.

For a random number, you can have a negative outcome, but you cannot put in a negative input. The random number is based on starting at 0, and create UP TO X random numbers. So if X is negative, then the random number generator doesn’t know what to do!

So I had to invent a way to fix this problem. Fortunately, that was easy. I used an if/then statement to ask what the screen size was, and then changed the gap size to be less than 1/2 of the screen size. I also had to edit a few parameters, such as thrust, speed, and distance also based on screen size. You can check out my code and commits here and here, if you’d like.

Long story short: Don’t make assumptions, check the logs and they WILL lead right to the problem! If I had run the emulator myself before, not having a small screen phone anymore, I hopefully would have seen this right away. Here are some screen shots of the game on different phones. Unfortunately, I still have a lot to learn to make sure that the game LOOKS the same on different sized screens, but at least now it doesn’t crash!

Linux – keep it simple.