• Guest
HabraHabr
  • Main
  • Users

  • Development
    • Programming
    • Information Security
    • Website development
    • JavaScript
    • Game development
    • Open source
    • Developed for Android
    • Machine learning
    • Abnormal programming
    • Java
    • Python
    • Development of mobile applications
    • Analysis and design of systems
    • .NET
    • Mathematics
    • Algorithms
    • C#
    • System Programming
    • C++
    • C
    • Go
    • PHP
    • Reverse engineering
    • Assembler
    • Development under Linux
    • Big Data
    • Rust
    • Cryptography
    • Entertaining problems
    • Testing of IT systems
    • Testing Web Services
    • HTML
    • Programming microcontrollers
    • API
    • High performance
    • Developed for iOS
    • CSS
    • Industrial Programming
    • Development under Windows
    • Image processing
    • Compilers
    • FPGA
    • Professional literature
    • OpenStreetMap
    • Google Chrome
    • Data Mining
    • PostgreSQL
    • Development of robotics
    • Visualization of data
    • Angular
    • ReactJS
    • Search technologies
    • Debugging
    • Test mobile applications
    • Browsers
    • Designing and refactoring
    • IT Standards
    • Solidity
    • Node.JS
    • Git
    • LaTeX
    • SQL
    • Haskell
    • Unreal Engine
    • Unity3D
    • Development for the Internet of things
    • Functional Programming
    • Amazon Web Services
    • Google Cloud Platform
    • Development under AR and VR
    • Assembly systems
    • Version control systems
    • Kotlin
    • R
    • CAD/CAM
    • Customer Optimization
    • Development of communication systems
    • Microsoft Azure
    • Perfect code
    • Atlassian
    • Visual Studio
    • NoSQL
    • Yii
    • Mono и Moonlight
    • Parallel Programming
    • Asterisk
    • Yandex API
    • WordPress
    • Sports programming
    • Lua
    • Microsoft SQL Server
    • Payment systems
    • TypeScript
    • Scala
    • Google API
    • Development of data transmission systems
    • XML
    • Regular expressions
    • Development under Tizen
    • Swift
    • MySQL
    • Geoinformation services
    • Global Positioning Systems
    • Qt
    • Dart
    • Django
    • Development for Office 365
    • Erlang/OTP
    • GPGPU
    • Eclipse
    • Maps API
    • Testing games
    • Browser Extensions
    • 1C-Bitrix
    • Development under e-commerce
    • Xamarin
    • Xcode
    • Development under Windows Phone
    • Semantics
    • CMS
    • VueJS
    • GitHub
    • Open data
    • Sphinx
    • Ruby on Rails
    • Ruby
    • Symfony
    • Drupal
    • Messaging Systems
    • CTF
    • SaaS / S+S
    • SharePoint
    • jQuery
    • Puppet
    • Firefox
    • Elm
    • MODX
    • Billing systems
    • Graphical shells
    • Kodobred
    • MongoDB
    • SCADA
    • Hadoop
    • Gradle
    • Clojure
    • F#
    • CoffeeScript
    • Matlab
    • Phalcon
    • Development under Sailfish OS
    • Magento
    • Elixir/Phoenix
    • Microsoft Edge
    • Layout of letters
    • Development for OS X
    • Forth
    • Smalltalk
    • Julia
    • Laravel
    • WebGL
    • Meteor.JS
    • Firebird/Interbase
    • SQLite
    • D
    • Mesh-networks
    • I2P
    • Derby.js
    • Emacs
    • Development under Bada
    • Mercurial
    • UML Design
    • Objective C
    • Fortran
    • Cocoa
    • Cobol
    • Apache Flex
    • Action Script
    • Joomla
    • IIS
    • Twitter API
    • Vkontakte API
    • Facebook API
    • Microsoft Access
    • PDF
    • Prolog
    • GTK+
    • LabVIEW
    • Brainfuck
    • Cubrid
    • Canvas
    • Doctrine ORM
    • Google App Engine
    • Twisted
    • XSLT
    • TDD
    • Small Basic
    • Kohana
    • Development for Java ME
    • LiveStreet
    • MooTools
    • Adobe Flash
    • GreaseMonkey
    • INFOLUST
    • Groovy & Grails
    • Lisp
    • Delphi
    • Zend Framework
    • ExtJS / Sencha Library
    • Internet Explorer
    • CodeIgniter
    • Silverlight
    • Google Web Toolkit
    • CakePHP
    • Safari
    • Opera
    • Microformats
    • Ajax
    • VIM
  • Administration
    • System administration
    • IT Infrastructure
    • *nix
    • Network technologies
    • DevOps
    • Server Administration
    • Cloud computing
    • Configuring Linux
    • Wireless technologies
    • Virtualization
    • Hosting
    • Data storage
    • Decentralized networks
    • Database Administration
    • Data Warehousing
    • Communication standards
    • PowerShell
    • Backup
    • Cisco
    • Nginx
    • Antivirus protection
    • DNS
    • Server Optimization
    • Data recovery
    • Apache
    • Spam and antispam
    • Data Compression
    • SAN
    • IPv6
    • Fidonet
    • IPTV
    • Shells
    • Administering domain names
  • Design
    • Interfaces
    • Web design
    • Working with sound
    • Usability
    • Graphic design
    • Design Games
    • Mobile App Design
    • Working with 3D-graphics
    • Typography
    • Working with video
    • Work with vector graphics
    • Accessibility
    • Prototyping
    • CGI (graphics)
    • Computer Animation
    • Working with icons
  • Control
    • Careers in the IT industry
    • Project management
    • Development Management
    • Personnel Management
    • Product Management
    • Start-up development
    • Managing the community
    • Service Desk
    • GTD
    • IT Terminology
    • Agile
    • Business Models
    • Legislation and IT-business
    • Sales management
    • CRM-systems
    • Product localization
    • ECM / EDS
    • Freelance
    • Venture investments
    • ERP-systems
    • Help Desk Software
    • Media management
    • Patenting
    • E-commerce management
    • Creative Commons
  • Marketing
    • Conferences
    • Promotion of games
    • Internet Marketing
    • Search Engine Optimization
    • Web Analytics
    • Monetize Web services
    • Content marketing
    • Monetization of IT systems
    • Monetize mobile apps
    • Mobile App Analytics
    • Growth Hacking
    • Branding
    • Monetize Games
    • Display ads
    • Contextual advertising
    • Increase Conversion Rate
  • Sundry
    • Reading room
    • Educational process in IT
    • Research and forecasts in IT
    • Finance in IT
    • Hakatonas
    • IT emigration
    • Education abroad
    • Lumber room
    • I'm on my way

Just about “smart home”: how to make “smart” backlight

Coming home, it was always inconvenient: you open the door, and then it's dark, then there was an idea to make the backlight in the hallway, but not easy, and what could be turned on from the phone before coming home. Well said - it means you have to start.
 3r33320.
 3r33320. As further extensions of this system are planned (or not), it was decided to take a single-board computer as a basis. With a flick of the mouse on Ali, the cheapest <
was picked up.  3r33320.
 3r33320. spoiler title = "orange pi zero 256mb">
 3r33320. 3r314. orange pi zero 256mb
.
 3r33320. 3r318.
 3r33320. armbian or any other Linux, but I chose this one. I recommend writing an image using 3r375. etcher. 3r33333. 3r3122.  3r33320. 3r395. Next, through apt-get install java in 3 teams:
 3r33320.
 3r33320.
3r3118. #sudo add-apt-repository ppa: webupd8team /java
#sudo apt-get update
#sudo apt-get install oracle-java8-installer

3r3122.  3r33320. 3r395. Using the gita, add the set wiringPi for our board (it contains various libraries for working with gpio and all sorts of tools for the same) 3r33310.  3r33320. Also not difficult:
 3r33320.
 3r33320.
3r3118. #git clone https://github.com/vladikoms/WiringOP-Zero.git
#cd WiringOP-Zero
#chmod + x ./build
#sudo ./build
 3r33320. Well, check:
 3r33320.
 3r33320.
3r3118. #gpio -v
#gpio readall
3r3122.  3r33320. 3r3124.
 3r33320. On this part with the board finished, go to the computer and your favorite ide.
 3r33320.
 3r33320. We will deploy the server in spring, so go to their site or in ide we create a spring project with a hail.
 3r33320.
 3r33320. Just about “smart home”: how to make “smart” backlight
 3r33320.
 3r33320. To work with gpio, you need to install the 3r3r2142 library. pi4j
, for this you need to add repository and dependency
 3r33320.
 3r33320. And then the final script should look something like this:
 3r33320.
 3r33320.
build.gradle [/b]
buildscript {
ext {
springBootVersion = '???.RELEASE'
}
repositories {
mavenCentral ()
}
3r33320. dependencies {
classpath ("org.springframework.boot: spring-boot-gradle-plugin: $ {springBootVersion}")
}
}
3r33320. apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
3r33320. group = 'com.lary.sh'
version = '???-SNAPSHOT'
sourceCompatibility = ???r3r3320. 3r33320. jar {3r33320. baseName = 'SH'
version = '???-SNAPSHOT'
}
repositories {
mavenCentral ()
maven {
3r33320. url "https://oss.sonatype.org/content/groups/public" //here is the
repository.}
}
3r33320. dependencies {
implementation ('org.springframework.boot: spring-boot-starter-data-rest')
implementation ('org.springframework.boot: spring-boot-starter-web')
runtimeOnly ('org.springframework.boot: spring-boot-devtools')
testImplementation ('org.springframework.boot: spring-boot-starter-test')
compile 'com.pi4j: pi4j-core: 1.2-SNAPSHOT' //but the dependence
}

 3r33320.
 3r33320. Excellent go to the class managing gpio:
 3r33320.
 3r33320.
Gpio.java [/b]
public class MyGpio {
private GpioController gpio; 3r33320. private GpioPinDigitalOutput myLed; 3r33320. 3r33320. public gpio () {
3r33320. try {//with errors, not really so far, only the prototype of the same (probably) 3r-3320 steam up. PlatformManager.setPlatform (Platform.ORANGEPI); //indicate that we are working with OrangePI
} catch (PlatformAlreadyAssignedException e) {
e.printStackTrace (); 3r33320.}
3r33320. gpio = GpioFactory.getInstance (); 3r33320. myLed = gpio.provisionDigitalOutputPin (OrangePiPin.GPIO_08); //initialize 8 pin as exit
//that is, we will manage its voltage
}
3r33320. public void light () {//method responsible for the
glow. if (myLed.isHigh ()) myLed.low (); //if on the selected pin a high voltage to make it equal to the voltage on the earth 3r-3320. else myLed.high (); //otherwise, apply a high voltage to the selected pin (8)
}
public void blink () {//well, and so blink for the mind 3r-3320. for (int i = 0; i 3-3r3239. try {
light ();
Thread.sleep (500);
}
catch (Exception e) {3rrr204. e .}
}
}

 3r33320.
 3r33320. The presented code is quite simple and does not imply good management of the board pins, but opens the door to this.
 3r33320.
 3r33320. Well, the final stage of the creation of the controller in the spring
 3r33320.
 3r33320.
GpioController.java [/b]
@Controller
public class GpioController {
3r33320. @RequestMapping ("/blink")
@ResponseBody
public String blink (HttpServletResponse response, HttpServletRequest request)
{
Gpio gpio = new Gpio (); 3r33320. gpio.blink (); 3r33320. return "blink"; 3r33320.}
3r33320. @RequestMapping ("/light")
@ResponseBody
public void light () {
Gpio gpio = new Gpio (); 3r33320. gpio.light (); 3r33320.}
}

 3r33320.
 3r33320. Now a couple of recent gestures in the form of creating a jar file using gradle. After that, the transfer via sftp to the board (in many ideas, you can configure the deployment directly) and run the jar on the device. Next we go to the cherished browser ???. ***: 8080 /light
 3r33320. and enjoy, simultaneously hoping that it will help keep our fingers at night or turn on the light, before coming home.
 3r33320.
 3r33320. In the next part (if ever I get to it) I will definitely show different ways of interacting with our “smart” home.
 3r33320.
 3r33320. 3r3308. here's the source code
 3r33320. 3r33312. And here work with a comb (gpio) 3r3333313.
3r33320. 3r33320. 3r33320. 3r33333. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r33333. 3r33320.

It may be interesting

  • Comments
  • About article
  • Similar news
This publication has no comments.

weber

Author

25-11-2018, 01:23

Publication Date

Development / JavaScript

Category
  • Comments: 0
  • Views: 261
.Net Binary serialization without
How to make money on the app during the
Problems of access to personal data on
Testing an application on Go as a black
How to develop integration tests for
FadeObjects - Hide the objects between
Write a comment
Name:*
E-Mail:


Comments
At homeschooling 101, our goal is to empowering parents to develop and provide the ideal school set-up for their children right at the comforts of their home. Check Out: Online Education for Kids
Today, 17:06

noorseo

Major Thanks for the post.p2p4u

Today, 17:02

ss

I genuinely believed you would probably have something useful to say. All I hear is a bunch of whining about something that you can fix if you were not too busy looking for attention. After all, I know it was my choice to read .. [url = https: //gamebnat.net] 먹튀 [/ url]

Today, 15:56

raymond weber

Lots of interesting comments, but it feels like users are really experts in their field, and it's very cool!
Today, 15:49

claudedufont

This is a good idea, thank you very much to the author!
Today, 15:47

claudedufont

Adv
Website for web developers. New scripts, best ideas, programming tips. How to write a script for you here, we have a lot of information about various programming languages. You are a webmaster or a beginner programmer, it does not matter, useful articles will help to make your favorite business faster.

Login

Registration Forgot password