Cov txheej txheem:

Octoprint Printing Monitor: 8 Kauj Ruam
Octoprint Printing Monitor: 8 Kauj Ruam

Video: Octoprint Printing Monitor: 8 Kauj Ruam

Video: Octoprint Printing Monitor: 8 Kauj Ruam
Video: OctoPrint Custom Webfront for 2,8" RPi Display 2024, Hlis ntuj nqeg
Anonim
Octoprint Printing Monitor
Octoprint Printing Monitor
Octoprint Printing Monitor
Octoprint Printing Monitor

Nyob zoo!

Kuv xav tias txoj haujlwm no yuav muaj txiaj ntsig zoo rau tib neeg, uas siv Octoprint.

Nws yog lub vijtsam nrog lub teeb pom kev zoo uas pom koj qee cov ntaub ntawv hais txog kev luam ntawv tau zoo. Nws ua haujlwm nrog Octoprint API kom tau txais txhua cov ntaub ntawv hais txog txheej txheem tam sim no. Python tsab ntawv txuas rau Arduino Leonardo (koj tuaj yeem siv ib qho nrog usb chaw nres nkoj. Kuv siv Leo, vim kuv tau muaj nws ua ntej) thiab muab nws cov ntaub ntawv. Tsis tas li koj tuaj yeem tswj hwm koj lub tshuab luam ntawv los ntawm cov cuab yeej no.

Koj xav tau:

  1. Raspberry pi (Kuv siv raspberry pi 3 B+)
  2. Arduino Leonardo (Ntawm cov duab koj tuaj yeem pom Iskra Neo, Nws yog qhov sib piv ntawm thawj Leonardo)
  3. Micro usb kab
  4. 20x4 LCD npo (Kuv siv yam tsis muaj I2C maub los, tab sis nws tsis nyuaj los kho qhov chaws los siv I2C ib qho)
  5. Plaub khawm (Kuv siv tus qauv)
  6. Mini khob cij
  7. Qee cov xov hlau
  8. RGB LED sawb (Ntev npaum li cas? Nws nyob ntawm koj)
  9. Fais fab mov, Kuv siv 12v 3a. Nws yog qhov zoo los muab LED sawb thiab Arduino
  10. 3D tshuab luam ntawv los tswj thiab koj kuj yuav tsum luam tawm rooj plaub rau lub vijtsam
  11. Qee qhov txuas: lub tog raj kheej (txiv neej thiab poj niam)
  12. Ob daim kab xev thiab daim kab xev insulating
  13. Buzzer
  14. DHT21 ntsuas kub thiab av noo

Yeem yeem. Koj tuaj yeem yooj yim txuas txhua yam yam tsis muaj kev sib txuas

  1. Soldering hlau
  2. Solder

Rau qee qhov nws yog qhov haujlwm nyuaj. Kuv tau siv 2 hnub tag los ua kom tiav.

Kauj Ruam 1: Tau Txais Octoprint API Key

Tau Octoprint API Ntsiab
Tau Octoprint API Ntsiab

Koj yuav tsum muaj tus lej API.

Txuag nws.

Kauj Ruam 2: Teeb Koj Lub Raspberry kom Ua Haujlwm Python Script

Thaum xub thawj koj yuav tsum txuas rau koj li raspberry los ntawm ssh.

Tom qab ntawv nkag mus thiab ntaus cov lus txib no

sudo apt-tau nruab python3-pip

Tom qab ntawd koj yuav tsum teeb tsa qee cov pob sej

sudo pip3 nruab pyserial

Tom qab txhua qhov kev teeb tsa rub cov ntawv nab npawb los ntawm Github nplooj ntawv

Github chaw cia khoom

Ntaus hauv ssh davhlau ya nyob twg sudo nano port.py, tom qab ntawv theej tag nrho los ntawm octoprint-monitor.py thiab muab tshuaj txhuam rau hauv davhlau ya nyob twg. Hauv qhov sib txawv API koj yuav tsum tau muab tshuaj txhuam koj tus lej Octoprint API. Koj tuaj yeem muab tshuaj txhuam los ntawm txhaj rau sab xis ntawm koj tus nas. Tom qab ntawd nias Ctrl + X, ntaus ntawv "y" thiab nias Enter.

Tom qab ntawd ua logMaster.py cov ntaub ntawv los ntawm sudo nano logMaster.py, tom qab ntawv theej tag nrho los ntawm octoprint-monitor.py thiab muab tshuaj txhuam rau hauv lub davhlau ya nyob twg. Koj tuaj yeem muab tshuaj txhuam los ntawm txhaj rau sab xis ntawm koj tus nas. Tom qab ntawd pres Ctrl + X, ntaus ntawv "y" thiab nias Enter.

Tom qab ntawv ua kom sudo python3 port.py

Yog tias koj muaj qhov yuam kev, txheeb xyuas cov kauj ruam dhau los.

Yog koj pom"

Txuas …

Txuas.

hauv koj lub davhlau ya nyob twg txhua yam zoo. Nias Ctrl+C.

Kauj Ruam 3: Luam Ntawv Case rau LCD Screen

Luam Ntawv Case rau LCD Screen
Luam Ntawv Case rau LCD Screen

Kuv muaj LCD 20x4 npo.

Koj yuav tsum luam ib daim ntawv los ntawm qhov txuas no

Kuv rooj plaub ntawm Thingiverse.

Kauj Ruam 4: Txuas Txhua Yam rau Arduino

Txuas Txhua Qhov rau Arduino
Txuas Txhua Qhov rau Arduino
Txuas Txhua Qhov rau Arduino
Txuas Txhua Qhov rau Arduino
Txuas Txhua Qhov rau Arduino
Txuas Txhua Qhov rau Arduino

Ntawm daim duab no koj tuaj yeem pom daim duab thaiv kab. Txuas lcd zaub rau arduino.

  • Tom qab ntawd txuas lub buzzer rau tus lej 9
  • Khawm 1 txog 7 tus pin
  • Khawm 2 - 8
  • Khawm 3 - 10
  • Khawm 4 - 13
  • Kub sensor - tus pin 0
  • LED sawb - tus pin 6

Tom qab ntawd kho nws tag nrho ntawm lub tshuab luam ntawv sab, lo kua lcd thiab cov nyees khawm rau hauv rooj plaub luam tawm. Kho qhov rooj nrog daim kab xev ob tog.

Txuas arduino rau raspberry pi nrog usb cable.

Txuas lub zog xa mus rau arduino thiab LED sawb raws li ntawm daim duab.

Kauj Ruam 5: Tshaj Tawm Sketch rau Arduino

Koj yuav tsum rub tawm cov ntawv octoprint-monitor.ino los ntawm github thiab xa nws mus rau arduino.

Koj yuav xav tau qee lub tsev qiv ntawv.

  • Adafruit NeoPixel
  • Ua kua Crystal (Nws twb tau teeb tsa rau Arduino IDE)
  • Troyka DHT lub tsev qiv ntawv

Tom qab ntawd txuas arduino rau raspberry pi.

Kauj Ruam 6: Txheeb Xyuas Txhua Qhov Zoo

Hloov tshiab: Nws pib nrhiav chaw nres nkoj ntxiv! Tam sim no koj tsis tas yuav nrhiav qhov chaw nres nkoj arduino.

Tua tawm sej code. Yog tias koj pom cov ntawv "Txuas txuas", txhua yam zoo.

Kauj Ruam 7: Teeb tsa Tsab Ntawv rau Pib Pib Pib

Yuav ua li cas ntxiv tsab ntawv rau autoload ntawm raspberry pi?

Nws yooj yim. Koj yuav tsum tau ntaus

sudo crontab -e

Thiab ntxiv qhov kawg ntawm cov ntawv tsuas yog ib kab.

@reboot/usr/bin/python3 /home/pi/port.py

Yog tag nrho. Tam sim no reboot koj raspberry thiab txheeb xyuas txhua qhov.

Kauj ruam 8: Ua tiav

Tam sim no cov kauj ruam kawg.

Txheeb xyuas txhua yam thiab yog tias qee yam tsis zoo, sau ib qho lus nrog koj qhov teeb meem.

Ua tsaug rau koj saib!

Pom zoo: