Cov txheej txheem:

Tswj Pawg Thawj Coj Los Ntawm Octoprint ntawm Raspberry Pi: 5 Kauj Ruam
Tswj Pawg Thawj Coj Los Ntawm Octoprint ntawm Raspberry Pi: 5 Kauj Ruam

Video: Tswj Pawg Thawj Coj Los Ntawm Octoprint ntawm Raspberry Pi: 5 Kauj Ruam

Video: Tswj Pawg Thawj Coj Los Ntawm Octoprint ntawm Raspberry Pi: 5 Kauj Ruam
Video: Cov thawj coj xyaum ua lub neej li cas 2024, Hlis ntuj nqeg
Anonim
Tswj Pawg Thawj Coj Los Ntawm Octoprint ntawm Raspberry Pi
Tswj Pawg Thawj Coj Los Ntawm Octoprint ntawm Raspberry Pi

Yog li koj muaj raspberry pi nrog Octoprint thiab txawm tias muaj lub koob yees duab teeb tsa. Qhov kawg uas koj xav tau yog txoj hauv kev qhib thiab kaw koj lub tshuab luam ntawv 3d thiab tej zaum tswj lub teeb. Cov lus qhia no yog rau koj!

Qhov no tau tshoov siab thiab ua kom yooj yim los ntawm:

Nco ntsoov txheeb xyuas kuv cov ntawv qhia yav dhau los uas kuv tau tsim lub thawv ntim khoom / fume hood rau kuv lub tshuab luam ntawv 3d, vim qhov no yog qhov txuas ntxiv.

Kuaj nrog:

Linux octopi 4.14.79-v7+ #1159 SMP Hnub Nov 4 17: 50: 20 GMT 2018 armv7l GNU/Linux

OctoPrint version: 1.3.11OctoPi version: 0.16.0

Kev tsis lees paub: Kuv tsis ua lub luag haujlwm rau yam phem twg tuaj yeem tshwm sim los ntawm koj ua raws cov lus qhia no.

Khoom siv

  • 5V relay board nrog optocoupler (ebay)
  • Qee cov xov hlau jumper
  • Lub thawv hluav taws xob nrog lub qhov hluav taws xob (xaiv tau)

Kauj Ruam 1: Txuas Lub Rooj Sib Tham Sib Txuas rau Koj Raspberry Pi

Txuas Cov Rooj Sib Tham Sib Txuas rau Koj Raspberry Pi
Txuas Cov Rooj Sib Tham Sib Txuas rau Koj Raspberry Pi

Txawm hais tias cov laug txuas tau tsim rau 5V cov laj thawj, lawv yuav ua kom raug ntawm 3.3V. Paub txog qhov no, kuv muaj peev xwm zam tau qhov kev hloov kho rau thawj lub rooj tsavxwm.

Relay ntaub thaiv npog Raspberry

------------ --------- Coils: JD-VCC-5V VCC-Tsis txuas nrog GND-GND Logic: GND-Tsis txuas nrog IN1-GPIO #23 IN2-GPIO # 18 VCC - 3.3V

Nws yog ib qho tseem ceeb kom tshem lub jumper nruab nrab ntawm JD-VCC thiab VCC yog tias koj muaj. Qhov no yuav tso cai pub 5V rau cov coils thaum pub zaub mov 3.3V rau cov tswv yim logic. Thiab txij li ob qho GND tau txuas ua ke sab hauv, peb tsuas txuas ib qho ntawm lawv.

Kauj Ruam 2: SSH rau Koj Raspberry Pi thiab teeb tsa nws

SSH rau Koj Raspberry Pi thiab teeb tsa nws
SSH rau Koj Raspberry Pi thiab teeb tsa nws

Siv putty lossis koj nyiam tus neeg siv ssh, txuas rau koj tus raspberry pi siv tib tus IP chaw nyob uas koj siv los nkag rau Octoprint. Lub npe siv tsis raug yog pi thiab lo lus zais yog raspberry.

Thawj qhov kuv yuav ua yog txheeb xyuas tias cov kis tau teb raug. Txhawm rau ua qhov no, muab cov lus txib no

gpio -g hom 18 tawm

gpio -g hom 23 tawm gpio -g sau 18 0 gpio -g sau 23 0 gpio -g sau 18 1 gpio -g sau 23 1

Thawj 2 kab tso cai teeb tsa GPIO ua qhov tso tawm. Tom qab ntawd koj toggle cov zis tawm thiab tawm. Qhov ntawd yuav tsum ua kom nyem qhov txuas. Thaum cov tswv yim qis (0), kev xa tawm yuav tsum qhib thiab thaum cov tswv yim nkag siab (1) lawv yuav tsum hloov mus. Yog lawm, qhov no yog qhov tawm tsam me ntsis, tab sis qhov ntawd yog li cas!

Kauj Ruam 3: Ntxiv Cov Ntawv Qhia Xaiv Tshiab rau Octoprint los Tswj Koj Li Relays

Ntxiv Cov Ntawv Qhia Xaiv Tshiab rau Octoprint los Tswj Koj Li Kev Tshaj Tawm
Ntxiv Cov Ntawv Qhia Xaiv Tshiab rau Octoprint los Tswj Koj Li Kev Tshaj Tawm
Ntxiv Cov Ntawv Qhia Xaiv Tshiab rau Octoprint los Tswj Koj Li Kev Tshaj Tawm
Ntxiv Cov Ntawv Qhia Xaiv Tshiab rau Octoprint los Tswj Koj Li Kev Tshaj Tawm

Koj yuav tsum tau kho cov ntaub ntawv config.yaml:

sudo nano.octoprint/config.yaml

Hauv cov ntawv ntawd, nrhiav ntu "system" thiab ntxiv cov hauv qab no:

qhov system:

kev ua: - kev ua: lub tshuab luam ntawv ntawm kev hais kom ua: gpio -g sau 18 0 lub npe: Qhib lub tshuab luam ntawv - kev nqis tes ua: tshuab luam ntawv tawm hais kom ua: gpio -g sau 18 1 lees paub: koj tab tom yuav tua lub tshuab luam ntawv. lub npe: Tua lub tshuab luam ntawv - ua: lon hais kom ua: gpio -g sau 23 0 lub npe: LightOn - ua: loff hais kom ua: gpio -g sau 23 1 lub npe: LightOff

Tom qab txuag cov ntaub ntawv (ctrl+x), rov pib dua raspberry pi:

sudo rov pib dua

Tam sim no koj yuav tsum tuaj yeem tswj hwm kev xa tawm los ntawm Octoprint lub vev xaib sib tham!

Kauj Ruam 4: Cov Hluav Taws Xob Hluav Taws Xob (Ceev faj)

Cov Hluav Taws Xob Hluav Taws Xob (Ceev faj)
Cov Hluav Taws Xob Hluav Taws Xob (Ceev faj)

Kev xa tawm ua raws li kev hloov pauv, tsuas yog nws tau ua los ntawm tus tswj hwm, hauv qhov no yog raspberry pi. Qhov hloov pauv muaj lub tshuab hluav taws xob uas yuav txuas tus pin ua ke, uas yog qhov nyem koj hnov.

Txhawm rau thaiv nws koj muaj ob txoj kev xaiv. Xijpeem koj txiav ib ntawm cov xov hlau ntawm koj lub tshuab luam ntawv 3d lub hwj chim thiab koj txuas qhov kawg rau kev xa tawm, lossis koj ua lub qhov hluav taws xob rau qhov ntawd. Kuv nyiam txoj kev thib ob, vim qhov no yuav tso cai txav lub tshuab luam ntawv yooj yim dua. Kuv tseem yuav siv lub qhov hluav taws xob thib ob los txuas kuv lub kiv cua (saib kuv lwm yam qhia: Yooj Yim thiab Pheej Yig 3D Tshuab Luam Ntawv Fume Hood).

Tam sim no lwm qhov txuas yog tswj lub teeb. Nws yog tib lub hauv paus ntsiab lus, tab sis qhov xwm txheej no kuv pom zoo tias koj tsuas yog txiav ib qho ntawm cov xov hlau los ntawm lub xov tooj hluav taws xob thiab txuas qhov kawg mus rau qhov txuas, feem ntau nws yuav tsis xav tau txav mus.

Kauj Ruam 5: Kho Kho GPIO Cov Lus Tawm thiab Tiv Thaiv Koj Li Kev Tshaj Tawm los ntawm Kev Tig Thaum Raspberry Pi Rov Pib Dua

Txhawm rau piav qhia qhov teeb meem, GPIO tau teeb tsa qis thaum raspbian rov pib dua (tsawg kawg rau qee qhov kev hloov pauv hauv kernel). Thaj, tsis muaj ntau yam peb tuaj yeem ua tau … huag zoo! Yog li lub tswv yim yog hu tsab ntawv uas yuav thim rov qab uas ib zaug nws ua tiav booting los ntawm teeb tsa qhov ua tau zoo.

Saib cov rooj sab laj no kom paub ntau ntxiv: https://www.raspberrypi.org/forums/viewtopic.php? T = 35321

Tab sis qhov tseem ceeb tshaj, tsab ntawv no teeb tsa GPIOs raws li kev tso tawm, txwv tsis pub cov ntawv qhia zaub mov yuav tsis ua haujlwm hauv Octoprint.

Tsim ib tsab ntawv siv nano:

nano /home/pi/setupgpio.sh

Muab tshuaj txhuam rau hauv cov cai no thiab khaws cov ntawv.

#!/bin/sh

echo 18>/sys/class/gpio/export echo 23>/sys/class/gpio/export udevadm khom echo siab>/sys/class/gpio/gpio18/kev taw qhia ncho siab>/sys/class/gpio/gpio23/kev taw qhia

Ua kom cov ntaub ntawv ua tiav:

chmod +x /home/pi/setupgpio.sh

Kho cov ntaub ntawv rc.local:

sudo nano /etc/rc.local

Thiab hu rau tsab ntawv koj nyuam qhuav tsim los ntawm kev ntxiv cov kab no:

# teeb tsa gpio pins rau kev tswj lub qhov rooj

/home/pi/setupgpio.sh

Rov pib dua koj cov raspberry thiab tshawb xyuas tias nws ua haujlwm tau zoo.

Pom zoo: