[PYTHON] Programming normally with Node-RED programming on Raspberry Pi 3

Introduction

My name is Ryosuke Kamei and I am an IT consultant based on the idea of "gentle IT"! Currently, in my work, I am doing upstream processes focusing on requirements analysis and requirements definition, but I also write programs! As part of friendly IT activities, "Raspberry Pi 3 (commonly known as Raspberry Pi)" with the idea of "providing a PC that can be programmed for education at a low price", so there is Node-RED that can be programmed with GUI for education, so I will introduce it. To do! In addition, I will also introduce the settings for developing with Python!

● Purpose

  1. Install Node-RED that can be programmed with GUI
  2. Preparation for programming with python

Install python package manager pip and dev Install WiringPi for GPIO control

1. Install Node-RED that can be programmed with GUI

Since the idea of Raspberry Pi is "to provide a PC that can be programmed for education at a low price", there is an application called Node-RED so that programming can be done with GUI. It seems that it is already installed on Raspberry Pi 3 (as of July 3, 2016), but I have listed it just in case. (Installed on the latest version of Raspberry Pi)

1.1 Installation

Node-RED installation


$ sudo apt-get install nodered

1.2 Start Node-RED

Node-RED start


$ node-red-start

1.3 Access with a browser

Open your browser and go to "http://127.0.0.1:1880/" You can program with GUI! The programming language seems to use Node.js!

2. Preparation for programming with python

As Node-RED touches when teaching children, I would like to program normally to light LEDs and turn motors. I use a programming language called Python, and it seems convenient to have a package manager pip, so I will install it. Install WiringPi for GPIO (general purpose input / output control).

2-1. Install python3-dev python3-pip

python3-dev python3-install pip


$ sudo apt-get install python3-dev python3-pip

2-2. Install Wiring Pi2 using pip3

Install Wiring Pi2 using pip3


$ sudo pip3 install wiringpi2

Operation check


$ sudo python3

Python


>>> import wiringpi
(No error displayed)
wiringpi.piBoardRev()
2 (only displayed as ← 2)

What I used

Raspberry Pi 3 main unit 5,980 yen Raspberry Pi official 7 inch touch screen display 11,330 yen Note It is OK if you have a liquid crystal display or a TV with an HDMI terminal. I just don't have it at home ... crying [Sanwa Supply USB Keyboard (Black) SKB-L1UBK 496 Yen](http://www.amazon.co.jp/gp/product/B005LL9J9G/ref=as_li_ss_tl?ie=UTF8&camp=247&creative=7399&creativeASIN=B005LL9J9G&linkCode=as2&tag=sr2smail twenty two) USB mouse What was at home ... SD card What was at home ... Razpai Magazine June 2016

site map

Raspberry Pi 3 setup

Install Raspberry Pi 3 → Wireless LAN → Japanese input / output → Operate from Mac

Build a Python + MySQL environment with Docker on Raspberry Pi 3!

Install Docker on RaspberryPi3 Build a Python + bottle + MySQL environment with Docker on RaspberryPi3![Easy construction] Build a Python + bottle + MySQL environment with Docker on RaspberryPi3![Trial and error]

Make an air conditioner integrated PC "airpi" with Raspberry Pi 3!

Make an air conditioner integrated PC "airpi" with Raspberry Pi 3!

Let's play with Raspberry Pi 3 and python

Programming with Node-RED programming with Raspberry Pi 3 and programming normally Light the LED with python on Raspberry Pi 3 (Hello World) Detect switch status on Raspberry Pi 3 Run a servo motor using python on Raspberry Pi 3 Control the motor with a motor driver using python on Raspberry Pi 3! Detect slide switch using python on Raspberry Pi 3! Detect magnet switch using python on Raspberry Pi 3! Detect temperature using python on Raspberry Pi 3! Sound the buzzer using python on Raspberry Pi 3! Detect analog signals with A / D converter using python on Raspberry Pi 3! Detect "brightness" using python on Raspberry Pi 3! Detect "temperature (using A / D converter)" using python on Raspberry Pi 3! Output to "7-segment LED" using python on Raspberry Pi 3!

Rules focused on test-driven development

Coding rules "Let's write gentle code" (FuelPHP) Naming convention "Friendly to yourself, team-friendly, and unseen members after 3 months"

Web application development with Docker + Python

Install Python3, related libraries pip, virtualenv and frameworks Django, bottle, Flask on CentOS on Docker! With a Dockerfile that summarizes these!

Easy to develop environment construction (Docker + PHP)

PHP environment + Eclipse is linked to Apache using Docker Building FuelPHP development environment using Docker Create CRUD skeleton using initial settings of FuelPHP development environment using Docker and scaffold FuelPHP database migration

Recommended Posts

Programming normally with Node-RED programming on Raspberry Pi 3
Working with sensors on Mathematica on Raspberry Pi
Working with GPS on Raspberry Pi 3 Python
GPGPU with Raspberry Pi
pigpio on Raspberry pi
DigitalSignage with Raspberry Pi
Cython on Raspberry Pi
Media programming with Raspberry Pi (preparation for audio)
Enjoy electronic work with GPIO on Raspberry Pi
Power on / off your PC with raspberry pi
Play with your Ubuntu desktop on your Raspberry Pi 4
Connect to MySQL with Python on Raspberry Pi
Record temperature and humidity with systemd on Raspberry Pi
Mutter plants with Raspberry Pi
Run LEDmatrix interactively with Raspberry Pi 3B + on Slackbot
Control brushless motors with GPIOs on Raspberry Pi Zero
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
Introduced pyenv on Raspberry Pi
Troubleshoot with installing OpenCV on Raspberry Pi and capturing
Use NeoPixel on Raspberry Pi
Install OpenCV4 on Raspberry Pi 3
Install TensorFlow 1.15.0 on Raspberry Pi
[Raspberry Pi] Stepping motor control with Raspberry Pi
Testing uart communication on Raspberry Pi
Use vl53l0x with Raspberry Pi (python)
raspberry pi 1 model b, node-red part 17
Servo motor control with Raspberry Pi
MQTT on Raspberry Pi and Mac
raspberry pi 4 centos7 install on docker
Serial communication with Raspberry Pi + PySerial
Install ghoto2 on Raspberry Pi (memo)
OS setup with Raspberry Pi Imager
Try using ArUco on Raspberry Pi
Try L Chika with raspberry pi
OpenCV installation procedure on Raspberry Pi
VPN server construction with Raspberry Pi
Try moving 3 servos with Raspberry Pi
Power on / off Raspberry pi on Arduino
Detect switch status on Raspberry Pi 3
Install OpenMedia Vault 5 on Raspberry Pi 4
Using a webcam with Raspberry Pi
L Chika on Raspberry Pi C #
Build wxPython on Ubuntu 20.04 on raspberry pi 4
Control the motor with a motor driver using python on Raspberry Pi 3!
Measure SIM signal strength with Raspberry Pi
Pet monitoring with Rekognition and Raspberry pi
"Honwaka Notification Lamp" on Raspberry Pi Part 2
Detect "brightness" using python on Raspberry Pi 3!
USB boot on Raspberry Pi 4 Model B
Hello World with Raspberry Pi + Minecraft Pi Edition
Adafruit Python BluefruitLE works on Raspberry Pi.
Get BITCOIN LTP information with Raspberry PI
Try fishing for smelt with Raspberry Pi
Set swap space on Ubuntu on Raspberry Pi
Use the Grove sensor on the Raspberry Pi
Install 64-bit OS (bate) on Raspberry Pi
Improved motion sensor made with Raspberry Pi
Install docker-compose on 64-bit Raspberry Pi OS
Try Object detection with Raspberry Pi 4 + Coral
Run servomotor on Raspberry Pi 3 using python
"Honwaka Notification Lamp" on Raspberry Pi Part 3