Open source iot--A minimal IoT system design solution and source code

Source: Internet
Author: User
Tags git clone ruby on rails

Perhaps this can be thought of as your graduation project or you can use it to control what you want to control, in short you can use it to make a minimal IoT system.

However, there may not be such a complex feature here, because the emphasis is minimal. Bareminimum, that's why I didn't change the name of the project on Arduino because it's the smallest, (PS: Everyone knows, if playing hardware). The Internet of things, this thing has been very complex, is not very complex, but from hardware to software involves too much, more than a little. Of course, the plan written in this article also has a lot, not only this one, but this is basically the smallest, only this. (Reprinted reserve Phodal ' s Blog Phodal's Zenthink)


about the

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

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

The documentation may not be detailed enough, as the rest of the section can be reached by Google, which is not detailed here. Frame:

PHP Laravel jquery (Javascript is used primarily for Ajax) jquery Mobile (optional) (I think I'm a little lazy, so I took it out of the original project) Bootstrap (optional) (actually not much practical use, Just because it looks like jquery mobile)

Language:

Processing/c/c++ for Arduino

Python If you have Raspberry Pi or close to it, as long as you can communicate with the Arduino serial port

PHP I did not learn very well, because Laravel did not let me learn, but let me do what I want to do. related articles a minimal IoT system design and source least IoT system (i)-System composition minimal IoT system (ii)--restful minimum Internet of Things System (iii)--Create RESTful
Minimal IoT System (iv)--detailed Laravel's restful
Minimal IoT system (v)--laravel restful templating
Minimal IoT system (vi)--ajax to create visualizations
Minimal IoT System (vii)--Communication with server
Minimal IoT System (eight)--minimal IoT system with single chip microcomputer (ix)--android client- related knowledge the students in hardware need to focus on knowledge

RESTful Ajax JSON

students who engage in software need important knowledge

Serial communication high and low level

about Servers

Nginx needs to be configured, the specific configuration can refer to GitHub above the code LNMP directly with the above will be relatively simple, but may also encounter some problems. Phpmyadmin best need to have this if not very proficient MySQL note

。 Please do as little as I can with my website to do the test


Design Solutions System frame Diagram


how to get started

git clone https://github.com/gmszone/iot.git
CP iot/rest path_of_htdocs/


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

' MySQL ' = array (
' driver ' = ' mysql ',
' host ' = ' localhost ',
' database ' = ' IoT ',
' Username ' + ' root ',
' password ' + ' ', '
charset ' = ' utf8 ',
' collation ' and ' utf8_unicode_ci ', c7/> ' prefix ' = ', ',


Configuration Nginx, add, detailed can refer to the configuration below Nginx

# 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 and modify it depending on the actual port.

about IoT (Internet of Things, abbreviated IoT) is an Internet-based, traditional telecommunications network, and other information-bearing carriers that enable all common physical objects that can be individually addressed to interconnect.
The internet of things is generally a wireless network, because each person around the device can reach 1000 to 5,000, so the internet of things may contain 500 trillion to 1000 trillion objects, on the internet of things, everyone can apply electronic tags to connect real objects online, on the IoT can find their specific location. Through the Internet of things, computers, equipment and people can be centrally managed and controlled by the IoT, which can also be used for remote control of home devices, cars, and for searching locations and preventing items from being stolen.
In simple terms,

The Internet is a computer-based network, so the IoT is a network of objects (things), but it relies on the internet and is part of the Internet.

Minimal IoT system This is what we're going to talk about, and the smallest IoT system we have to do is actually the equivalent of a platform. We can upload information about our various objects and give them some properties, and we can control these objects through the network, and they can control each other. Therefore, we need to provide them with a network, which is the origin of the restful.

So let's get to know a little bit about restful.
RESTful REST observes the entire network from the perspective of resources, and the resources distributed around it are determined by URIs, and the client's application obtains the characterization of the resources through URIs. Obtaining these representations causes these applications to transform their state. With the constant acquisition of the characterization of resources, client applications are constantly transforming their state, so-called representational state transitions (representational-Transfer).

Our world is made up of resources, and an object is the equivalent of a resource to build our IoT system in this way, which is a great solution for now.
The rest architecture is the desire to unify this type of hypermedia Controls, giving them the standard, highly extensible standard semantics and manifestations that make it possible for even unmanned machine-to-machine interaction between machines and machines.
This is our goal, and the final core of the Internet of Things is to make the interaction between objects and objects possible.
Well, here's why we have to use restful to do this minimal system.
restful in the smallest system for example, a simple example,
List all object states,

    GET Http://localhost/athome

Renders a specific state,

    GET http://localhost/athome/1/

The rest of the section here is not much to say, more useless, you can own Google to go.
And then what we're going to talk about is the system framework

System Framework

Why is Raspberry PIRaspberry Pi here just serves as the sending and receiving of data, although we can directly use the Raspberry pi as the object of control, but it is easier to remove this from the system structure. Thus, we can focus our core attention on the problem to be solved, that is, data transmission, each part can be simply stripped out of the system and replaced with something else.

why Arduino?The answer to this question is the same as above, just because some of the internet of Things is coming from the software, for them to understand the port is probably a bit large. Therefore, we simplify the system design, but also to simplify the system 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 techniques that combine a number of technologies.
The goal here is simply to demonstrate how to use the data to make it worth what he deserves, not the technology itself. Of course Ajax is not required, if all you need is to control this lamp.

why Laravel?Just because you love it, you can use Ruby on Rails to build such a feature, or Java. Just PHP works pretty well on my server, and I don't need to write the configuration again.

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


Discussion Space

QQ Group: 348100589

Bbs:http://bbs.phodal.com

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.