Archive

Posts Tagged ‘tutorial’

Getting Started with NavSpark mini GPS Module

January 20th, 2016 5 comments

I noticed NavSpark mini GPS module a couple of weeks ago, and since it was free, not including $10 for shipping, I went ahead and ordered. Since the freebie got popular, SkyTraq took some time to ship it, and when they did they provide a “not trackable” tracking number, which I’m not sure what that mean as I could track the parcel from Taiwan to Thailand using 17track website without issues.

The packages included NavSpark mini and a USB to TTL module as described, so I insert both and connect VCC ,GND, and UART as shown on the pictures on the product page.

Click to Enlarge

NavSpark mini (Left) and USB to TTL board (Right) Connected to Breadboard – Click to Enlarge

I also connected the GPS antenna from LinkIt ONE development kit to the uFL connector on NavSpark mini, as well as a micro USB to USB cable to my computer. If you don’t have such antenna, you’ll need to add the $9 GPS/GLONASS antenna on NavSpark website to your order.

The easiest way to get started, and make sure the board works is to use GNSS Viewer program. The downside for a Ubuntu guy like me is that it only runs on Windows. But no problem, I started my  Windows 7 virtual machine in Virtual, enable the USB to TTL port with Devices->USB menu, and installed Prolific drivers. However, I never managed to make the driver works, with Windows 7 complaining that:

Windows cannot verify the digital signature for the drivers required for this device. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source. (Code 52)

I did not want to mess with Windows in the evening, so I simply started an old Acer netbook with Windows XP. No problems with drivers, but GNSS Viewer did not like my netbook resolution (1024×600), and the program is poorly written as it does not allow you to resize the window.

So I decided to just use the Arduino IDE in Ubuntu by following the instructions in the User’s guide:

  1. I already had Arduino 1.6.6 installed from https://www.arduino.cc/en/Main/Software
  2. You’ll also need the LEON3 sparc toolchain to be install in /opt:
  3. You are also asked to install the 3-bit version of openJDK:
  4. Finally, you have to install NavSpark board manager (http://navspark.mybigcommerce.com/content/package_navspark_index.json) and configure the Arduino IDE to use NavSpark mini.
    NavSpark_mini_Arduino
    This looks good, except for the Invalid library found message…
  5. The next step is to find some hello work app to check GPS connectivity, and this is where I stopped, simply because there aren’t any available samples according to the user’s manual, except demo_hello_world_nmea.
    NavSpark_mini_code_sampleBut when you download the samples, they are all there, except the working one :)…

I’ve ask what need to be modified for partially compatible samples on the forums.

Finally, I remembered I still had a Windows 10 TV stick, I tried GNSS Viewer yet again in MeLE PCG01, and I was happy that after 3 hours of messing around, I finally managed to get a signal, and could make sure the board was indeed working.

GNSS_Viewer_NavSpark_mini

Click to Enlarge

All I had to do was to select the COM port for Prolific, and click on Scan All which connect the COM port @ 115,200, and got a very fast fix indoor.

If you are interested in such GPS module, the “freebie” is still available, and you just need to pay for $10 for shipping, and remember to add a u.FL GPS antenna if you don’t have one.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Resize Android’s Internal Storage Partition in Rockchip Devices

December 23rd, 2015 1 comment

I installed Light Biz OS firmware on GeekBox yesterday, but I’ve quickly realized many applications such as Gimp Inkscape would not install due to the small 1.94GB “internal partition”, so I asked how to increase the partition size in GeekBox forums last evening, and got an answer overnight from “dewet”.

The good news is that it worked so I’ll share the steps I followed in a computer running Ubuntu 14.04. It might also be possible to perform the same tasks within a Windows machine with Rorkchip’s Factory tools

    1. First let’s download the utils with relevant scripts and binaries:
    2. Now copy your device or board’s firmware file “update.img” to the working directory, and unpack it:

      The output should look like:

      The files will be in the “output” directory.
    3. For our purpose “parameter” file, and especially the last line (CMDLINE) where we will want to adjust the userdata partition size:
    4. The partitions are defined with size@start_address, so we’ll want to change userdata size, and shift the start_address of the remaining partitions with the extra size added to userdata. This can be done manually in a Linux editor, but I played it safe and instead downloaded and installed RK_ParamEd.exe for windows, and change the 2048 MB set for userdata partition to 6144MB (6 GB).RK_ParamEdSave, and we can see how the end of CMDLINE changed:
    5. Now we can repack the image, after moving the content from the output directory to rockdev directory.

      A successful repacking should look as follows:
    6. Now flash update.img firmware back to your Rockchip device in Linux or Windows.
    7. Done! I now have a 6GB internal storage partition in Android 5.1 based Light Biz OS operating system.
6GB "Internal Storage" Partition in Light Biz OS (Click to Enlarge)

6GB “Internal Storage” Partition in Light Biz OS (Click to Enlarge)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Upgrade Rockchip RK3368 Firmware in Linux

December 21st, 2015 1 comment

I’ve been looking for ways to upgrade firmware on Rockchip RK3368 based GeekBox in a computer running Ubuntu 14.04, but while they’ve provided firmware update instructions for Windows, which remains basically the same as upgrading firmware on Rockchip RK3288, there’s no such information for Linux. However, I could remember than Radxa Rock supported upgrade_tool utility, but since the tool linked on Radxa website might be outdated, I instead searched for some RKtools repository on Geekboxzone Github account, and I was lucky enough to find one.

upgrade_tool_RK3368

Here’s what I did to flash Light Biz OS to GeekBox with my Linux computer:

  1. Get the tools, and make sure upgrade_tool is there.
  2. Download and extract the firmware, e.g. Cross_Lollipop_BizOS_V151208.7z:
  3. Now connect a USB cable to the USB OTG port of your device or board. In case of GeekBox that’s the micro USB port. Now as the board is powered on, keep pressing the Update key while pressing the Reboot key for a short time, and release the Update key after a few seconds. If Android or Ubuntu boots then you have not pressed the Update key long enough.
  4. Now you can use upgrade_tool to flash the image
  5. The tool should then show the progress, and complete successfully:

    During the process, the board will reboot twice: once to flash the image, and once to boot your newly flashed firmware.
  6. You’re done. Enjoy!

If you own an RK3368 Android TV box, instead of a development platform like GeekBox, it’s unlikely you’ll get a reset button, but you’ll probably have a Update or Recovery pinhole somewhere that you can press with a toothpick, while powering on your device, in order to enter bootloader mode.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Upgrade SMA-Q Smartwatch Firmware

December 17th, 2015 12 comments

I’ve started testing SMA-Q smartwatch, and so far I’ve had lots of issues with Bluetooth connectivity. The watch can rarely pair with my Android smartphone, and I was unable to enable features like Anti-lost and Sedendary alerts as the app would always report there was no connection. The company has sent me instructions to upgrade the firmware, and it seems to have improved things a little.

So first you need to install SMA Services app by scanning the QR code on the user’s manual, or download the apk by following this link. Once this is done you can register, or skip registration. Now go to Setting, and select Connect watch.

Click to Enlarge

Click to Enlarge

You should see a circle as on the left side above reading Searching watch, then Bluetooth Connecting, before seeing a message the connection was successful. You’ll probably them want to tap on Upgrade app, before tapping on Firmware upgrade (local version 1.0.0) which will show the screenshot in the middle. Simply press the right button (meaning OK), and the third screenshot will appear. At this stage, turn off your watch by pressing the back button for a few seconds, then press the Confirm (middle right) and back button simultaneously until a rainbow like pattern shows in the screen of the watch. Now press the right button (meaning start), the watch screen should turn red, and the app should show the progress of the file transfer.

SMA-Q_Watch_Firmware_UpdateYou’ll get a success message in the watch once the transfer is complete, and the watch screen will stay red. Now press the back button to turn on the watch. You should be able to connect to the watch (be patient as it may easily take 20 to 30 seconds), and notice the firmware has been upgraded to 1.2.2, or whatever version is available at the time of the update.

Click to Enlarge

Click to Enlarge

After the upgrade I was also able to enable Anti-lost and Sedentary, which I had never manged to do with the older firmware. I’ll see how it goes…

You can also watch the embedded video below which shows the whole process of updating the firmware and pairing the watch and the phone.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Root Amlogic S905 based MINIX NEO U1 Box in Windows and Linux

December 15th, 2015 14 comments

MINIX NEO U1 is a great device, but if you have some apps that require root access, the firmware is not rooted by default. AndroidPC.es just posted instructions to root the device in Windows, and I’ve also adapted Daemonium’s batch script for Windows as a shell script in order root the device from Linux. Please note that this will break OTA firmware update, so you’ll have to upgrade firmware manually after rooting.

MINIX_NEO_U1_Root

The most steps are common between Linux and Windows

  1. Enable Developer options, by going to Settings->Advanced Settings->About Mediabox, and click 6 or 7 times in the Build number section, until the new menu is enabled.
  2. Go back once, and access Developer options to make sure USB debugging is enabled
  3. Now go to Settings->Network to check and note your IP address (WiFi or Ethernet)
  4. Download and extract AndroidPC.es_MINIX_NEO_U1_root_v01_Daemonium.zip

They also asked to install WiFi adb in your system, but I did not need to do so with the Linux procedure, and it’s likely not needed on Windows either.

Windows remaining instructions:

  1. Run root_u1.bat script with NEO U1’s IP address as argument (e.g. 192.168.1.99)
  2. Press Enter when asking to continue, and the system will install the necessary files located in root directory
  3. The system will then automatically reboot and MINIX NEO U1 should be rooted

Linux remaining instructions:

  1. Download root_s905.sh shell script and copy it into the same directory as root_u1.bat
  2. Run the script as follows with your device’s IP address as argument:
  3. Press Enter when asked if root access via adb is successful, and the script will copy the files on your system, and reboot it automatically
  4. MINIX NEO U1 should now be rooted.

Both Windows and Linux scripts might also work with other devices, but they required adb root to provide a shell script with root access, which won’t be the case for all firmware.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Nandland Go Board is a $50 Board for Learning FPGA, VHDL & Verilog Programming (Crowdfunding)

December 8th, 2015 No comments

There are many FPGA boards on the market at various price points, but many assume you already have the technical knowledge to program the bard with Verilog or VHDL, and may not be suited to beginners. Nandland Go Board is a $50 board that targets beginners with tutorials to get started with blinking LEDs, controlling buttons, received data through the UART interface, showing display patterns via the VGA interface and more.

Nandland_Go_Board

Go Board specifications:

  • FPGA – Lattice ICE40 HX1K with 1280 logic cells, 64Kbit RAM, and one PLL.
  • Storage – 1Mb flash
  • Clock – 25 MHz on-board clock
  • Video Output – VGA Connector
  • Display – Dual 7-Segment LED Display
  • USB – 1x micro USB connector for power, communication, and programming
  • Expansion – PMOD connector
  • Misc – 4x user LEDs, 4x push buttons
  • Power – 5V via micro USB port
  • Dimensions – N/A

The board will be programmed using Lattice Semi iCEcube2 design software, and dozens of tutorials will be provided specifically for the Go board, including some of the examples showcased in the crowdfunding video.

Russell Merrick, the board designer, has launched the project on Kickstarter where he has raised close to $4,000, and reached the low $1,000 funding target of the project with 75 backers. A pledge of $50 should get you a Go board on February 2016. Shipping is free to the US, but you’ll need to add $10 to the rest of the world. Even if you’d like to give the board a pass for now, you may still want to have a look at nandland.com website if you are interested in learning more about FPGAs.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to extract kernel.img with mkboot script

December 7th, 2015 1 comment

As I tried instructions to install Linux on Amlogic S905 Android TV boxes yesterday, I wanted to extract kernel.img file found in Android firmware, but Google did not help that much until I found mkboot part of mkbootimg_tools scripts.
mkboot

But first let’s see how kernel.img is created… Google provide a Python script called mkbootimg that combine the kernel image (e,.g. zImage), a rootfs/ramdisk and the device tree (DTB) file with a command line that looks like:

However, AFAIK the company does not provide a “unmkbootimg” script, and mkbootimg can only be used to create kernel.img, not decompile it. But that’s what mkboot does, and it works for kernel.img and recovery.img. Let’s retrieve the necessary files first:

mkboot is a bash script so we can use it right away:

So it can be used both for unpacking and repacking kernel.img to/from the output directory. Let’s run the command with an actual kernel.img file:

The script has indeed decompiled kernel.img with the kernel itself, the ramdisk (compressed and decompressed), and second.img that’s the DTB file. img_info contains the information shown during extraction above.

second.img and second.img.tmp files differ in size, so I ran through dtc to get the readable device tree file,. and the resulting files are identical:

So the tmp files must have had some padding, that the script stripped to create second.img.

In theory, you can change the kernel files, randisk or device tree, and repack everything with:

but it did not quite work here:

If we look a the first ./mkbootimg command in this post we can see some different offset in the decompile image, so I changed img_info as per the first command line, with base=0, kernel_offset=0x01080000, and ramdisk_offset=0x01000000, and it all worked out OK:

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Run Headless Linux on Amlogic S905 Devices Such as MINI MX or K1 Plus

December 6th, 2015 45 comments

A few week ago, I had been informed that Amlogic S905 U-boot and Linux source code was released, and one person use the code and other resources to load a minimal Ubuntu 14.04 image to his K1 Plus TV box and released the installation instructions and the image (Thanks olin!). I also have K1 Plus here, but since I’ve just finished reviewing Beelink MINI MX, I decided to use the latter instead. The instructions below boot Linux from the (micro) SD card, and can still boot Android if you remove the SD card.

Modifying U-boot environment

The instructions include opening the box, and connecting or soldering a USB to TTL debug board to access U-boot and change some parameters. But later once an image with network is working, you could also build and load fw_setenv and fw_saveenv, and do the same steps with an Android shell and without the need to open the device.

Click to Enlarge

Serial connection to MINI MX (Click to Enlarge)

K1 Plus has the UART headers populated so you don’t have to solder anything, but MINI MX requires a little bit a soldering on the clearly marked Tx, Rx, GND pins.

Connect your USB to TTL debug board to your computer, configure minicom / putty / screen to 115200 8N1, start the board, and press the space bar to interrupt the boot:

You may want to run printenv in order to back the default settings:

Now you can change some settings in U-boot in order to allow for Linux to boot from SD card. If you are doing so directly in Android terminal via adb, you can replace setenv and saveenv by fw_setenv and fw_saveenv (no present in MINI MX firmware):

Flash Ubuntu image to the SD card

First download the Ubuntu image: ubuntu-14.04-headless-arm64.7z.

I’ve done this step in an Ubuntu computer, but you could also perform the same steps in Windows with 7pzip and Win32DiskImager. Install required tools and uncompress the image.

Insert the micro SD card (2GB or greater) in your computer, check the device with lsblk, and flash the image to your SD card by replacing /dev/sdX in the command below by your actual device.

Get the Device Tree File for Your device

If you are trying this on K1 Plus, you can skip that step, but if you are using another device, in my case Beelink MINI MX replacing the device tree file in /boot/dtb.img might be a good idea. For example, MINI MX would only get a Fast Ethernet connection with K1 Plus device tree file, but once I extracted the one from the Android firmware I got an Gigabit Ethernet connection.

If you’ll need to get boot.img either from some firmware update file, or directly from the NAND flash. I don’t have firmwre for MINI NX, so I dumped the boot partition with an adb shell:

Then I followed the instructions to extract a device tree file from Android, until I get boot.img-second.gz file, which I copied to the boot partition in the SD card with Ubuntu

Run Ubuntu in MINI MX

You may want to extend the rootfs partition in the SD card with gparted, or you’ll only have a small part of your SD card used. Now insert the SD into your Amlogic S905 TV box, and connect the power.

After some time getting wasted waiting for the network, you should be able to access to command line by logging in with user debian and password temppwd:

That’s a minimal image so there’s plenty of free space and memory:

All four cores are shown when I check the cpuinfo:

The kernel is build with Android’s option “CONFIG_ANDROID_PARANOID_NETWORK“, so all network configuration must be done with root:

So there’s some work to be done, but at least that’s a start.

[Update: It’s easy to put the case together with the serial wires by cutting the plastic case a little.

Beelink_MINI_MX_with_UART_cables]

 

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter