What you’ll learn
- How TeaVM translates Java applications to Javascript.
- How to emulate Nvidia’s Jetson.
- Managing containers in embedded applications with MicroK8s.
I often run across interesting projects and products and occasionally dedicate an article to them, but because there are so many, I’m usually unable to do it. So, here are a few collected together that might be of interest. The first is TeaVM, a translator that takes Java byte-code applications and turns them into Javascript applications. Just the thing for developers that need to handle the back end and front end using Java.
The second is an emulator for Nvidia’s Jetson platform. It’s a handy tool for explaining how Nvidia’s AI tools work without needing Nvidia hardware.
Finally, there’s Ubuntu’s MicroK8s project. It simplifies container management under Linux, which is ideal for embedded solutions that can take advantage of containers.
TeaVM
TeaVM converts Java byte code into Javascript, allowing a Java application to run on most browsers and other platforms that support Javascript (Fig. 1). Java never made it on the desktop or browser and Javascript was the winner on the browser, so TeaVM can be very handy for a Java developer.
There are a number of reasons why one might be interested in using Java instead of Javascript directly. One scenario is a platform that utilizes Java on the backend. Java is a major factor in the cloud and servers, so for an application that spans the server and client sides—and what doesn’t these days—it’s possible to use Java source code across the solution.
Another scenario is cross-platform support such as an application that needs to run on Android or other Java clients in addition to via a web browser. Some specific tweaks may be required when supporting a number of platforms, but TeaVM would make managing this much easier since the majority of code would remain in Java and be the same across all platforms.
Java has been used in a number of embedded applications. TeaVM would be a way to bring some of that functionality to a web browser with a native, Javascript implementation.
Nvidia Jetson Emulator
The Nvidia Jetson family encompasses a range of hardware platforms starting with the new, low-cost ($59) Jetson Nano 2GB (Fig. 2). The Jetson Nano is a platform I highly recommend, but it may not always be the best bet even at its low price. In particular, many teachers and developers would like to get their feet wet using CUDA and Nvidia’s massive AI support before purchasing some hardware, especially since some of Jetson Nano’s big brothers may be a more suitable solution even though they have a higher cost.
Tea Huang’s Jetson Emulator is an interesting alternative to first checking out the hardware. It’s an open-source project that runs the same code that would run on the Jetson, allowing teachers to create projects without requiring students to have a Jetson Nano in hand.
As with any emulator, your mileage may vary, but anyone can download and try out the software. It’s not a full system emulation; rather, it emulates the inference and utilities API for image classification, object detection, and image segmentation using imageNet, detectNet, and segNet support. It’s installed as a Python package and comes pre-configured with a simulation of two virtual HDMI displays and four virtual live-cameras.
If you haven’t picked up either of the Jetson Nanos, then check out the emulator.
Ubuntu Containers
Bare-metal programming and running on an RTOS still dominates the microcontroller space. However, higher-end embedded systems often support hypervisors and lots of cores and memory. A tool that fits this higher-end space is the container. Containers provide modularity and isolation similar to what a hypervisor does, but in a more lightweight fashion.
One of the popular container management platforms is the Linux Foundation’s Kubernetes. One of the new tools to automate Kubernetes is MicroK8s. MicroK8s can be used on any platform from embedded solutions to servers in the clouds. Check out the video:
Many may be more familiar with Kubernetes and cloud containers. For example, Google runs billions of containers every week.
Though embedded Kubernetes may not be as ambitious in the number of containers needed for an application, MicroK8s is a great way to set up and manage containers running on a system-on-chip (SoC). Many embedded systems may use a combination of containers and a hypervisor, especially where mixed critical and non-critical code is running on the same SoC.