Giter Club home page Giter Club logo

azimuth3d / socket-remote-lab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lanna-oss/socket-remote-lab

0.0 1.0 0.0 0 B

โปรแกรมเพื่อควบคุมหลอดไฟ LED โดยที่ปุ่มกดเป็น Touch Screen ศึกษาและพัฒนาตามแนวทางขอเทคโนโลยี IoT ซึ่งตัว Touch Screen นั้นผมใช้ Raspberryp PI เป็นอุปกรณ์ Touch Screen เขียนด้วยภาษา Python ส่วนทางตัวควบคุมไฟ LED เป็น ESP32 ซึ่งเป็น Node MCU เป็นอุปกรณ์สำเร็จพร้อม WiFI ซึ่งจัดว่าอยู่ในตระกูล Adruino การสื่อสารใช้ Socket Program ระดับ Low Level API สื่อสารกันระหว่างภาษา Python กับภาษา C

C++ 24.69% Python 75.31%

socket-remote-lab's Introduction

อ่านก่อน

ผมเองได้ทดลองเขียนโปรแกรมเพื่อควบคุมหลอดไฟ LED โดยที่ปุ่มกดเป็น Touch Screen ศึกษาและพัฒนาตามแนวทางขอเทคโนโลยี IoT ซึ่งตัว Touch Screen นั้นผมใช้ Raspberryp PI เป็นอุปกรณ์ Touch Screen เขียนด้วยภาษา Python ส่วนทางตัวควบคุมไฟ LED เป็น ESP32 ซึ่งเป็น Node MCU เป็นอุปกรณ์สำเร็จพร้อม WiFI ซึ่งจัดว่าอยู่ในตระกูล Adruino การสื่อสารใช้ Socket Program ระดับ Low Level API สื่อสารกันระหว่างภาษา Python กับภาษา C

https://www.youtube.com/watch?v=5cK3iBmE0Zs <== ท่านสามารถศึกษาดูตัวอย่างของผลการทดลองได้จากคลิปนี้

จุดประสงค์ของการสร้าง Repository

เพื่อเก็บตัวอย่างโปรแกรม ที่ใช้สื่อสารระหว่างกัน โดยใช้เทคโนโลยี Socket Programming. ศึกษาเทคโนโลยีสื่อสารตรงระหว่างอุปกรณ์ และเปิดโอกาสให้นักพัฒนาท่านอื่นๆ ที่สนใจที่จะสามารถเข้ามามีส่วนร่วม

โครงการทดลองนี้ จะต้องใช้อุปกรณ์สองส่วนคือ

  1. ทางส่วน Node MCU ประกอบด้วย

    1.1 ESP32 Node32 LITE ซึ่งผมใช้ของ Arayafun ซึ่งผลิตในบ้านเรา

    1.2 สายต่อ USB กับ ESP32

    1.3 สายไฟสีต่างๆ

    1.4 หลอดไฟ LED ทั้ง 4 สี ได้แก่ แดง เขียน เหลือง น้ำเงิน

  2. Raspberry PI ซึ่งเป็นระบบปฎิบัติการลีนุกซ์และต่อกับอุปกรณ์จอ Touch Screen

    2.1 Raspberry PI

    2.2 อุปกรณ์เคสของ Rasberry PI

    2.3 จอ Touch Screen

    2.4 Keyboard

    2.5 เม้าส์ (สำหรับท่านที่ไม่ถนัดการใช้จอ Touch Screen)

ท่านสามารถหาซื้ออุปกรณ์เหล่านี้ ได้ตาม Maker Club ที่มีอยู่ทั่วไป

วิธีการติดตั้งโปรแกรม

  1. การติดตั้งโปรแกรมบน Node MCU ESP32
    • ประกอบวงจรให้ถูกต้อง โดยเลือกสีของ LED ให้ตรงกับโปรแกรม
      • โดยมีขาต่างๆดังนี้
      • แดงต่อกับขา 12
      • เขียวต่อกับขา 14
      • เหลือต่อกับขา 27
      • น้ำเงินต่อกับขา 26
    • เสียบสาย USB ระหว่าง ESP32
    • ติดตั้งโปรแกรม Arduino IDE ลงบนระบบปฎิบัติการที่ท่านใช้อยู่
    • เลือกบอร์ดให้เป็น ESP32
    ให้ท่าน จากนั้นเลือกชนิดของบอร์ให้ถูกต้อง แล้วโหลดโปรแกรม LightServer.ino ลงไปยัง ESP32
  2. การติดตั้งโปรแกรม Python Raspberry Pi
    • นำ Raspberry PI ต่อกับอุปกรณ์ Touch Screen
    • ต่อเม้าส์กับคียบอร์ด
    • ติดตั้งระบบปฎิบัติลีนุกซ์บน Raspberry PI
    • ติดตั้งโปรแกรม Python3
    • โหลดโปรแกรม Raspi_remoter.py ไปยัง RaspberryPI
    • เลือก Wifi เป็น ESP32Light ซึ่งเป็นชื่อที่อยู่ในโปรแกรมของ ESP32
    • เปิดโปรแกรมผ่าน Terminal โดยใช้คำสั่ง ./Raspi_remoter.py ก็จะปรากฎโปรแกรมควบคุมโดยอาศัย Touch Screen

ลิขสิทธิ์ License

https://www.gnu.org/licenses/gpl-3.0.html

GNU/GPL version 3

การติดต่อกับผู้พัฒนา

ผู้พัฒนาโปรแกรมคือ นาย อวยชัย ไชยถา ประธานชมรมโอเพนซอร์สล้านนา ท่านสามารถติดต่อผู้พัฒนาได้ทางไลน์กลุ่มของชมรมโอเพนซอร์สล้านนา

socket-remote-lab's People

Contributors

azimuth3d avatar ouychai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.