Cov txheej txheem:

Siemens SIMATIC IOT2000 Series rau Ubidots + Arduino IDE: 8 Kauj Ruam
Siemens SIMATIC IOT2000 Series rau Ubidots + Arduino IDE: 8 Kauj Ruam

Video: Siemens SIMATIC IOT2000 Series rau Ubidots + Arduino IDE: 8 Kauj Ruam

Video: Siemens SIMATIC IOT2000 Series rau Ubidots + Arduino IDE: 8 Kauj Ruam
Video: Hướng Dẫn Cấu Hình Simatic IOT2050 P2 | SIEMENS DEMO SERIES 2024, Kaum ib hlis
Anonim
Siemens SIMATIC IOT2000 Series rau Ubidots + Arduino IDE
Siemens SIMATIC IOT2000 Series rau Ubidots + Arduino IDE

Qhov yooj yim ntawm Arduino ua ke nrog kev ntseeg tau thiab keeb kwm ntawm Siemens ua rau SIMATIC IOT2000 series yog qhov kev xaiv zoo tshaj plaws rau lub qhov rooj lag luam hauv cov chaw tsim khoom thiab cov koom haum tshawb nrhiav kev sib txuas thiab kho dua tshiab. Cov cuab yeej tshiab ntawm cov tshuab qub lossis yooj yim hloov kho lub ntsuas hluav taws xob tam sim no siv, SIMATIC IOT2000 series sib haum, tshuaj xyuas, thiab xa cov ntaub ntawv kom muaj txiaj ntsig nrog cov txheej txheem zoo ib yam li MQTT thiab Modbus. Raws li Yocto Linux, SIMATIC IOT2000 series suav nrog IoT2020 thiab IoT2040 cov qauv uas sib xws nrog feem ntau Arduino Sketches thiab tuaj yeem xa ncaj qha los ntawm Arduino IDE. IOT2040 yog qhov zoo tshaj plaws rau cov chaw tsim khoom thaum IOT2020 zoo tshaj plaws hauv cov tsev kawm ntawv nrog nws cov khoom siv ntxiv thiab cov txheej txheem kev sib txuas lus.

Cov hauv qab no qhia qhia yuav ua li cas teeb tsa SIMATIC IOT2000 series siv Arduino IDE thiab tus qauv piv txwv kom xa HTTP thov mus rau Ubidots rau kev txhais ua ntej-kawg.

Kauj ruam 1: Yuav tsum tau ua

  • Ethernet cable
  • Daim npav SD
  • 24V fais fab mov
  • Arduino IDE Cov
  • Siemens SIMATIC IOT 2040
  • Ubidots tus account - lossis - STEM License

Kauj Ruam 2: Teeb tsa SIMATIC IOT2000 Series

Ua ntej, koj yuav tsum tso npe nrog lossis nkag tau rau Siemens Support Portal txhawm rau rub tawm txhua qhov kev teeb tsa thawj zaug. Lub Portal no tseem yuav muab kev daws teeb meem thiab kev txhawb nqa los ntawm Siemens ntawm ib qho kev nug txog khoom kho vajtse. Tag nrho IOT2000 series tau teeb tsa tib txoj kev, thov ua raws cov ntawv qhia no rau txhua lub cuab yeej hauv koob.

Kauj ruam 3: Hlawv thiab Nruab SD-Card

Pib los ntawm kev hlawv SD-Card nrog cov duab muab los ntawm Siemens Kev Lag Luam Online Txhawb nqa nplooj ntawv. Thov, rub tawm thiab khaws Piv txwv_Image_V2.1.3 rau tom qab.

  • Ntxig lub microSD-Card rau hauv SD-Card qhov ntawm koj lub khoos phis tawj (yuav xav tau lub adapter).
  • Unzip cov duab rub tawm thiab hlawv nws mus rau SD-Card. Microsoft cov neeg siv nyem qhov no lossis yuav ua li cas hlawv cov duab rau koj daim npav SD. Linux cov neeg siv thov nyeem txuas ntxiv.

Hlawv ib daim duab rau SD-Card siv Linux: 1. Qhib koj lub khoos phis tawj dav dav thiab mus rau daim nplaub tshev uas cov ntaub ntawv zauv teb yog. rub tawm siv cov lus txib cd. e.i: Kuv rub tawm cov ntawv rau hauv "Downloads" cov npe:

cd download tau

2. Unzip cov ntawv rub tawm uas khiav cov lus txib hauv qab no:

sudo unzip 109741799_Example_Image_V2.1.3.zip

Thaum zip cov ntaub ntawv raug tshem tawm kom zoo koj yuav pom cov ntawv npe piv txwv-V2.1.3.wic raws li tau hais los saum toj no. NCO TSEG: Yog tias koj tau txais qhov yuam kev khiav cov lus txib saum toj no, txheeb xyuas lub npe ntawm cov ntawv rub tawm yog tib yam.

3. Txheeb xyuas qhov chaw nyob ntawm daim npav SD kom unmount nws thiab hlawv cov duab. Khiav cov lus txib hauv qab no txhawm rau txheeb xyuas qhov chaw:

df -h ib

Daim npav SD yuav tsum nyob ntawm nws cov npe /dev /…; hauv kuv rooj plaub daim npav SD nyob hauv cov npe hauv qab no /dev /mmcblk0

4. Unmount SD-Card khiav cov lus txib hauv qab no:

tshem tawm /dev /mmcblk0

5. Txhawm rau hlawv cov duab, hloov lub npe ntawm cov ntaub ntawv unzipped thiab qhov chaw ntawm SD-Card; tus qauv ntawm qhov hais kom ua yog raws li hauv qab no:

sudo dd bs = 1M yog = {name_of_the_image} ntawm = {SD_location}

Thaum qhov ntsuas tsis tau hloov nrog qhov raug, qhov hais kom ua yuav tsum zoo ib yam li cov hauv qab no:

sudo dd bs = 1M yog = piv txwv -V2.1.3.wic ntawm =/dev/mmcblk0

Khiav cov lus txib no ua ob peb feeb, thov ua siab ntev:)

Kauj ruam 4: Nruab koj daim npav SD

Nruab koj daim npav SD
Nruab koj daim npav SD

Txuas koj daim npav SD rau hauv koj lub khoos phis tawj. Hauv qab no peb tau teeb tsa SD-Card rau hauv SIMATIC 2040 qhov uas tau hais tseg.

Kauj Ruam 5: Thawj Ua Haujlwm ntawm SIMATIC IOT2000

Cov theem hauv qab no qhia yuav ua li cas nkag mus rau SIMATIC IOT2040 siv tus IP zoo li qub los teeb tsa lub rooj vag lub network. Hauv qhov no yog qhov tseem ceeb uas yuav tsum tau hais tias SIMATIC IOT 2040 nqa DHCP Chaw nyob los ntawm lub hauv paus hauv Ethernet Port - X2P1, yog tias koj xav tau koj tuaj yeem nkag ncaj qha siv tus IP chaw nyob.

1. Fais fab txuas thiab txuas ib kawg ntawm Ethernet Cable rau koj lub khoos phis tawj thiab lwm qhov txuas mus rau Ethernet Port- X1P1 ntawm SIMATIC IOT2000 ntaus ntawv.

CEEV FAJ: Tsuas yog siv DC 9… 36V fais fab mov!

2. Thaum SIMATIC IOT2000 tau qhib, koj yuav pom tus cwj pwm hauv qab no ntawm LEDs ntawm lub qhov rooj:

  • PWR: Khoom; ntaus ntawv ON
  • SD: Sib nrug…. tom qab ntawv Solid OFF
  • USB: Khoom; ntaus ntawv ON

SD LED yuav tsis tu ncua vim tias tau hloov pauv daim npav SD nrog daim duab, tos kom txog thaum SD LED hloov nws cov xwm txheej rau Khoom muab kaw kom nkag mus rau lub qhov rooj.

3. SIMATIC IOT2000 cia koj nkag mus rau ntawm Serial, SSH lossis Telnet; phau ntawv qhia no siv SSH kev sib txuas.

SIMATIC IOT2000 muaj IP chaw nyob zoo li qub -> 192.168.200.1. Txhawm rau tsim kom muaj kev sib txuas SSH, koj lub khoos phis tawj muaj tib lub subnet zoo ib yam li SIMATIC IOT2000.

Yog tias koj tab tom ua haujlwm nrog Microsoft, thov siv phau ntawv qhia no pib ua li cas nkag mus rau lub qhov rooj. Linux cov neeg siv thov txuas ntxiv nrog cov hauv qab no.

4. Thaum lub network ntawm koj lub khoos phis tawj tau teeb tsa ntawm tib lub subnet ntawm SIMATIC IOT2000, txheeb xyuas nws qhov kev sib txuas nrog ping:

ping 192.168.200.1

qhov tshwm sim xav tau:

PING 192.168.200.1 (192.168.200.1) 56 (84) bytes ntawm cov ntaub ntawv.

64 bytes los ntawm 192.168.200.1: icmp_seq = 1 ttl = 64 sij hawm = 1.04 ms

64 bytes los ntawm 192.168.200.1: icmp_seq = 2 ttl = 64 sij hawm = 1.03 ms

64 bytes los ntawm 192.168.200.1: icmp_seq = 3 ttl = 64 sij hawm = 1.00 ms

Yog tias koj tau txais qhov txiaj ntsig xav tau SIMATIC IOT2000 tau txuas nrog kom raug.

5. Nkag mus rau lub qhov rooj khiav cov lus txib hauv qab no:

ssh hauv [email protected]

Thaum xub nkag mus rau Lub Rooj vag koj yuav raug ceeb toom kom pom zoo cov lus ruaj ntseg. Xa cov lus txib yog thiab nias nkag mus pom zoo thiab txuas ntxiv. Thaum nkag tau zoo tsim koj yuav pom cov hauv paus hauv qab no hauv koj lub davhlau ya nyob twg:

hauv paus@iot2000: ~#

6. Raws li tau hais los saum no, IP chaw nyob ntawm SIMATIC IOT2000 tau teeb tsa rau 192.168.200.1. Yog li, yog tias yuav tsum muaj lwm tus IP chaw nyob lossis chaw nyob DHCP, qhov no tuaj yeem teeb tsa hauv "cuam tshuam" cov ntaub ntawv hauv "/etc/network" cov npe.

Txhawm rau ua qhov no, nkag mus rau cov npe teev tseg nrog cov lus txib hauv qab no:

cd/thiab/network/

Qhib cov ntaub ntawv cuam tshuam siv nano editor khiav cov lus txib hauv qab no:

nano interfaces

Cov ntsiab lus ntawm cov ntaub ntawv cuam tshuam los ntawm lub neej ntawd yuav zoo ib yam li hauv qab no:

#/etc/network/interfaces - teeb tsa cov ntaub ntawv rau ifup (8), ifdown (8)

# Lub loopback interface

auto hlo

hais tias nws yog inet loopback

# Wired interfaces

nws aut0

iface eth0 inet zoo li qub

chaw nyob 192.168.200.1

netmask 255.255.255.0

pib eth1

iface eth1 inet dhcp

Raws li tau hais los saud, Yog tias koj tab tom ua haujlwm nrog SIMATIC IOT2040 qhov chaw nyob DHCP tau teeb tsa los ntawm lub hauv paus ntawm qhov chaw nres nkoj thib ob (X2 P1LAN). Xyuas kom koj lub Ethernet cable txuas nrog rau qhov chaw nres nkoj Ethernet thib ob thiab rov qhib lub qhov rooj.

Yog tias koj tab tom ua haujlwm nrog SIMATIC IOT2020 thiab xav teeb tsa DHCP Chaw Nyob, koj yuav tsum hloov kho cov ntaub ntawv cuam tshuam raws li tau qhia hauv qab no, tom qab ntawd rov qhib lub qhov rooj:

#/etc/network/interfaces - teeb tsa cov ntaub ntawv rau ifup (8), ifdown (8)

# Lub loopback interface

auto hlo

hais tias nws yog inet loopback

# Wired interfaces

pib eth0 iface

eth0 ib dhcp

Thaum DHCP Chaw Nyob tau teeb tsa koj tuaj yeem siv lub network scanner app kom paub tus IP tshiab uas tau muab rau SIMATIC 2000, peb pom zoo kom koj siv ntiv tes uas yooj yim siv thiab muaj nyob hauv Google Play Store thiab Apple App Store.:)

Kauj Ruam 6: Arduino IDE thiab Qauv Qauv

SIMATIC IOT2000 yog sib xws nrog Arduino IDE siv Intel Galileo pob. Thov ua raws cov theem hauv qab no txhawm rau teeb tsa lub rooj tsav xwm kom raug:

1. Qhib Arduino IDE

2. Qhib Tus Thawj Saib Xyuas Haujlwm los ntawm Cov Cuab Yeej -> Pawg Thawj Coj -> Tus Thawj Saib Xyuas Haujlwm thiab teeb tsa pob galileo. Txhawm rau nrhiav lub cuab yeej raug, tshawb "Intel i5" hauv kab tshawb nrhiav. Rub tawm thiab teeb tsa qhov tseeb version.

3. Xaiv koj Intel Galileo gen2 los ntawm Cov Cuab Yeej> Pawg ntawv qhia zaub mov.

4. Txuas Micro USB rau koj IOT2000 thiab xaiv qhov chaw nres nkoj com muab los ntawm Cov Cuab Yeej> Chaw Nres Nkoj> Intel Galileo. Yog tias koj ua haujlwm ntawm Windows thiab koj lub PC tsis lees paub koj li IOT2000, koj yuav tsum hloov kho cov tsav tsheb manually.

5. Tam sim no nrog txhua yam teeb tsa, xa Blink Sketch los txheeb xyuas tias txhua yam ua haujlwm tau zoo. Mus rau Cov Ntaub Ntawv> Piv txwv> Hauv paus> Blink thiab sau cov cai.

6. Thaum cov cai raug kho tshiab lawm USER LED yuav pib ntsais muag.

Kauj Ruam 7: Pom Koj Cov Ntaub Ntawv hauv Ubidots

Pom Koj Cov Ntaub Ntawv hauv Ubidots
Pom Koj Cov Ntaub Ntawv hauv Ubidots
Pom Koj Cov Ntaub Ntawv hauv Ubidots
Pom Koj Cov Ntaub Ntawv hauv Ubidots

Thaum koj muaj peev xwm suav sau Blink code rau hauv SIMATIC IOT2000 koj tuaj yeem txuas ntxiv nrog cov hauv qab no: 1. Luam thiab muab cov cai no hauv qab no hauv koj Arduino IDE. Thaum koj tau sau cov cai kom paub tseeb tias muab qhov tshwj xeeb Ubidots TOKEN qhov chaw qhia. Yog tias koj tsis ua li cas rau koj li Ubidots TOKEN, thov siv kab lus no.

TSEEM CEEB NTAWV TSEEM CEEB TSHAJ PLAWS: Cov cai saum toj no yog tus qauv piv txwv qhia tias yuav xa HTTP POST thov li cas rau Ubidots siv lub tsev qiv ntawv EthernetClient. Txhawm rau siv koj tus lej, thov siv Ubidots REST API Siv thiab Siemens Txhawb rau cov peev txheej ntxiv.

2. Txheeb xyuas thiab upload cov cai xaiv lub cim cim cim thiab tom qab ntawd nyem rau sab xis ntawm lub cim cim cim.

3. Kom pom kev teb cov lus ntawm tus neeg rau zaub mov thiab nws txuas nrog lub cuab yeej, qhib Serial Monitor ntawm Arduino IDE. Tso saib lub koob yees duab los ntawm xaiv "iav tsom iav" lub cim nyob rau sab xis saum toj ntawm peb Arduino IDE.

Txheeb xyuas koj tus lej los ntawm kev mus rau koj tus lej Ubidots txhawm rau nrhiav lub cuab yeej tshiab tsim hu ua "simatic-iot2000" muaj qhov sib txawv hu ua "av noo" uas nyeem A0 cov tswv yim los ntawm Arduino Shield muaj los ntawm SIMATIC IOT2000.

Kauj Ruam 8: Cov txiaj ntsig

Hauv ob peb feeb xwb, peb suav nrog cov cuab yeej tsim khoom, Siemens SIMATIC IOT2000 nrog Ubidots, thiab tsuas yog xav tau kev paub yooj yim txog kho vajtse thiab ua haujlwm ntawm Arduino IDE.

Tam sim no nws yog lub sijhawm los tsim Ubidots Dashboards kom pom thiab txhais koj cov ntaub ntawv los tswj cov txheej txheem lossis txo qhov ua yuam kev.

Pom zoo: