The Nanite Project
The Nanite developer platform opens the Internet of Things to millions of Java™ and Android™ developers. Nanite provides everything you need to develop Bluetooth 5 devices using the Java language with an embedded virtual machine, class library, powerful debugger, and IDE support based on IntelliJ IDEA.
With Nanite, you don't need to worry about the low-level details that can make embedded development slow and frustrating. Nanite distinguishes itself by providing a development environment for a statically-typed language suitable for industrial applications, a powerful development and debugging environment familiar to any Android developer, and easy-to-integrate libraries for common IoT protocols while maintaining the simplicity and power efficiency of microcontroller-based hardware.
Develop your embedded application quickly using the Java™ programming language and the IntelliJ IDE. Use threads, objects, and automatic memory management to jump-start your low-power embedded design. Rely on IntelliJ to help you browse, complete, and refactor your application as you develop.
Use a powerful debug environment to explore, fix, and iterate your code. Set breakpoints and step just like you'd expect. Inspect values and play "what if" with expression evaluation in the debugger. Code runs on your computer while you're debugging and talks to the embedded hardware over a serial interface so you can work productively without long program-and-test cycles.
Once your application works the way you'd like, press the deploy button to program it onto the hardware. Now you're ready to disconnect from the host computer and watch your application come to life!
Example Application: Nanite IoT Sensor Array
The Nanite IoT Sensor Array is an open source hardware development kit for an intelligent room sensor using Bluetooth 5. It detects presence, light, temperature, door/window position, and orientation/vibration.
The sensor array supports connectionless Bluetooth to enable hundreds of sensors to simultaneously communicate directly to mobile devices or hubs. With Bluetooth 5, range is similar to or better than WiFi. And using the Eddystone profile and library, sensor data is secured with encryption.
With a single library change and the addition of an Apple MFi authentication IC, the device can integrate with Apple's HomeKit network. HomeKit supports connection to mobile iOS devices or to an Apple TV or iPad as a hub for automation and secure remote access over the Internet.
The complete open source Nanite SDK will be available on GitHub.
Sweet B is a library which implements public key elliptic curve cryptography (ECC) using the NIST P-256 and SECG secp256k1 curves. Nanite uses Sweet B to implement Bluetooth LE Secure Connections.
Sweet B is:
- Safe: known attack vectors have been accounted for, design decisions have been documented, and the API has been designed to eliminate the possibility of catastrophic misuse when possible.
- Clear: the library is thoroughly commented and unit tested, and is designed to be easy to read and review.
- Compact: the library is compact in code size, uses a minimal 512-byte working context, and does not assume that keys and other intermediary products can be allocated on the stack.
Free library with example apps included in the Nanite SDK to create Eddystone compliant beacons. The library includes the GATT configuration service along with the following profiles:
- Eddystone-UID: Beacon
- Eddystone-URL: Physical Web
- Eddystone-TLM: Telemetry
- Eddystone-EID: Encryption
Bluetooth LE Mesh: Proposed
Library to create large scale device networks using Bluetooth Low Energy.
Library for the NFC-A radio inside the Nordic Semiconductor nRF52 series ICs.
Library to leverage 802.15.4 PHY radio
Vendor: Wearable Inc.
Apple HomeKit is a set of specifications from Apple that provides a way for your product to easily connect and be controlled by iOS devices. An library is available to Apple licensees who want to drastically reduce the effort required to provide a compliant HomeKit solution. A royalty-free license is available from Wearable.
Library to leverage 802.15.4 PHY radio
LTE Cat-M1/M2: Proposed
Library for upcoming long range LTE Cat-M1 and NB-IoT (Cat-M2) radio IoT silicon
Goals of the Nanite Project
- Provide Android-style development on small, low-power embedded devices that can't run Linux
- Open and free for everyone to use
- Make it as easy as possible to begin developing Internet of Things devices
- Leverage the well known Java™ language and its robust ecosystem
- Support the powerful Kotlin language and typed, functional-style programming on embedded hardware
- Provide a professional-quality IDE while remaining accessible for hobbyists and new programmers
- Support multiple hardware platforms and development boards
- Small and stable OS
- Reliable over-the-air (OTA) updates in the field
- Grow a rich set of libraries for multiple IoT protocols
- Ubuntu Linux (64-bit; 16.04 or later)
- Mac OS X (10.11 or later)
- Windows 10 (will be supported in the near future)
Note: Other Linux distributions will work but instructions are not provided.
- Nordic Semiconductor nRF52840-PDK (Preview DK)
- Custom embedded PCBA containing:
- Nordic Semiconductor nRF52840
- JTAG interface (utilizing SWD pins)
- UART interface (virtual over JTAG or dedicated UART pins)
- Additionally, a Segger J-Link Debug Probe is also required (the nRF52840-PDK may be used for this)
Steps to Install
- Download and install the following to your host computer:
- JetBrains IntelliJ IDEA (free Community Edition): https://www.jetbrains.com/idea/download/
- SEGGER J-Link Software and Documentation Pack: https://www.segger.com/downloads/jlink
- OpenJDK 8
- for Mac OS X: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- for Ubuntu Linux: install the package
sudo apt install openjdk-8-jdk)
- Linux only: Install 32-bit support libraries via
sudo apt install libc6-i386
- Nanite SDK: download the release from https://github.com/naniteproject and unpack it
sudo usermod -G dialout -a $USER, then log out and log in again.
intellijdirectory. Restart IntelliJ when prompted.
Running the Sample Project
- From the Welcome screen, choose Open, then navigate to the unpacked Nanite Project SDK directory, choose "examples", choose an example, and then choose the
.imlfile in the example.
- Choose File → Project Structure and make sure a Java 1.8 SDK is selected for the Project SDK.
- Plug in the USB cable between host and target hardware. For custom target hardware this would require connecting the host to the Segger J-Link Debug Probe which connects to the embedded PCBA and possibly connecting a separate UART interface (make sure the custom target board is properly powered).
- Choose Run → Edit Configurations... and make sure the correct Nordic hardware is selected and the hardware type is selected for the hardware, then click OK.
- Choose Run → Run with Bridge. The attached Nordic development board will be flashed with the bridge and the example will be run. Do not disconnect the hardware while it is running. You can connect to the sample using the nRF Toolbox.
- Choose the Stop button in the Nanite tool window, then choose Run → Debug with Bridge. The attached Nordic board will be flashed and the example will be run with the debugger.
Nanite Platform Target Stack
This is the stack that runs your application when deployed on the target hardware.
Nanite Platform Stack
Nanite Platform Stack For Debugging
One of the major benefits of the Nanite Platform is the ability to run your debugging environment on a host computer while exercising the actual target hardware. This works by utilizing the Nanite Bridge to run your application using the OpenJDK virtual machine while still allowing full access to the peripherals and Bluetooth hardware on the target hardware. In this configuration, Nanite provides the best of both worlds: simple deployment to your hardware, and a powerful and well-tested debugging environment that allows you to test all your embedded code without changes.
Nanite Platform Debug Stack Utilizing the Nanite Bridge
One of the major benefits of the Nanite Platform is the ability to run your debugging environment on a host computer while exercising the actual target hardware. This is accomplished by utilizing the Nanite Bridge that splits the layer stack across the host and embedded target
The Nanite Platform consists of a host development environment and embedded target hardware. The host development environment consists of an integrated development environment (IDE) and Java™ virtual machine running on either a Linux, Mac OS X, or Windows computer. The host connects to the embedded target environment through a JTAG interface and/or UART (serial port). The JTAG connection is used to program the Nanite Bridge and the Nanite JVM into the target's flash memory.
When the Nanite debugger is running, the OpenJDK JVM on the host communicates over a serial interface to the Nanite Bridge on the target, through which it can access all of the hardware on the target.
After the program has been debugged, the Nanite Virtual Machine can be used to run the Nanite bytecode on the host using the Nanite Bridge. This configuration serves as a sanity check to ensure that the program is compatible with the Nanite Virtual Machine.
When the program is deployed, the Nanite Virtual Machine executes the bytecode on the target directly, and the serial interface is used for console output.
The Nordic Semiconductor development kits provide the simplest possible configuration. On these boards, the J-Link OB chipset provides both JTAG and serial access to the target via a single USB connection.
Hardware Configuration 1
Hardware configuration using the Nordic Semiconductor evaluation boards as the hardware target.
Hardware Configuration 2
The Nordic Semiconductor evaluation boards contain a Segger J-Link JTAG unit for debugging custom hardware. Verify your configuration when downloading code to make sure your are communicating with the custom hardware and not the on-board Nordic Semiconductor IC.
Hardware Configuration 3
A future configuration is planned to help simplify professional development by eliminating the UART connector.
- Development environment for Linux and Mac OS X
- Java language debugger
- Nanite JVM and runtime libraries
- Support for Nordic Semiconductor nRF52840
- Support for Nordic Semiconductor BLE stack
- Eddystone library
First Update (planned)
- Windows host environment
- Support for additional embedded peripherals on Nordic Semiconductor part
- nRF52832 integration
Second Update (tentative)
- Kotlin language
- Secure OTA updates
- Semi-hosted Nanite Bridge (eliminates separate UART connection)
These items are on our radar, but not scheduled for a specific release. If you want to help out, let us know!
- NFC support
- Thread stack
- ZigBee stack
- ANT stack
- Open source BLE stack
- Support for additional vendor silicon
- BLE mesh
A discussion forum for Nanite will be provided to enable the community to collaborate.
For now, you can find us on Twitter at @naniteproject
Nanite builds on the history and hard work of many open source projects, without which our project would not be possible:
- Nanite builds on the virtual machine and linker from leJOS NXJ project.
- The Nanite class library is based on OpenJDK.
- The Nanite development environment is based on IntelliJ IDEA.
- Nanite would not be possible without the hard work of the GNU project, especially ARM's distribution of GCC.
- Chip support and the Bluetooth stack for the nRF52 series of chips is provided by the nRF5 SDK from by Nordic Semiconductor.
What is Nanite?
Nanite is an Android-like development system for small, ARM Cortex-M class embedded products. A "Nanite" is a small robot. Nanite provides:
- Professional tools for fast and easy implementation and maintenance of IoT products.
- A complete embedded OS.
- The first easy-to-use development system for Bluetooth 5 (also compatible with earlier Bluetooth versions).
Nanite is a complete development and deployment system for IoT products. Our initial focus is Bluetooth 5, but we plan to extend the platform to 802.15.4 and other protocols in the future.
Nanite was created to enable Android-style development for embedded systems that do not require Linux. This provides several benefits:
- Lower cost devices. Sophisticated IoT devices can be developed with ARM Cortex-M class devices with limited memory resources.
- Rapid development. Nanite leverages advanced tools that help you write code faster with autocomplete frameworks. While memory usage always needs to be kept in mind, garbage collection helps reduce memory leaks that lead to longer debugging. The Kotlin programming language can also be used to reduce coding errors with typed, functional-style programming. Libraries are also available for code re-use.
- Android developers can now be embedded programmers. As the same tools are used for Nanite embedded development as Android app development, Android app developers can now create low cost, low power embedded devices.
- Stable tools. Nanite enables sophisticated and straightforward development without the complexities of deploying, managing, and maintaining a Linux-based operating system.
- Better security with less complexity. By not using Linux, the attack surface of the operating system is reduced.
Why is the initial focus on Bluetooth 5?
Bluetooth 5 is a major step forward for the IoT industry. Ratified in December 2016 with the mesh protocol approved in the summer of 2017, Bluetooth 5 (with the appropriate optional features) solves several important problems that we see in the IoT industry:
- The increased range matches or exceeds that of WiFi (using either the optional long range coded PHY).
- Extended connectionless data communications allows hundreds of smart beacons to be deployed in a given area.
- Bluetooth is widely adopted in smartphones and its simple connection and security model is well understood by end users. Bluetooth 5 is already being integrated into the latest smartphones like the Galaxy S8, making initial setup a breeze without requiring separate bridge hardware.
- Bluetooth can be much simpler for an end-user to setup than WiFi pairing.
Additionally, Bluetooth 5 has a high speed option to increased speeds to 2 Msps (actual throughput will be around 1.2 Mbps).
What hardware does Nanite initially support?
Nanite initially supports the Nordic Semiconductor nRF52832 and the Nordic Semiconductor nRF52840. Both the nRF52832 and the nRF52840 are Bluetooth 5 compliant with the nRF52840 including the optional long range coded PHY. They both have enough RAM, flash memory and CPU power with its Cortex-M4 to support real applications built using demanding protocols like Apple HomeKit, while remaining power-efficient enough to support beacon applications. The nRF52840 also supports 802.15.4, which would allow a future version of Nanite to support protocols like Thread and ZigBee without any hardware changes.
When will Nanite be available?
Nanite is currently undergoing closed alpha testing with our partners. When we're confident that we've provided the easy-to-use development experience we're aiming for, we'll announce an initial beta release with full source code. If you're developing (or would like assistance in developing) a volume application that could benefit from Nanite, please get in touch. Otherwise, follow us on Twitter at @naniteproject to be the first to know about our releases.