Design and realization of the minimum object networking system by a creator programmer

Source: Internet
Author: User
Keywords Internet of things nbsp;
Tags addressed ajax based can find client code communication connect
About Internet of things

The Internet of Things (Internet of Things, abbreviated IoT) is an internet-based, traditional telecommunications network, such as information carrier, so that all can be independently addressed common physical objects to achieve interconnection network.

The internet of Things is generally wireless network, since everyone around the equipment can reach 1000 to 5,000, so the Internet may have to contain 500 trillion to 1000 trillion objects, in the Internet of things, everyone can use electronic tags to connect real objects online, can find out their specific location on the Internet of things. Through the Internet can use the central computer to the machine, equipment, personnel centralized management, control, but also the home equipment, cars remote control, as well as search locations, to prevent the theft of goods and other applications.

Simply put, the Internet is a computer-made network, and the IoT is a network of objects (things), but it relies on the internet and is part of the Internet.

Minimum matter Networking system

Because the emphasis is the smallest, bareminimum, which is why I did not change the name of the project above Arduino because it is the smallest, (PS: Everyone knows, if playing hardware). Internet of things, this thing has been very complex, is not very complicated, but from the hardware to the software involved too much, more than a little. Of course there are many programs written in this article, not only this one, but this is the basic smallest, nothing more.

The minimum IoT system we're going to do is actually equivalent to a platform. We can upload information about our various objects and give them properties, and we can control them through the web, and they can control each other. Therefore, we need to provide them with a network, which is the origin of restful. So let's learn a little bit about restful.

RESTful

Rest from the perspective of resources to observe the entire network, distributed throughout the resources are determined by the URI, and the application of the client through the URI to obtain the representation of resources. Obtaining these representations has led these applications to change their state. With the constant acquisition of resources, the client application is constantly changing its state, the so-called Representation State transfer (representational states transmits).

Our world is made up of resources, an object is equivalent to a resource, in this way to build our network of things, at present is a good solution.

The rest architecture is the desire to unify this class of hypermedia Controls, giving them the standard, highly scalable standard semantics and representations that make it possible for even an unmanned worker to intervene in a generic interactive protocol between a machine and a machine.

This is our purpose, the final core of the Internet of Things is to make the interaction between objects and objects possible.

So here's why we're using restful to do this minimal system.

RESTful for

minimum systems For example, a simple example that enumerates all object states:

Get Http://localhost/athome

Renders a particular state,

get http://localhost/athome/1/The rest of the section here is not much to say, more useless, you can Google to go.

And then we're going to talk about the system framework:

System frame diagram for what is Raspberry PI

Raspberry Pi Here only acts as the sending and receiving of data, although we can directly Raspberry Pi as the object of control, but it is easier to remove this from the structure of the system. This allows us to focus our focus on the problem to be solved, that is, data transfer, where each part can be simply stripped out of the system and replaced with something else.

Why is Arduino

The answer to this question is the same as the above, just because some of the internet is from the software, for them to understand the port may be a bit large. Therefore, we simplify the design of the system, but also simplifies the system's code. Because Arduino is simple enough, we can care about the nature of the problem, not how to program it.

Why Ajax

As for what is Ajax,ajax, "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML technology), refers to a set of browser-side web development technologies that integrate a number of technologies.
The goal here is simply to demonstrate how to use the data so that it has the value he deserves, not the technology itself. Of course Ajax is not necessary if all you need is to control the lamp.

Why is Laravel

Just because you're a personal favorite, you can also use Ruby on Rails to build a feature, or Java. It's just that PHP runs pretty well on my server and I don't need to write those configurations again.

At the same time Laravel can simply develop the functionality we need, in other words, the PHP world of Ruby on Rails.

about the project

Source: Https://github.com/gmszone/iot

Home: http://iot.phodal.com/

The document may not be detailed enough, because the rest of it can be Google, and there is no detail here.

Framework: PHP Laraveljquery (Javascript primarily for Ajax) JQuery Mobile (optional) (I think I'm a bit lazy, so I took it from the original project) Bootstrap (optional) (in fact, not much practical use, Just because good-looking and jquery mobile) language:

Processing/c/c++:arduino with Python, if you have Raspberry Pi or similar can be, as long as you can communicate with Arduino serial communication PHP: I did not learn very well, because the laravel did not let me learn, But let me do what I want to do.

Related knowledge of hardware students need to focus on knowledge Restfulajaxjson software students need to understand the knowledge of the communication high and low level of the server Nginx need to configure, the specific configuration can refer to the github above the code LNMP directly with the above will be relatively simple, But there may also be problems. phpMyAdmin better need to have this, if not very proficient in MySQL attention

! Please use my website as little as possible to test

How to start git clone https://github.com/gmszone/iot.git


CP iot/rest path_of_htdocs/

Create a new database, such as IoT, edit app/config/database.php

' MySQL ' => array (


' driver ' => ' MySQL ',


' host ' => ' localhost ',


' database ' => ' IoT ',


' username ' => ' root ',


' password ' => ',


' charset ' => ' UTF8 ',


' collation ' => ' utf8_unicode_ci ',


' prefix ' => ',


),

Configure Nginx, add, detailed reference nginx the configuration below

# include/etc/nginx/includes/enforce_non_www;


if ($host ~* ^www\. *))


{


set $host _without_www $;


rewrite ^/(. *) $ $scheme://$host _without_www/$1 permanent;


}


# Check if file exists


if (!-e $request _filename)


{


rewrite ^/(. *) $/index.php?/$1 last;


break;


}

Test

sudo python python/get.py

Modify the port as needed, depending on the actual port.

IoT System Design Column:

Open Source iot--A minimal object networking system design and source code a minimal object networking system design and source--android client A minimal object networking system design and source code--and server communication minimal object Networking system Design-- Add test to laravel the design of the minimum object networking System---------------------------------------------------------- Design of dashboard frame dashing minimum object Networking System--Add dashboard

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.