On July 15, 2017, Zheng Ye, Ruff CTO, delivered a speech titled “How to Quickly develop Hardware products with Ruff OS Internet of Things Operating System” at the 2017 JavaScript China Developers Conference. IT big said as the exclusive video partner, by the organizers and speakers review authorized release.

Read the word count: 1672 | 4 minutes to read

Video address: t.cn/RWtmcIp

Abstract

Ruff is for those who understand JS but do not understand embedded development, and hope to achieve their own creative design as quickly as possible.

Ruff introduction

Ruff is an Internet of Things operating system that supports JavaScript to develop applications. It is designed for application developers to make IoT application development easier.

Here is a Demo: t.cn/RWtmcIp

Develop efficiently, not execute efficiently

As we all know, from a developer’s perspective, our time is worth more than the machine’s time. Today we listened to a day of front-end discussion, is to optimize the development efficiency. When optimizing from the hardware side, our focus is also on improving development efficiency. Therefore, in THE design of Ruff, development efficiency is our core design direction.

IoT Application Platform

When designing the IoT application platform, our focus is to be able to do development with modern design languages, to have an application-oriented abstraction, to provide production support.

Modern programming languages

Our programming language of choice is JavaScript.

Memory management may be a common thing for people who do JS, but it is a constant pain point for C and C++ programmers.

Application development process needs to provide a good testing framework to complete the relevant work. C and C++ programmers can find testing a pain, especially since the C and C++ compilation models don’t support testing particularly well.

C and C++ programmers don’t have a good package management library, and they have to recompile every library they get.

These are just a few of the dimensions we consider when choosing a modern programming language, and JavaScript is friendly in all of them.

JavaScript also has some features, such as support for multiple paradigms of programming models, functional programming and object-oriented programming.

Select the language

In terms of popularity, Java is a good choice. Despite its decline, Android is still the number one in the industry and uses Java as its application development language. But in the world of hardware development, Java virtual machines are too large and memory constrained.

Then there are programming languages like Lua and Ruby, which are great for people who love them, but not popular enough from a community perspective.

In my previous joke, you can see how much I’m not optimistic about C.

By contrast, you can only choose JavaScript.

Application-oriented abstraction

$('# light '). TurnOn ();Copy the code

The traditional way

GPIO.output(11,GPIO.HIGH)Copy the code

Application of the abstract

led.turnOn( );Copy the code

The level of abstraction



The application-oriented abstraction that an IoT development platform can achieve can isolate the hardware driver from the software interface. As long as the application developer makes sure that the software interface is called correctly, the hardware driver developer can ensure that the driver is written correctly. In this way, the application developer only needs to ensure that the application logic is correct.

Provide production support

Device treasure Ruff PI

We created an app called Ruff PI, which is called Device Bao in Chinese. It is a factory productivity assistant application product developed by Shanghai Hainan Chao Information Technology Co., Ltd. using its Internet of Things operating system. It aims to improve factory production efficiency and factory production management through informatization and Internet of things technology, so that traditional factories can quickly connect to the Internet and realize digital transformation. Ruff PI can monitor some equipment in the industrial field and provide some event notification to help us deal with problems quickly.

Ruff Industrial field

Ruff helps to collect power data, digitize plant equipment, and monitor power in the photovoltaic sector.

Ruff low power domain

I mentioned not using Java for Ruff because it takes up too much memory and we need to run on 256K or less, which is the norm in IoT development. Ruff is moving towards a lower resource footprint.

Ruff is also API compatible and already supports TI TM4C1294 and ESP32 chips. From the whole system design, Ruff is an open system, we will transplant different chips according to the needs of different projects. Code written on Ruff can also be ported smoothly to the chip.

Production perspective

From the perspective of production, we make a distinction.



There may be a different layout for each piece of hardware, which allows the code to be seamlessly portable across different development boards. In Ruff’s overall architecture, the code is portable.

Ruff-based hardware applications released



With platforms like Ruff, future development will look like the structure on the right. This means hardware is the release cycle of hardware, platform is the release cycle of platform, and application is the release cycle of application. This model does not work well in the IoT space because there is no platform to differentiate them well. What Ruff does is separate applications from the underlying hardware through a platform, enabling a new distribution model. This eliminates the possibility that a lot of application development is actually held hostage by hardware development.

Ruff 2.0

We’re going to take what we’re doing in the industry and turn it into the ability to deliver to the community in the future.

We will provide more system objects to provide system access capabilities. Provide capability descriptions. applications depend on capability, not hardware. In the future, there will be boards that can expand their abilities and expose different abilities.

This is what we will be doing in Ruff 2.0 in the future.

That’s all for today. Thank you for listening!