Archive

Posts Tagged ‘firmware’

How to Reinstall Android Firmware on Realtek RTD1295 TV Boxes

March 16th, 2017 13 comments

I started playing with Beelink SEA I TV box nearly two weeks ago, but I soon realized there was a big problem, while I could get an IP address with both Ethernet or WiFi, I could not access Internet, nor the local network with the box, and even ping would not work. So I contact Beelink to find a solution, and they believed I may have a problem with the firmware on my box, and recommended to re-flash it.

Great. I asked the firmware, and the company eventually provided me with two files:

Those are baidu link which may be slow to download outside of China, so the company also provided a mirror later. The customer representative told me those were “Lines brushes Pack” firmware, and after lots of email back and forth. I finally got proper instructions which should work for Beelink SEA I, but also other Realtek RTD1295 boxes such as Zidoo X9S or Eweat R9 Plus. Note that this method is only useful in case something really goes wrong, as the device normally support OTA firmware updates.

First you’ll need a Windows computer or laptop, and a USB male to USB male cable., before following the firmware recovery instructions they use at the factory.

  1. Download setup.exe
  2. Click on setup.exe to install Microsoft Visual C++ 2012 and .NET Framework 4.6.
  3. Now reboot as instructed, and right click on setup.exe to run it as an administrator, and install rtk_usb_mp_tool. If you don’t run it as Administrator you’ll run into permissions issues and the installation will fail.
    This will also install the USB drivers for “USB REDIRECTION” device. By default, this is install in {HOME}/rtk_usb_mp_tool directory
  4. Now you can start the program “rtumdfsample.exe”

    The window size is about 1300 x 900, and cannot be resized, so I allow you to curse or (gently) bang your head on the wall if you run this on a netbook or laptop with 1366×768 resolution or lower. You’ll feel better 🙂
  5. Now insert the USB cable between your computer and the USB 3.0 port of the device, and turn on the box. The display on the box should always show “boot”, and the top logo should change from the yellow fear to a green Android once you device is detected over USB.
  6. Now Click on “Open” button in the Install section of the user interface, to load the firmware file (in my case SEAI_101M0_16G_20170225.img).

    Click to Enlarge

    The top left icon will turn red, and update the firmware.

  7. Once it gets to 100%, you are done. Disconnect the USB cable, and restart the device into your freshly burned firmware.

The goods news is that networking works, I get the weather forecast within the launcher. The bad news is that the display turns off after 5 seconds, until I disconnect and reconnect the HDMI cable, and goes off again 5 seconds. At least the firmware update method worked…

Karl’s Home Automation Project – Part 1: Home Assistant & YAML, MQTT, Sonoff, and Xmas Lights

February 27th, 2017 24 comments

Karl here. I am here to write about my home automation project. First thing I want to say is that I am very cost conscious and I don’t mind putting in extra effort into the setup of things to keep costs down. I did invest a lot of time and had to do a lot of reading to get my project going. It took while and I received a lot of groans from my wife while testing. I am still in the process of tweaking things.

I started watching a series of videos on YouTube from Bruh Automation. He introduced me to Home Assistant. It got me really excited. He uses a Raspberry Pi as a server but I already had a Wintel Pro CX-W8 Smart TV Box which I use as a server. I run 3 Minecraft Servers, Emby Server, iSpyConnect DVR (2 IP Cameras), Unifi wifi controller, and now MQTT Server, and Home Assistant. Below is screenshot of mostly idle.

If it weren’t for iSpy it would be around 5-10% most of the time. Emby transcoding is the only thing that is stressful and it is not used much. The reason I mention this is because after purchasing a Raspberry Pi with power supply and case, you are not far off from getting a z8300 box. Only downfall is dreaded Windows update auto reboot. I finally looked into it and disabled it. If you decide to use a Windows box, I would make sure you are running 64bit windows. One advantage to using a Raspberry Pi is there is an image on Home assistant with the basics pre-configured and just need to write it to an SD card.

Server side Setup

I won’t go into too much detail on server side, as I installed Python, Mosquitto, and Home Assitant (I followed the guide on their site for Windows)

Python was a breeze to install and just ran the executable and went with defaults. I already had it installed for something else and I am running 3.5.2 64-bit. There are newer versions now. Mosquitto was the most difficult. I followed this guide but substituted Win32OpenSSL_Light-1_0_2j.exe approx 2MB. A k version is available now. Home assistant was easy and used pip.

Christmas Lights

It was a little before Christmas when I started researching home automation. I had been reading about these inexpensive Sonoff devices here on CNX and I found a project on Github for some custom firmware by arendst that enabled them to be controlled by MQTT. (While getting the link it looks like a new project has started with some additional features here). My wife really likes decorating for Xmas and we have 3 trees and lots of lights. She mentioned getting some timers and boom I had my opportunity and ordered them the same night. After receiving It took me a couple nights and I had a simple automation turning Xmas lights on and off at specific times and life was good. I got an extra one to play with until Xmas was over. I redeployed the rest  around the house after Xmas.

MQTT

I really had no idea what this was and it took me a while to grasp. You can use a cloud based MQTT if you would like, but I prefer to run my own. MQTT is a service that relays messages between devices. There are 2 main items topics and payloads. To be able to tell a switch to turn on you send payload “on” to a topic, for example, “cmnd/testbench/power”. The light turns on and it replys back to a topic “stat/testbench/POWER” confirming that the light is on and the message is received. Because we are sending “on” to the topic each device using MQTT will need its own topic. Topics are case sensitive. I made a batch file to subscribe to all topics for troubleshooting so I could monitor the messages. The # indicates all sub topics.

Sonoff

I picked the Sonoff basic but there are also different varieties that add additional features which are supported by arendst software.

Arendst  has been very active with this project and adding/tweaking daily. When I first flashed the device, I did find a defect and notified him and he had it fixed and uploaded within the hour. He has very detailed instructions on the Wiki. First step before flashing is soldering headers. (I link to bent headers…which I initially thought I made a mistake but turned out it was good. They are easy to straighten) A USB to TTL adapter is also needed to upload from Arduino IDE. I recommend one like this because it provides both 3.3 and 5V.  After downloading and setting Arduino up, I only set my WiFi password and SSID in the sketch. After it boots the first time, it connects to your wireless network. Find the IP address in your router, and pop the IP address in your browser to finish the configuration. Set the MQTT server credentials and topic and your done. I never setup credentials on the MQTT server so it accepts any login. Finally after everything is programmed you need to connect it to mains. Beware do not connect mains while TTL is connected.  I bought some extension cords locally. Cut them in half and stripped back a ¼ inch of the insulation. Extension cords use stranded wire so I tinned them with solder to avoid any stray strands from shorting out. Then I screwed them down on the terminals making sure polarity was correct.

Click to Enlarge

YAML

YAML is unforgiving. It is the formatting that you configure Home Assistant in. A single space will stop Home Assistant from starting. Luckily on this last update if you restart Home Assistant through the browser it will test the configuration file before actually restarting. I purposefully put an extra space on line 54 to show it is easy to find any mistakes.

Click to Enlarge

I also recommend Notepad++ for editing in windows. You can break your configuration down into different files but I like one. Notepad ++ allows you to collapse the parts you aren’t currently working on.

I recommend adding one thing at a time and restarting to make it easier to find errors. And making a copy of the last working config before adding more. In the config below there are 5 sonoff’s and an automation to turn the lights on and off at specific times. This is extremely basic. I also recommend setting up one new device and be conscious of naming. When you get your config working properly on your first new device I copy the config to a new blank text window and do a find/replace.

Below is the screen capture of collapsed parts, and and full config (minus personal info).

Notice the test bench is on later firmware and the MQTT topic is slightly different

Next Steps

So now I have a smart home, right? Not in my opinion. I can turn lights on and off with a schedule or with my smart phone or at the light by pressing the button on the Sonoff. To me this is not smart. Setting a schedule is OK, but then you have the lights on unnecessarily and wasting electricity. Only real option is to press a button on the Sonoff but what difference is that than flipping a switch. Taking your phone out takes way too long, and I feel like it is going backwards. Below are estimated costs so far. By far the Windows Box will be the most expensive part if you choose to go that way. You can re-purpose just about anything that runs Linux to be a server. One other option is to run Linux on an S905x.

Money Spent

Cost of server not included nor shipping.

Item Qty Price Total
Sonoff Basic 5 $4.85 $24.25
Headers 1 $1.50 $1.50
USB to TTL 1 $2.54 $2.54
Total $28.29

If you find this entertaining or want me to go more in depth on a specific aspect let me know in the comments. I have been finding my time setting it up very satisfying. I am able to do some hardware and software work. I hope this might get your interest in home automation going, and find out it is not hard nor expensive. I would like to state none of the products linked were provided by the sites. I purchased with my own money.

The plan right now is to do a 3 part post. In the next post, we will integrate some inexpensive motion sensors and door sensors using 433mhz, then finally modifying the sensors to include a light intensity sensor.

Embedded Linux Conference & OpenIoT Summit 2017 Schedule

February 4th, 2017 1 comment

The Embedded Linux Conference 2017 and the OpenIoT Summit 2017 will take place earlier than last year, on February  20 – 23, 2017 in Portland, Oregon, USA. This will be the 12th year for ELC, where kernel & system developers, userspace developers, and product vendors meet and collaborate. The schedule has been posted on the Linux Foundation website, and whether you’re going to attend or not, it’s always informative to check out the topics.

So as usual, I’ll make a virtual schedule for all 5 days.

Monday, February 20

For the first day, the selection is easy, as choices are limited, and the official first day it actually on Tuesday. You can either attend a full-day paid training sessions entitled “Building A Low Powered Smart Appliance Workshop“, and the only session that day:

  • 14:30 – 15:20 – Over-the-air (OTA) Software Updates without Downtime or Service Disruption, by Alfred Bratterud, IncludeOS

Millions of consumers are at risk from security vulnerabilities caused by out-of-date software. In theory all devices should update automatically, but in practice, updating is often complicated, time-consuming and requires manual intervention from users. IncludeOS is a unikernel operating system that enables over-the-air (OTA) software updates of connected devices without downtime or service disruption.

The talk starts with a brief introduction to unikernels, their capabilities and how they can be very beneficial for IoT products from security, performance and operational perspectives. Then we give an overview of the IncludeOS Live Update functionality, which we use to demonstrate an atomic update of a device using Mender.io.

Tuesday, February 21

  • 10:30 – 11:20 – Bluetooth 5 is here, by Marcel Holtmann, Open Source Technology Center, Intel

The next version of Bluetooth has been released just a few month ago. This presentation gives an introduction to Bluetooth 5 and its impacts on the ecosystem. It shows new and exciting use cases for low energy devices and IoT with the focus on Linux and Zephyr operating systems.

With Bluetooth 5, the wireless technology continues to evolve to meet the needs of the industry as the global wireless standard for simple and secure connectivity. With 4x range, 2x speed and 8x broadcasting message capacity, the enhancements of Bluetooth 5 focus on increasing the functionality of Bluetooth for the IoT. These features, along with improved interoperability and coexistence with other wireless technologies, continue to advance the IoT experience by enabling simple and effortless interactions across the vast range of connected devices.

  • 11:30 – 12:20 – Embedded Linux Size Reduction Techniques, by Michael Opdenacker, Free Electrons

Are you interested in running Linux in a system with very small RAM and storage resources? Or are you just trying to make the Linux kernel and its filesystem as small as possible, typically to boot faster?

This talk will detail approaches for reducing the size of the kernel, of individual applications and of the whole filesystem. Benchmarks will you show how much you can expect to save with each approach.

  • 14:00 – 14:50 – Moving from IoT to IIoT with Maker Boards, Linux, and Open-Source Software Tools, by Matt Newton, Opto 22

In this session, developers will learn how to use the open-source tools, maker boards, and technology they’re already familiar with to develop applications that have the potential to deliver a massive positive impact on society. There are billions of devices–sensors, I/O, control systems, motors, pumps, drives–siloed behind proprietary control and information systems, waiting to be tapped into. This workshop is geared towards teaching the developer community how to use the tools they’re already familiar with to access, monitor, and manage these assets to create a potentially huge positive impact on our way of life.

  • 15:00 – 15:50 – Debugging Usually Slightly Broken (USB) Devices and Drivers, by Krzysztof Opasiak, Samsung R&D Institute Poland

USB is definitely the most common external interface. Millions of people are using it every day and thousands of them have problems with it. Driver not found, incorrect driver bound, kernel oops are just examples of common problems which we are all facing. How to solve them or at least debug? If you’d like to find out, then this talk is exactly for you!

We will start with a gentle introduction to the USB protocol itself. Then standard Linux host side infrastructure will be discussed. How drivers are chosen? How can we modify matching rules of a particular driver? That’s only couple of questions which will be answered in this part. Final part will be an introduction to USB communication sniffing. Krzysztof will show how to monitor and analyze USB traffic without expensive USB analyzers.

  • 16:20 – 17:10 – SDK in the Browser for Zephyr Project, by Sakari Poussa, Intel

Starting a development for embedded IoT system can be a tedious task, starting with the tools and SDK installations. You also need to have proper operating system, cables and environment variables set up correctly in order to do anything. This can take hours if not days. In this tutorial, we present an alternative, fast and easy way to start IoT development. All you need is your Zephyr board, USB cable and Web Browser. The Zephyr will be running JavaScript Runtime for Zephyr including a “shell” developer mode and Web USB. The Browser has the IDE where you can edit and download code to your board. No compiling, flashing or rebooting is required. During the tutorial, we have few boards available and participants can start developing applications for zephyr in 5 minutes.

  • 17:20 – 18:10 – Fun with Zephyr Project and BBC micro:bit, by Marcel Holtmann, Open Source Technology Center, Intel

This presentation shows how Zephyr empowers the BBC micro:bit devices and its Bluetooth chip to do fun things.

  • 18:15 – 19:00 – Yocto Project & OpenEmbedded BoF, by Sean Hudson, Mentor

Got a comment, question, gripe, praise, or other communication for the Yocto Project and/or OpenEmbedded technical leaders? Or maybe you just want to learn more about these projects and their influence on the world of embedded Linux? Feel free to join us for an informal BoF.

Wednesday, February 22

  • 10:40 – 11:30 – Journey to an Intelligent Industrial IOT Network, by Giuseppe (Pino) de Candia, Midokura

There are 66 million networked cameras capturing terabytes of data. How did factories in Japan improve physical security at the facilities and improve employee productivity? With the use of open systems, open networking, open IOT platforms of course!

Edge Computing reduces possible kilobytes of data collected per second to only a few kilobytes of data transmitted to the public cloud every day. Data is aggregated and analyzed close to sensors so only intelligent results need to be transmitted to the cloud while non-essential data is recycled. The system captures all flow information, current and historical.

Pino will draw from real IIOT use cases and discuss the variety of operations and maintenance tool to support proactive policy-based flow analysis for edge computing or fog nodes enabling IT and OT end to end visibility from a network perspective.

  • 11:40 – 12:30 – SecurityPI: IronClad your Raspberry Pi, by Rabimba Karanjai

Raspberry Pi has garnered huge interest in last few years and is now one of the most popular Linux boards out there sparking all kinds of DIY projects. But most of these function with the default settings and connect to the Internet. How secure is your Pi? How easy is it for someone to take over and make it part of a botnet or sneak peek on your privacy?

In this talk Rabimba Karanjai will show how to harden the security of a Raspberry Pi 3. He will showcase different techniques with code examples along with a toolkit made specifically to do that. This cookbook will harden the device and also provide a way to audit and analyze the behavior of the device constantly. After all, protecting the device finally protects us all, by preventing another dyndns DDOS attack.

  • 14:00 – 14:50 – IoTivity-Constrained: IoT for Tiny Devices, by Kishen Maloor, Intel Corporation

The IoT will be connected by tiny edge devices with resource constraints. The IoTivity-Constrained project is a small-footprint implementation of the Open Connectivity Foundation’s (OCF) IoT standards with a design that caters to resource-constrained environments. It is lightweight, maintainable and quickly customizable to run on any hardware-software deployment.

This talk will present IoTivity-Constrained’s architecture, features, APIs, and its current integration with a few popular real-time operating systems. It will end with a discussion of IoTivity-Constrained’s adaptation for the Zephyr RTOS.

  • 15:00 – 15:50 – RIOT: The Friendly Operating System for the IoT (If Linux Won’t Work, Try RIOT), by Thomas Eichinger, RIOT-OS

This presentation will start with RIOT’s perspective on the IoT, focusing on CPU- and memory-constrained hardware communicating with low-power radios. In this context, similarly to the rest of the Internet, a community-driven, free and open source operating system such as RIOT is key to software evolution, scalability and robustness. After giving an overview to RIOT’s overall architecture and its modular building blocks, the speaker will describe in more detail selected design decisions concerning RIOT’s kernel, hardware abstraction and network stack. Furthermore, the talk will overview the development and organizational processes put in place to help streamline the efforts of RIOT’s heterogeneous community. The presentation will end with an outlook on upcoming features in RIOT’s next releases and longer-term vision.

  • 16:20 – 17:10 – Graphs + Sensors = The Internet of Connected Things, by William Lyon, Neo4j

There is no question that the proliferation of connected devices has increased the volume, velocity, and variety of data available. Deriving value and business insight from this data is an ever evolving challenge for the enterprise. Moving beyond analyzing just discrete data points is when the real value of streaming sensor data begins to emerge. Graph databases allow for working with data in the context of the overall network, not just a stream of values from a sensor. This talk with cover an architecture for working with streaming data and graph databases, use-cases that make sense for graphs and IoT data, and how graphs can enable better real-time decisions from sensor data. Use cases covered will include data from oil and gas pipelines and the transportation industry.

Thursday, February 23

  • 9:00 – 9:50 – Android Things: High Level Introduction, by Anisha Dattatraya & Geeta Krishna, Intel Corporation

An overview of the basic concepts behind Android things and its structure and components is presented. Upon completion of this session, you should have a good overview of how Android Things brings simplicity to IoT software and hardware development by providing a simple and secure deployment and update model. This presentation provides the context needed for the Android Things Tutorial and other deep dive sessions for Android Things.

  • 10:00 – 10:50 – 2017 is the Year of the Linux Video Codec Drivers, by Laurent Pinchart, Ideas on Board

Codecs have long been the poor relation of embedded video devices in the Linux kernel. With the embedded world moving from stateful to stateless codecs, Linux developers were left without any standard solution, forcing vendors and users to resort to proprietary APIs such as OpenMAX.

Despair no more! Very recent additions to V4L2 make it possible to support video codecs with standard Linux kernel APIs. The ChromeOS team has proved that viable solutions exist for codecs without resorting to the proprietary options. This presentation will explain why video codecs took so long to properly support, and how the can be implemented and used with free software and open APIs.

  • 11:10 – 12:00 – Embedded Linux – Then and Now at iRobot, by Patrick Doyle, iRobot

Mr. Doyle will review the history of the use of embedded Linux at a commercial company (iRobot) and discuss the challenges faced (and overcome) then and now. While home routers and WiFi Access Point developers have enjoyed the benefits (and risks) of deploying Linux based products, that has not always been the case for other products. With the advent of low cost cell phone processors and vendor support for Linux, it is now possible to embed a Linux based solution in a consumer retail product such as a vacuum cleaner, minimizing risk and development time in the process.

  • 12:10 – 13:00 – Mainline Linux on AmLogic SoCs, by Neil Armstrong, BayLibre

Inexpensive set-top boxes are everywhere and many of them are powered by AmLogic SoCs. These chips provide 4K H.265/VP9 video decoding and have fully open source Linux kernel and U-boot releases. Unfortunately most of the products based on these devices are running an ancient 3.10 Android kernel. Thankfully AmLogic has put a priority on supporting their chips in the mainline Linux kernel.

Neil will present the challenges and benefits to pushing support for these SoCs upstream, as well as the overall hardware architecture in order to understand the Linux upstreaming decisions and constraints. He will also detail the future development plans aiming to offer a complete experience running an Upstream Linux kernel.

  • 14:30 – 15:20 – OpenWrt/LEDE: When Two become One, by Florian Fainelli, Broadcom Ltd

OpenWrt is a popular Linux distribution and build system primarily targeting the Wi-Fi router/gateway space. The project has been around for more than 12 years, but has recently experienced a schism amongst the developers over various issues.  This resulted in the formation of the LEDE project.  This split has caused confusion among the community and users. This presentation will cover what OpenWrt/LEDE projects are, what problems they are solving in the embedded Linux space, and how they do it differently than the competition. We will specifically focus on key features and strengths: build system, package management, ubus/ubox based user space and web interface (LuCI). We will demonstrate a few typical use cases for the audience. Finally, the conclusion will focus on the anticipated reunification of the two projects into one and what this means for the community and the user base.

  • 15:30 – 16:20 – Unifying Android and Mainline Kernel Graphics Stack, by Gustavo Padovan, Collabora Ltd.

The Android ecosystem has tons of out-of-tree patches and a good part of them are to support Graphics drivers. This happened because the Upstream Kernel didn’t support everything that is needed by Android. However the Mainline Graphics Stack has evolved in the last few years and features like Atomic Modesetting and Explicit Fencing support are making the dream of running Android on top of it possible. In other words, we will have Android and Mainline Kernels sharing the same Graphics stack!

This talk will cover what has been happening both on Android and Mainline Graphics Stacks in order to get Android to use the Upstream Kernel by default, going from what Android have developed to workaround the lack of upstream support to the latest improvements on the Mainline Graphics Stack and how they will fit together.

  • 16:30 – 17:20 – Developing Audio Products with Cortex-M3/NuttX/C++11, by Masayuki Ishikawa, Sony

Sony released audio products with Cortex-M3 in late 2015. Considering development efficiency, code reusability, feature enhancements and training costs, we decided to port POSIX-based open source RTOS named NuttX to ON Semiconductor’s LC823450 by ourselves, modified the NuttX for fast ELF loading, implemented minimum adb (Android debug bridge) protocols for testing purpose, DVFS in autonomous mode with a simple CPU idle calculation, wake_lock and stack trace which are popular in Linux/Android worlds. Middleware and Applications were developed in C++11 with LLVM’s libc++ which are also popular for large software systems. To debug the software, we implemented NuttX support for OpenOCD so that we can debug multi threaded applications with gdb. In addition, we used QEMU with the NuttX to port bluetooth stack and in-house GUI toolkit and finally got them work before we received LC823450 FPGA.


That’s all. I had to make choice, and did not include some sessions I found interested due to scheduling conflicts such as “Comparing Messaging Techniques for the IoT” by Michael E Anderson, The PTR Group, inc, and “Improving the Bootup Speed of AOSP” by Bernhard Rosenkränzer, Linaro.

You’ll need to register and pay an entry fee if you want to attend the Embedded Linux Conference & OpenIoT Summit:

  • Early Registration Fee: US$550 (through January 15, 2017)
  • Standard Registration Fee: US$700 (January 16, 2017 – February 5, 2017)
  • Late Registration Fee: US$850 (February 6, 2017 – Event)
  • Academic Registration Fee: US$175 (Student/Faculty attendees will be required to show a valid student/faculty ID at registration.)
  • Hobbyist Registration Fee: US$175 (only if you are paying for yourself to attend this event and are currently active in the community)

ASUS Tinker Board’s Debian & Kodi Linux Images, Schematics and Documentation

January 24th, 2017 37 comments

We discovered ASUS Tinker Board powered by Rockchip RK3288 processor earlier this year via some slides hidden in a dark corner of the Internet… ASUS has been incredibly quiet about it, but as the board has finally started to sell in Europe on sites like CPC Farnell UK, Proshop (Denmark), or Jimm’s (Finland)  for the equivalent of $57.5 without VAT or $69 including VAT, and more technology sites have started to write about it.

Click to Enlarge

So people have been buying the board, and one even uploaded an unboxing video. One interesting part is the the top comment from the uploader in that video:

Currently, a £55 paperweight as I can’t seem to find a link to the OS image anywhere.

And indeed, ASUS appears to have launched a board without any support website, firmware image and documentation. Maybe that’s why they are quiet about it. But after using some of my voodoo search skills, I finally found firmware images for the board, as well as the schematics, and some other documentations on Asus website. [Update: New official link with the same files as of today (27/01/2017)]

There are currently 10 documents & files for download on the site:

  • Operating System Images – TinkerOS DEBIAN & TinkerOS KODI images
  • Hardware Docs – Tinker Board Schematics (PDF only), 2D & 3D Drawings
  • Software Docs – GPIO API for Python & C,
  • Other documents
    • Qualified Vendors List for devices tested with the board include micro SD cards, USB drives, Bluetooth headsets (A2DP), headphone amplifiers, Bluetooth keyboards & mice, HDMI TVs & monitors, AC adapters, Ethernet dongles, flash disks, and WiFi routers
    • Tinker Board FAQ overview
    • CSI & DSI configuration explaining how to use an external display and/or camera.

Note that there may be a reason why ASUS has not officially published the images yet: they might consider them alpha or beta (TBC).

STMicro SensorTile is a Tiny STM32 Module with Bluetooth 4.1 LE and Four Sensor Chips

December 8th, 2016 1 comment

STMicroelectronics SensorTile is a 13.5 x 13.5mm sensor board based on STM32L4 ARM Cortex-M4 microcontroller, a MEMS accelerometer, gyroscope, magnetometer, pressure sensor, a MEMS microphone, as well as a 2.4Ghz radio chip for Bluetooth 4.1 Low Energy connectivity for wearables, smart home, and IoT projects.

stmicro-sensortile

SensorTile hardware specifications:

  • MCU – STMicro STM32L476 ARM Cortex-M4 microcontroller@ up to 80 MHz with 128 KB RAM, 1MB flash
  • Connectivity – Bluetooth 4.1 Smart/LE via BlueNRG-MS network processor with integrated 2.4GHz radio compliant with
  • Sensors
    • LSM6DSM 3D accelerometer + 3D gyroscope
    • LSM303AGR 3D Magnetometer + 3D accelerometer
    • LPS22HB pressure sensor/barometer
    • MP34DT04 digital MEMS microphone
  • I/Os – 2x 9 half holes with access to UART, SPI, SAI (Serial Audio Interface), I2C, DFSDM, USB, OTG, ADC, and GPIOs signals
  • Debugging – SWD interface (multiplexed with GPIOs)
  • Power Supply Range – 2V to 5.5 V
  • Dimensions – 13.5 x 13.5 mm
SensorTile's Functional Block Diagram - Click to Enlarge

SensorTile’s Functional Block Diagram – Click to Enlarge

Software development can be done through a sets of APIs based on the STM32Cube Hardware Abstraction Layer and middleware components, including the STM32 Open Development Environment. The module is supported by Open Software eXpansion Libraries, namely Open.MEMS, Open.RF, and Open.AUDIO, with various example programs allowing you to get started. Several third-party embedded sensing and voice-processing projects also support the module. The module also comes pre-loaded with BLUEMICROSYSTEM2 firmware, and can be controlled with “ST BlueMS” app found on Apple Store and Google Play.

sensortile-kit

But the best way to get started is with SensorTile kit including SensorTile core module and:

  • STLCR01V1 cradle board with a footprint for SensorTile core board, HTS221 humidity and temperature sensor, a micro-SD card socket, a micro USB port, a lithium-polymer battery (LiPo) charger, and a SWD header.
  • A LiPo rechargeable battery and a plastic case for the cradle board, SensorTile module, and battery
  • STLCX01V1 Arduino UNO R3 compatible cradle expansion board with analog stereo audio output, a micro-USB connector for power and communication, a reset button and a SWD header.
  • A programming cable

I could not find a price for SensorTile core module, but STEVAL-STLKT01V1 SensorTile kit can be purchased for $80.85 directly on STMicro website or their distributors. Visit SensorTile kit’s product page for further information include hardware design files, quick start guide, software and firmware downloads, purchase links, and more.

Himedia Q5 Pro & Q10 Pro TV Boxes Get Android 7.0 Nougat Firmware

November 24th, 2016 10 comments

The majority of TV boxes sold today are running Android 4.4 to Android 6.0, but with the release of Android 7.0 for smartphones and tablets earlier this year, it was just a question of time before the OS got ported to TV boxes. Himedia appears to be the first company to have released Android 7.0 for their Hisilicon Hi3798CV200 based TV boxes, namely Q5 Pro and Q10 Pro.

tv-box-android-7-0The changelog for the new firmware includes:

  1. Android N OS running stable and smooth
  2. Support for Android N Google Play version
  3. Support for Samba UPnP
  4. System function perfectly upgraded from 5.1 to Android N with compatibility
  5. Youtube updated to 4.10.7 and Netflix to 1.3.11
  6. Homepage, Application Management, Media Center optimized, focus movement are more swift and smooth
  7. Media Player upgraded and support mouse operation
  8. Local Media Playback Improved; Certain rare videos black screen, display ratio of 3D to 2D abnormal, and occasional subtitle defect issues fixed
  9. Blu-ray video slow loading conditions improved and speed up
  10. Local Audio output improved and certain audio tracks unable to decode and output issue fixed
  11. Revised some UI language
  12. Support for Widevine L3

I assume most users are running Android 5.1.1 right now, but for those who are using an Android N beta version, a different firmware file is required

The update procedure is basically the same as most others Android TV boxes on the market:

  • Download a new firmware and copy the file update.zip) to the root directory of a USB drive.
  • Plug the USB drive into the TV box
  • Go to Settings→System→System upgrade to select/click the letter of the USB drive.
  • The TV box will then begin upgrading the firmware from the USB drive.
  • Wait for the TV box to complete the upgrade. Please be patient, as it may take around 5 minutes to complete.
  • The TV box will then automatically reboot, and boot to Android N Final

Just bear in mind that changing Android version often leads to some new bugs, even though the company claims “perfect compatibility” and that everything is running “stable and smooth”.

If you are interested in either devices Himedia Q5 Pro is sold for $199.99, and Q10 Pro for $299.99 on sites such as GeekBuying, Aliexpress, and W2comp.

Via AndroidPC.es

How to Create a Bootable Recovery SD Card for Amlogic TV Boxes

November 19th, 2016 22 comments

I reviewed Rikomagic MK22 TV box about two weeks ago, and with the firmware I had, online firmware update was not enabled, and the company only released .IMG firmware for Amlogic USB Burning Tool, a windows only tools that’s not well designed, and requires some procedure that vary slightly from boxes to boxes which in some cases forces to buy a male to male USB cable.

I’ve now started reviewing R-Box Pro TV box also based on Amlogic S912 processor, online firmware update is not working either, and again I only managed to find .IMG firmware for the box on GeekBuying. However, I’ve been informed that “USB Burning Tool” firmware can now be flashed through a micro SD card, or USB flash drive with all recent Amlogic TV boxes, so I’ve tried this method instead of R-Box Pro, and decided to report my experience in this post following some instructions on Freaktab made by user Calc. I’ll show instructions in Linux (which could be further streamlined), and then Windows.

Linux Method

After downloading and extracting the rar’ed firmware file (twice), I ended up with a single img firmware files (aml_s912_q6330-R-BOX-PRO-3gddr-mac-20161015.img).

First we’ll need to have a tool to extract some files from the firmware. Create aml-upgrade-package-extract.c with the code below which I found on Freaktab too and slightly modified it to parse the firmware filename:

Now compile the tool with gcc:

and run the thing on the firmware file:

It will extract a bunch of files:

You’ll just need aml_sdc_burn.ini and aml_sdc_burn.UBOOT, plus the IMG file itself to create a bootable mass storage device.

Now find the device for your micro SD card (formatted with FAT32) with lsblk:

In my case it’s /dev/sdd, but I’ll use /dev/sdX in the instructions below, just change the command with yours.

and finally re-mount the SD card/flash drive, copy the firmware file and aml_sdc_burn.ini to the root of the device, and rename the firmware to aml_upgrade_package.img to match the string in aml_sdc_burn.ini:

Now make sure no other USB devices or SD card are inserted in the TV box, and insert your bootable (micro) SD card or USB flash drive into the TV box. If your TV box is fully bricked, you have nothing to do, and the update should start straightaway, but if it is partially bricked or just working fine, you still need to press the recovery button, apply power, and release the button in order to enter recovery mode. The upgrade should then start automatically as shown below.

micro-sd-card-firmware-update

Patiently wait for the update to complete and you should be all good. Please note that I first tried with a USB flash drive, and the method did not work. Once the update is complete, you’ll see the “Android success” logo.

amlogic-firmware-update-successAt this point, remove the micro SD card, and power cycle the board to complete the final steps of the update, and within one or two minutes you should get the Android launcher. If instead the firmware ends with “Android failure” logo showing a red cross, verify your firmware MD5 (e.g. with md5sum in Linux) to make sure it’s not corrupted. If it is, re-download the file and/or re-copy the file to the micro SD card.

Windows Method

If you are a Windows user it’s much easier as you just need to use Burn_Card_Marker tool (bootcardmaker.exe), which you can download here. The documentation shows the interface as shown below.

burn_card-maker-english

But after starting the program in Windows 7, and changing language with the top menu, second option to English, it stayed in Chinese language and looked like the screenshot below instead.

burn_card_maker_v2-0-2

[Update: After changing the Language to English, select the third option in the top menu to apply the change…amlogic-card-maker-menu

…restart the app, and it will be in English.]

It’s not really a big issue, but you can still select your SD card device (F: drive in my case), load the file, and press “Make” button to start create a bootable recovery (micro) SD card.
amlogic-create-bootable-card

You’ll get a “Success!” pop-up window and the end, and the content of the SD card will show the firmware, and the two aml_sdc_burn files.

burn-card-maker-files

Now you can insert the micro SD card in the TV box, enter recovery menu with the pin hole or other method for your TV box, and firmware update will start automatically.

Good Luck!

Rikomagic MK22 Review – Part 2: Android Firmware, Video & Audio in Kodi, Benchmarks…

November 7th, 2016 4 comments

Rikomagic MK22 is one of the many Android TV boxes powered by Amlogic S912 octa-core processor with typical hardware specifications such as 2GB RAM, 16GB flash, Gigabit Ethernet and dual band WiFi. I’ve already taken the box apart to check out the hardware in the first part of the review, so I’ll focus on the firmware, but I’ll keep it short focusing on typical problem areas, as I’ve already reviewed a bunch of other Amlogic S912 TV boxes such as Qintaix Q912 or Beelink GT1.

Click to Enlarge

Click to Enlarge

First Boot, Firmware Update, and First Impressions

After having connected all usual cables and  accessories include a 1TB USB hard drive, and RF dongles for my air mouse and wireless gamepad, I booted the device, and after around 45 seconds (typically), I got to the main launcher.

Click for Original Size

Click for Original Size

Since I received the device about a month ago, I decided to go to the UPDATE&BACKUP app to see if there was any OTA firmware update, and unfortunately, as you can see from the screenshot below online update was not enabled in the device with the error: “Check Failed! Check Your OTA Servier Argent” (sic).

update-backup-fail

So I went to Rikomagic download page, and I could find a new firmware, the latest USB burning tool, and instructions. It did not go very smoothly, but I still managed to flash the firmware, and I explained the issues I came across in details in the post entitled USB Burning Tool Still Sucks in 2016. Still that was a disappointment to have to go through this, as the vast majority of TV boxes now support OTA firmware update through the network or SD cards, a much more user-friendly way to upgrade the firmware. The company explained that my early sample did not support OTA firmware update, but it should now. I tried again UPDATE&BACKUP, and got the same error, until I found another firmware update app called WirelessUpdate.

Click to Enlarge

Click to Enlarge

It won’t detect a new firmware since I have RKM MK22_161031 firmware released a week ago, but it did seem to properly check the status from the OTA server, telling that was not new update.

I won’t go into much details about the settings, as you can check my other S912 reviews for all options, for example M12N review. HDMI CEC, Playback settings (HDMI Adaptation), and Power key definition were all present in MK22 firmware. I had no troubles with settings Ethernet, WiFi, and the system automatically set my TV to 2160p @ 60 Hz and kept it that way throughout. I did not have the typical HDMI CEC issue turning on my AV receiver against my will. So it appears Rikomagic fixed some of the issues I encountered in early S912 TV boxes.

about-mediabox-rkm-mk22

I could also enter Android Marshmallow settings, and access all usual options. A single unified 11.38GB partition is used for both apps and storage from the 16GB eMMC flash, and the system runs Android 6.0.1 on top of Linux kernel 3.14.29. The firmware is rooted.

The provide remote control worked fine for up to 8 meters, as further away some keys would be missed. I reverted to MINIX NEO A2 Lite air mouse for most of the review because its mouse mode and QWERTY keyboard make it so much easier in most Android apps.

I could also power on and off (long press) the system with the remote, and make it enter standby (short press), with the following power consumption numbers when all accessories, include a USB hard drive, are connected:

  • Power off – 0 Watt
  • Standby – 5.1 Watts
  • Idle – 6.2 Watts

Temperature wise the box top and bottom temperatures reach 44 and 52 °C max after Antutu 6.x benchmark, and after 15 minutes playing Riptide GP2, they rise to about 47°C and 59°C respectively. I could not notice any performance degradation over time in the game, and performance was the same as on other Amlogic S912 TV boxes.

After my initial frustration with having to upgrade the firmware using Windows based Amlogic USB burning tool, the device actually performance well, just like other entry-level Amlogic S912 TV boxes, with the advantage of having several bugs fixed (HDMI CEC bug gone, HDMI video setting constant, …). Google Play also worked with any problems and could install all apps I normally use for reviews.

4K Video & Audio playback in Kodi 16.1, DRM Info

While some Amlogic S912 TV boxes are pre-loaded with Kodi 17.0 (alpha / beta), Rikomagic MK22 comes with the stable version of Kodi 16.1, possibly with some tweaks, as well as pre-installed add-ons.

mk22-kodi-16-1
Again, I’ll be quick in this review, as Amlogic S912 video playback performance is well known.  So I’ve only tested 4K videos, and checked whether automatic frame rate switching and HDMI audio pass-through are working. All videos were playing through the Gigabit Ethernet connection from a SAMBA share, unless otherwise noted (HDD = played from USB hard drive).

4K videos are playing reasonably well, although 2 had some unusual issues:

  • HD.Club-4K-Chimei-inn-60mbps.mp4 (H.264, 30 fps) – OK
  • sintel-2010-4k.mkv (H.264, 24 fps, 4096×1744) –  OK
  • Beauty_3840x2160_120fps_420_8bit_HEVC_MP4.mp4 (H.265) –  OK
  • Bosphorus_3840x2160_120fps_420_8bit_HEVC_MP4.mp4 (H.265) – First time: Video exited early (after 2 to 3 seconds). Second time: OK
  • Jockey_3840x2160_120fps_420_8bit_HEVC_TS.ts (H.265) – OK
  • MHD_2013_2160p_ShowReel_R_9000f_24fps_RMN_QP23_10b.mkv (10-bit HEVC) – OK
  • phfx_4KHD_VP9TestFootage.webm (VP9) – OK
  • BT.2020.20140602.ts (Rec.2020 compliant video; 36 Mbps; 59.97 Hz) – OK
  • big_buck_bunny_4k_H264_30fps.mp4 – Started well, but after 30 seconds or so the image froze with the audio still playing in the background.
  • big_buck_bunny_4k_H264_60fps.mp4 – Not smooth, and audio delay (hardware does not support this type of video)
  • Fifa_WorldCup2014_Uruguay-Colombia_4K-x265.mp4 (4K, H.265, 60 fps) – OK (although video did not seem as sharp as usual)
  • Samsung_UHD_Dubai_10-bit_HEVC_51.4Mbps.ts (10-bit HEVC / MPEG-4 AAC) – OK
  • Astra-11479_V_22000-Canal+ UHD Demo 42.6 Mbps bitrate.ts (10-bit H.265 from DVB-S2 stream) –  OK
  • Ducks Take Off [2160p a 243 Mbps].mkv (4K H.264 @ 29.97 fps; 243 Mbps; no audio) – HDD: Not smooth
  • tara-no9-vp9.webm (4K VP9 YouTube video @ 60 fps, Vorbis audio) – OK
  • The.Curvature.of.Earth.4K.60FPS-YT-UceRgEyfSsc.VP9.3840×2160.OPUS.160K.webm (4K VP9 @ 60 fps + opus audio) – Plays but could be smoother.

Automatic frame rate switching is not working just like on other Amlogic S912 devices, even after setting it in both Kodi and Android (HDMI Adaptation).

HDMI audio passthrough works for 5.1 channel audio, and I could not detect any audio cuts during testing contrary to what happens on some other devices:

  • AC3 / Dolby Digital 5.1 – Audio OK, but video not smooth
  • E-AC-3 / Dolby Digital+ 5.1 – OK
  • Dolby Digital+ 7.1 – PCM 2.0, no audio
  • TrueHD 5.1 – PCM 2.0, no audio
  • TrueHD 7.1 – PCM 2.0, no audio
  • Dolby Atmos 7.1 – PCM 2.0, no audio
  • DTS HD Master – DTS 5.1
  • DTS HD High Resolution – DTS 5.1
  • DTS:X (not supported by Onkyo TX-NR636) – DTS 5.1

So if all you really is Dolby and DTS 5.1, MK22 should be good enough, but TrueHD and DTS HD audio formats are not supported, at least in Kodi.

MK22 support Widevine Level 3 according to DRM Info, which may be useful for some premium video streaming app. This DRM level is only good enough for SD resolution on Widewine “protected” apps, as Level 1 would be required for HD and UHD resolution.

Click to Enlarge

Click to Enlarge

Networking and Storage

In order to evaluate WiFi performance, I copy a 278 MBfile between the internal storage and a SAMBA server using ES File Explorer in both direction. As with many recent boxes, MK22 also experience an asymmetric performance between download and upload, with the latter about twice as slow. On average Rikomagic MK22 achieves 1.6 MB/s throughput using 802.11n, not a very high performance even for 802.11n, but what’s surprising is that all Amlogic S912 TV boxes are very closely tied for 802.1n WiFi performance, so there may be an issue with Amlogic SDK, or some other limitations.

WiFI throughput in MB/s - Click to Enlarge

WiFi throughput in MB/s – Click to Enlarge

Internal performance is also important for fast loading times and overall system performance, and the eMMC used in MK22 has very good performance with 63.65 MB/s read speed, and 20.23 MB/s write speed.

Click to Enlarge

Read and Write Speed in MB/s – Click to Enlarge

That means there should not be visible slowdowns due to I/Os (provided random I/Os are fast too), and indeed during testing I did not experience any slowdowns, and found apps to load rapidly. Somehow boot time could be a bit faster with such performance.

I also tested file systems support and found FAT32, NTFS, and exFAT file systems to be supported by the device.

Rikomagic MK22 System Info and Antutu Benchmark

CPU-Z reports Amlogic S912 clocked at 1.51 GHz, so Kudos to Rikomagic here, as they are the first to report the real CPU frequency of that processor. The board name is q6330, framebuffer resolution is set to 1920 x 1080, and there’s indeed 2GB RAM (1807MB due to hardware buffers), and 11.38 GB storage available to the user.

Click to Enlarge

Click to Enlarge

RKM-MK22 achieved 40,827 points in Antutu 6.x, a score in line with other Amlogic S912 Android TV boxes I’ve tested so far.

rkm-mk22-antutu-score

Conclusion

I found Rikomagic MK22 to be stable and working mostly as expected, with some bugs corrected compared to earlier S912 TV box models under reviews, but with limitations frequently found in entry-level Amlogic S912 TV boxes with lack of support for automatic frame rate switching and HD audio (TrueHD, DTS HD) pass-through in Kodi, as well as DRM limited to Widewine Level 3. WiFi 802.11n is reliable, but performance is a bit weak, although similar to what you get with other Amlogic S912 devices. Storage speed is very good which ensure fast loading times and a responsive system. A big let down was lack of OTA firmware update, as I had to run USB burning tool to upgrade the firmware, but the company told me that from now on OTA firmware will be provided.

Rikomagic MK22 TV box can be purchased on the company’s Aliexpress store for $93.90 including shipping, or quite higher than equivalent competitors products. The Android box is also listed on GearBest, but still shown as “out of stock”.