336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

#XBee#XCTU#직비#지그비


■ZigBee is a specification/standard for a suite of high level communication protocols using small, low-power digital radios. 

Think of Bluetooth but for low-power devices.

■XBee is the brand name from DIGI International for various radio modules.

■XBee Series 1 or XBee 802.15.4, the original XBee radio, quite simple to use, does point to point and point-to-multipoint.

■XBee ZNet 2.5, is actually a Series 2 module with older firmware. Series 2 and 2.5 are compatible via firmware updates.

■XBee Series 2 or XBee ZB, uses the ZigBee mesh networking protocol. The latest version available from Digi.

■Pro versions, for all series, have just increased output power capabilities, thus longer range.

http://www.interactiondesign.se/wiki/xbee:remote_blink



Transmitter.txt

Receiver.txt


▼Transmitter.............................................

const int potPin = A0; 

int value; //Value from pot


void setup() 

{

  //Start the serial communication

  Serial.begin(9600); //Baud rate must be the same as is on xBee module

}


void loop() 

{    

    value = analogRead(A0);

    value = map (value, 0, 1023, 0, 255);

    Serial.print('<');

    Serial.print(value);

    Serial.println('>');

}


▼Receiver.............................................................

const int ledPin = 3;

bool started= false;

bool ended  = false; 

char incomingByte ; //Variable to store the incoming byte

char msg[3];    //Message - array from 0 to 2 (3 values - PWM - e.g. 240)

byte index;     //Index of array


void setup() 

{

  

  Serial.begin(9600);

  pinMode(ledPin, OUTPUT);

}


void loop() 

{  

      while (Serial.available()>0)

{

            //Read the incoming byte

            incomingByte = Serial.read();

            //Start the message when the '<' symbol is received

            if(incomingByte == '<')

            {

                 started = true;

                 index = 0;

                 msg[index] = '\0'; // Throw away any incomplete packet

           }

           //End the message when the '>' symbol is received

           else if(incomingByte == '>')

           {

                 ended = true;

                 break; // Done reading - exit from while loop!

           }

           //Read the message!

           else

           {

                 if(index < 4) // Make sure there is room

                 {

                   msg[index] = incomingByte; // Add char to array

                   index++;

                   msg[index] = '\0'; // Add NULL to end

                 }

           }

     }

 

 if(started && ended)

 {

   int value = atoi(msg);

   analogWrite(ledPin, value);

   //Serial.println(value); //Only for debugging

   index = 0;

   msg[index] = '\0';

   started = false;

   ended = false;

 }


}





XBee와 Arduino의 Connection (RX, TX를 어긋나게)

https://cdn.sparkfun.com/assets/4/8/a/0/0/528e6c16757b7f7a5a8b4568.png

PIN20은 Commissioning Button이다.




www.cpuplaza.co.kr 에서
X-CTU 5.1.0.0을 다운받으면 된다.






▼Terminal Tab을 누르고 "+++"를 타이핑하면 바로 OK메세지가 뜨며

Command Mode로 진입하게 된다.


▼AT ID Setting (ATID+Number=Setting // ATID=Verifing)




https://eewiki.net/display/Wireless/XBee+Wireless+Communication+Setup

Step1 : Download X-CTU Software

Step2 : Put together your XBee breakout board

Step3 : Configure 1st XBee as a Coordinator

Step4 : Configure 2nd XBee as a Router

Step5 : Test the configuration
.

.

.

Step3

After selecting the proper COM port click the Test/Query button.

After selecting the Test/Query button, 

you should see a dialogue box like the one below. 

You will want to record the serial number shown as you will need it in a couple minutes.


After recording the serial number you can click OK. 

Next, select the Modem Configuration tab at the top of the window. 

Once here, select the read button. 

This will bring up the current configuration for the connected XBee.


XBP24-ZB는 XBee Pro Series2 모델이다.

Once here, you want to select Zigbee Coordinator AT in the function set drop down menu.

Coordinator, Router, EndDevice가 표시된다.

Function Set에서 Role을 바꿔주고 Write버튼을 눌러주면 Role이 바뀐다.


After selecting the coordinator function set, you will need to set the PAN ID.

This can be any four digit number and allows the XBees to distinguish 

between modules in their network and those from other networks.

Once you have added the wanted PAN ID click the "Write" button. This will update and configure the XBee.

Once this is done you can disconnect the XBee and plug in the second XBee.


Step4

To configure the 2nd XBee, 

you will follow the same process as for the coordinator with one difference.

In the PC settings tab, again, click the "Test/Query" button and record the serial number.

Then in the Modem configuration tab, click the read button to load the current configuration of the XBee and set the PAN ID to the same ID used for the coordinator. The only change will be the function set you choose.

For the second XBee we will set this as Zigbee Router AT.



After setting the PAN ID and the function set for the router 

you will put the recorded serial numbers to use.

Enter the first 6 digits of the coordinators serial number 

into the Destination Address High  field 

and the rest of the serial number 

into the Destination Address Low field.

13A200 + 40318C1A

Then select the "Write" button to update the configuration settings for the router.

Once this is done updating you can disconnect the router and reconnect the coordinator to the computer.


After re-connecting the coordinator to the computer, 

you will again go into the Modem Configuration tab and click the read button. 

You will then want to set the Destination Address to the serial number of the Router XBee in the same manner as you just did for the Router.

Coordinator와 Rounter간의 Serial Number를 서로 지목해준다.

Router의 Serial Number는 13A200+40318C3D 이다.

Once done you will again click the write button to update the coordinator XBee settings.

After the write process is complete you are ready to use your XBees and communicate wirelessly!


Step5

A simple test can be done to be sure the two XBees are communicating properly.

You can connect either one of the XBees to the computer.

Then, connect the second XBee to 3.3V power and connect the Dout and Din pins together.

This will cause the XBee to automatically retransmit any data it receives.




When you have both XBees connected go to the Terminal tab in the X-CTU window. 

Whatever you type in the terminal 

window will appear in blue font 

and whatever is received will appear in red font.

If the XBees are configured correctly every character you type should be mirrored in red.




When typing single characters, you should see a screen similar to the one above. 

To send strings of data you can assemble a data packet. 

To do this click the "Assemble Packet" button and type the wanted string into the box then click send data. 

This will send the entire packet before receiving the same packet back.



If everything you type is being reflected back in red, you are successfully transmitting and receiving with your XBees!! You are now ready to use them however you wish. 

You can connect them to any microcontroller and transmit data through the UART peripheral or you can connect each XBee to a different computer and have a chat application.  There are many more possibilities that are now at your fingertips with your working XBees.






연결하기전에 FTDI Driver부터 설치해줘야 한다.

http://instructables.tistory.com/107




포트를 맞춰주고 + 버튼을 누르면 Seeking 한다.


Action Required 메세지가 뜬다면 Reset버튼을 눌러준다.

(아래 메세지가 뜨면 안좋은 조짐이다.)





CTRL+Shift+D == 모듈 확인 단축키이다.

▼XBee S2 시리즈일때 아래 이미지가 뜬다.

▼XBee S1 Router일때


▼XBee S1 End Device 일때



XBee S1 Router의 Setting먼저 해보도록하겠다.

하단의 Add selected devices 버튼을 누른다.


https://www.digi.com/support/forum/45837/configure-series-xbee-router-between-devices-coordinator

Q:: How can I configure an Series 1 Xbee to act as a Router between End Device and a Coordinator?

A:: That is not possible. In the 802.15.4 protocol there are only two roles: coordinator and end device.

If you want to have routers, you should use other protocol like ZigBee (XBee Series 2).


▼Serial Number Setting할때 (Coordinator와 Router의 SerialNumber를 서로 지목해주면 된다.)

SerialNumber는 DH DL로 구성되있으며 각각 MSB, LSB이다.

https://alselectro.wordpress.com/2014/09/07/xbee-s2digital-sampling-with-api-frame-data/






▼뭔가 잘못됬을때






Posted by ElectricShock
:
BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
Programming(=프로그래밍) (3)
MiDi (2)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백