Initial commit

parents
Showing with 1634 additions and 0 deletions
## Example files for the title:
# Building Wireless Sensor Networks, by Robert Faludi
[![Building Wireless Sensor Networks, by Robert Faludi](http://akamaicovers.oreilly.com/images/9780596807733/cat.gif)](https://www.safaribooksonline.com/library/view/title/780596807757//)
The following applies to example files from material published by O’Reilly Media, Inc. Content from other publishers may include different rules of usage. Please refer to any additional usage rights explained in the actual example files or refer to the publisher’s website.
O'Reilly books are here to help you get your job done. In general, you may use the code in O'Reilly books in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from our books does not require permission. Answering a question by citing our books and quoting example code does not require permission. On the other hand, selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Incorporating a significant amount of example code from our books into your product's documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN.
If you think your use of code examples falls outside fair use or the permission given here, feel free to contact us at <permissions@oreilly.com>.
Please note that the examples are not production code and have not been carefully testing. They are provided "as-is" and come with no warranty of any kind.
/*
* *********XBee Internet Gateway Light Example********
* by Rob Faludi http://faludi.com
* rewritten for St. Ann's http://saintannsny.org
*/
#define NAME "XIG Light Example"
#define VERSION "1.10"
#define LED_PIN 13
int outputLight = 12;
int lightState;
void setup() {
pinMode(LED_PIN,OUTPUT);
pinMode(outputLight,OUTPUT);
blinkLED(LED_PIN,2,100);
blinkLED(outputLight,2,100);
Serial.begin(115200); // faster is better for XIG
delay(2000);
}
void loop() {
if (millis() % 1000 == 0) { // wait a second before sending the next request
// request the current light state, set with zig_light_form_example.php
Serial.println("<YOUR-SERVER-HERE>/lightSetting.txt");
}
if (Serial.available() > 0) { // if there's a byte waiting
lightState = Serial.read(); // read the ASCII numeral byte
// turn on the light if the response is 1, or off if the response is zero
if (lightState == '0' || lightState=='1') {
lightState=lightState-48; // transform ASCII into an integer
digitalWrite(outputLight, lightState);
}
}
}
////////////////// UTILITIES //////////////////
// this function blinks the an LED light as many times as requested, at the requested blinking rate
void blinkLED(byte targetPin, int numBlinks, int blinkRate) {
for (int i=0; i<numBlinks; i++) {
digitalWrite(targetPin, HIGH); // sets the LED on
delay(blinkRate); // waits for blinkRate milliseconds
digitalWrite(targetPin, LOW); // sets the LED off
delay(blinkRate);
}
}
/*
* *********XBee Internet Gateway Upload Example********
* by Rob Faludi http://faludi.com
*/
#define NAME "XIG Upload Example"
#define VERSION "1.00"
#define LED_PIN 13
int inputPin = 0;
void setup() {
pinMode(LED_PIN,OUTPUT);
blinkLED(LED_PIN,2,100);
Serial.begin(115200); // faster is better for XIG
delay(2000);
}
void loop() {
// read the analog pin
int value = analogRead(inputPin);
// upload the current value to the server, it will be stored in a dataFile.txt
Serial.print("<YOUR-SERVER-HERE>/xig_upload_example.php?value=");
Serial.println(value, DEC);
// wait a second between uploads
delay(1000);
blinkLED(LED_PIN,1,100);
}
////////////////// UTILITIES //////////////////
// this function blinks the an LED light as many times as requested, at the requested blinking rate
void blinkLED(byte targetPin, int numBlinks, int blinkRate) {
for (int i=0; i<numBlinks; i++) {
digitalWrite(targetPin, HIGH); // sets the LED on
delay(blinkRate); // waits for blinkRate milliseconds
digitalWrite(targetPin, LOW); // sets the LED off
delay(blinkRate);
}
}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
/*
* ********* Doorbell Basic BELL ********
* requires pre-paired XBee Radios
* and the BUTTON program on the receiving end
* by Rob Faludi http://faludi.com
*/
#define VERSION "1.00a0"
int BELL = 5;
void setup() {
pinMode(BELL, OUTPUT);
Serial.begin(9600);
}
void loop() {
// look for a capital D over the serial port and ring the bell if found
if (Serial.available() > 0) {
if (Serial.read() == 'D'){
//ring the bell briefly
digitalWrite(BELL, HIGH);
delay(10);
digitalWrite(BELL, LOW);
}
}
}
/*
* ********* Doorbell Basic BUTTON ********
* requires pre-paired XBee Radios
* and the BELL program on the receiving end
* by Rob Faludi http://faludi.com
*/
#define VERSION "1.00a0"
int BUTTON = 2;
void setup() {
pinMode(BUTTON, INPUT);
Serial.begin(9600);
}
void loop() {
// send a capital D over the serial port if the button is pressed
if (digitalRead(BUTTON) == HIGH) {
Serial.print('D');
delay(10); // prevents overwhelming the serial port
}
}
/*
* ********* Doorbell Feedback BELL ********
* requires pre-paired XBee Radios
* and the BUTTON program on the receiving end
* by Rob Faludi http://faludi.com
*/
#define VERSION "1.00a0"
int BELL = 5;
void setup() {
pinMode(BELL, OUTPUT);
Serial.begin(9600);
}
void loop() {
// look for a capital D over the serial port and ring the bell if found
if (Serial.available() > 0) {
if (Serial.read() == 'D'){
//send feedback that the message was received
Serial.print('K');
//ring the bell briefly
digitalWrite(BELL, HIGH);
delay(10);
digitalWrite(BELL, LOW);
}
}
}
/*
* ********* Doorbell Feedback BUTTON ********
* requires pre-paired XBee Radios
* and the BELL program on the receiving end
* by Rob Faludi http://faludi.com
*/
#define VERSION "1.00a0"
int BUTTON = 2;
int LED = 11;
void setup() {
pinMode(BUTTON, INPUT);
pinMode(LED, OUTPUT);
Serial.begin(9600);
}
void loop() {
// send a capital D over the serial port if the button is pressed
if (digitalRead(BUTTON) == HIGH) {
Serial.print('D');
delay(10); // prevents overwhelming the serial port
}
// if a capital K is received back, light the feedback LED
if (Serial.available() > 0 ) {
if (Serial.read() == 'K') {
digitalWrite(LED, HIGH);
}
}
// when the button is released, turn off the LED
if (digitalRead(BUTTON) == LOW) {
digitalWrite(LED, LOW);
}
}
/*
* *********ROMANTIC LIGHTING SENSOR WITH FEEDBACK********
* detects whether your lighting is
* setting the right mood and shows
* you the results on the sensor module
* USES PREVIOUSLY PAIRED XBEE ZB RADIOS
* by Rob Faludi http://faludi.com
*/
/*
*** CONFIGURATION ***
SENDER: (REMOTE SENSOR RADIO)
ATID3456 (PAN ID)
ATDH -> set to SH of partner radio
ATDL -> set to SL of partner radio
ATJV1 -> rejoin with coordinator on startup
ATD02 pin 0 in analog in mode with a photo resistor (don't forget the voltage divider circuit--resistor to ground is good)
ATD14 pin 1 in digital output (default low) mode with an LED from that pin to ground
ATIR64 sample rate 100 millisecs (hex 64)
* THE LOCAL RADIO _MUST_ BE IN API MODE *
RECEIVER: (LOCAL RADIO)
ATID3456 (PAN ID)
ATDH -> set to SH of partner radio
ATDL -> set to SL of partner radio
*/
#define VERSION "1.02"
int LED = 11;
int debugLED = 13;
int analogValue = 0;
int remoteIndicator = false; // keeps track of the desired remote on/off state
int lastRemoteIndicator = false; // record of prior remote state
unsigned long lastSent = 0; // records last time the remote was re-set to keep it in sync
void setup() {
pinMode(LED,OUTPUT);
pinMode(debugLED,OUTPUT);
Serial.begin(9600);
}
void loop() {
// make sure everything we need is in the buffer
if (Serial.available() >= 23) {
// look for the start byte
if (Serial.read() == 0x7E) {
//blink debug LED to indicate when data is received
digitalWrite(debugLED, HIGH);
delay(10);
digitalWrite(debugLED, LOW);
// read the variables that we're not using out of the buffer
// (includes two more for the digital pin report)
for (int i = 0; i<20; i++) {
byte discard = Serial.read();
}
int analogHigh = Serial.read();
int analogLow = Serial.read();
analogValue = analogLow + (analogHigh * 256);
}
}
/*
* The values in this section will probably
* need to be adjusted according to your
* photoresistor, ambient lighting and tastes.
* For example, if you find that the darkness
* threshold is too dim, change the 350 value
* to a larger number.
*/
// darkness is too creepy for romance
if (analogValue > 0 && analogValue <= 350) {
digitalWrite(LED, LOW);
remoteIndicator = false;
}
// medium light is the perfect mood for romance
if (analogValue > 350 && analogValue <= 750) {
digitalWrite(LED, HIGH);
remoteIndicator = true;
}
// bright light kills the romantic mood
if (analogValue > 750 && analogValue <= 1023) {
digitalWrite(LED, LOW);
remoteIndicator = false;
}
// set the indicator immediately when there's a state change
if (remoteIndicator != lastRemoteIndicator) {
if (remoteIndicator==false) setRemoteState(0x4);
if (remoteIndicator==true) setRemoteState(0x5);
lastRemoteIndicator = remoteIndicator;
}
// re-set the indicator occasionally in case it's out of sync
if (millis() - lastSent > 10000 ) {
if (remoteIndicator==false) setRemoteState(0x4);
if (remoteIndicator==true) setRemoteState(0x5);
lastSent = millis();
}
}
void setRemoteState(int value) { // pass either a 0x4 or and 0x5 to turn the pin on or off
Serial.print(0x7E, BYTE); // start byte
Serial.print(0x0, BYTE); // high part of length (always zero)
Serial.print(0x10, BYTE); // low part of length (the number of bytes that follow, not including checksum)
Serial.print(0x17, BYTE); // 0x17 is a remote AT command
Serial.print(0x0, BYTE); // frame id set to zero for no reply
// ID of recipient, or use 0xFFFF for broadcast
Serial.print(00, BYTE);
Serial.print(00, BYTE);
Serial.print(00, BYTE);
Serial.print(00, BYTE);
Serial.print(00, BYTE);
Serial.print(00, BYTE);
Serial.print(0xFF, BYTE); // 0xFF for broadcast
Serial.print(0xFF, BYTE); // 0xFF for broadcast
// 16 bit of recipient or 0xFFFE if unknown
Serial.print(0xFF, BYTE);
Serial.print(0xFE, BYTE);
Serial.print(0x02, BYTE); // 0x02 to apply changes immediately on remote
// command name in ASCII characters
Serial.print('D', BYTE);
Serial.print('1', BYTE);
// command data in as many bytes as needed
Serial.print(value, BYTE);
// checksum is all bytes after length bytes
long sum = 0x17 + 0xFF + 0xFF + 0xFF + 0xFE + 0x02 + 'D' + '1' + value;
Serial.print( 0xFF - ( sum & 0xFF) , BYTE ); // calculate the proper checksum
delay(10); // safety pause to avoid overwhelming the serial port (if this function is not implemented properly)
}
/*
* *********ROMANTICLIGHTING SENSOR ********
* detects whether your lighting is
* setting the right mood
* USES PREVIOUSLY PAIRED XBEE ZB RADIOS
* by Rob Faludi http://faludi.com
*/
/*
*** CONFIGURATION ***
SENDER: (REMOTE SENSOR RADIO)
ATID3456 (PAN ID)
ATDH -> set to SH of partner radio
ATDL -> set to SL of partner radio
ATJV1 -> rejoin with coordinator on startup
ATD02 pin 0 in analog in mode
ATIR64 sample rate 100 millisecs (hex 64)
* THE LOCAL RADIO _MUST_ BE IN API MODE *
RECEIVER: (LOCAL RADIO)
ATID3456 (PAN ID)
ATDH -> set to SH of partner radio
ATDL -> set to SL of partner radio
*/
#define VERSION "1.02"
int LED = 11;
int debugLED = 13;
int analogValue = 0;
void setup() {
pinMode(LED,OUTPUT);
pinMode(debugLED,OUTPUT);
Serial.begin(9600);
}
void loop() {
// make sure everything we need is in the buffer
if (Serial.available() >= 21) {
// look for the start byte
if (Serial.read() == 0x7E) {
//blink debug LED to indicate when data is received
digitalWrite(debugLED, HIGH);
delay(10);
digitalWrite(debugLED, LOW);
// read the variables that we're not using out of the buffer
for (int i = 0; i<18; i++) {
byte discard = Serial.read();
}
int analogHigh = Serial.read();
int analogLow = Serial.read();
analogValue = analogLow + (analogHigh * 256);
}
}
/*
* The values in this section will probably
* need to be adjusted according to your
* photoresistor, ambient lighting and tastes.
* For example, if you find that the darkness
* threshold is too dim, change the 350 value
* to a larger number.
*/
// darkness is too creepy for romance
if (analogValue > 0 && analogValue <= 350) {
digitalWrite(LED, LOW);
}
// medium light is the perfect mood for romance
if (analogValue > 350 && analogValue <= 750) {
digitalWrite(LED, HIGH);
}
// bright light kills the romantic mood
if (analogValue > 750 && analogValue <= 1023) {
digitalWrite(LED, LOW);
}
}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
#log4j.rootCategory=DEBUG, main-appender
log4j.logger.com.rapplogic.xbee.examples=DEBUG, main-appender
log4j.logger.com.rapplogic.xbee.api=WARN, main-appender
log4j.logger.com.rapplogic.xbee.transparent=WARN, main-appender
log4j.logger.com.rapplogic.xbee.RxTxSerialComm=WARN, main-appender
log4j.logger.com.rapplogic.xbee=WARN, console-appender
log4j.appender.main-appender=org.apache.log4j.RollingFileAppender
log4j.appender.main-appender.File=XBee.log
log4j.appender.main-appender.Append=true
log4j.appender.main-appender.MaxFileSize=10MB
log4j.appender.main-appender.MaxBackupIndex=100
log4j.appender.main-appender.ImmediateFlush=true
log4j.appender.main-appender.layout=org.apache.log4j.PatternLayout
log4j.appender.main-appender.layout.ConversionPattern=[%d] [%t] [%p] [%c] %m %n
log4j.appender.console-appender=org.apache.log4j.ConsoleAppender
log4j.appender.console-appender.layout=org.apache.log4j.PatternLayout
log4j.appender.console-appender.layout.ConversionPattern=[%d] [%t] [%p] [%c] %m %n
\ No newline at end of file
No preview for this file type
No preview for this file type
Please use Processing version 1.5.1 with this code! There have been changes to more recent versions of Processing and unfortunately updating code cannot address them, as it's an issue with a supporting library.
Luckily Processing version 1.5.1 should continue to work just fine. You can download it from here:
https://processing.org/download/?processing
March 4, 2014
faludi.com/bwsn
\ No newline at end of file
/*
* Draws a set of thermometers for incoming XBee Sensor data
* by Rob Faludi http://faludi.com
*/
// used for communication via xbee api
import processing.serial.*;
// xbee api libraries available at http://code.google.com/p/xbee-api/
// Download the zip file, extract it, and copy the xbee-api jar file
// and the log4j.jar file (located in the lib folder) inside a "code"
// folder under this Processing sketch’s folder (save this sketch, then
// click the Sketch menu and choose Show Sketch Folder).
import com.rapplogic.xbee.api.ApiId;
import com.rapplogic.xbee.api.PacketListener;
import com.rapplogic.xbee.api.XBee;
import com.rapplogic.xbee.api.XBeeResponse;
import com.rapplogic.xbee.api.zigbee.ZNetRxIoSampleResponse;
String version = "1.11";
// *** REPLACE WITH THE SERIAL PORT (COM PORT) FOR YOUR LOCAL XBEE ***
String mySerialPort = "/dev/tty.usbserial-A1000iMG";
// create and initialize a new xbee object
XBee xbee = new XBee();
int error=0;
// make an array list of thermometer objects for display
ArrayList thermometers = new ArrayList();
// create a font for display
PFont font;
void setup() {
size(800, 600); // screen size
smooth(); // anti-aliasing for graphic display
// You’ll need to generate a font before you can run this sketch.
// Click the Tools menu and choose Create Font. Click Sans Serif,
// choose a size of 10, and click OK.
font = loadFont("SansSerif-10.vlw");
textFont(font); // use the font for text
// The log4j.properties file is required by the xbee api library, and
// needs to be in your data folder. You can find this file in the xbee
// api library you downloaded earlier
PropertyConfigurator.configure(dataPath("log4j.properties"));
// Print a list in case the selected one doesn't work out
println("Available serial ports:");
println(Serial.list());
try {
// opens your serial port defined above, at 9600 baud
xbee.open(mySerialPort, 9600);
}
catch (XBeeException e) {
println("** Error opening XBee port: " + e + " **");
println("Is your XBee plugged in to your computer?");
println("Did you set your COM port in the code near line 20?");
error=1;
}
}
// draw loop executes continuously
void draw() {
background(224); // draw a light gray background
// report any serial port problems in the main window
if (error == 1) {
fill(0);
text("** Error opening XBee port: **\n"+
"Is your XBee plugged in to your computer?\n" +
"Did you set your COM port in the code near line 20?", width/3, height/2);
}
SensorData data = new SensorData(); // create a data object
data = getData(); // put data into the data object
//data = getSimulatedData(); // uncomment this to use random data for testing
// check that actual data came in:
if (data.value >=0 && data.address != null) {
// check to see if a thermometer object already exists for this sensor
int i;
boolean foundIt = false;
for (i=0; i <thermometers.size(); i++) {
if ( ((Thermometer) thermometers.get(i)).address.equals(data.address) ) {
foundIt = true;
break;
}
}
// *** ENABLE THIS CODE FOR LM335 temperature sensor ****
// process the data value into a Celsius temperature reading for
// LM335 with a 1/3 voltage divider
// (value as a ratio of 1023 times max ADC voltage times
// 3 (voltage divider value) divided by 10mV per degree
// minus zero Celsius in Kevin)
float temperatureCelsius = (data.value/1023.0*1.2*3.0*100)-273.15;
// // *** ENABLE THIS CODE FOR TMP36 temperature sensor ****
// // process the data value into a Celsius temperature reading for
// // TMP36 with no voltage divider
// // (value as a ratio of 1023 times max ADC voltage times
// // minus 500 mV reading at zero Celsius
// // times 100 to scale for 10mv per degree C)
// float temperatureCelsius = ((data.value/1023.0*1.25 - .5) *100);
println(" temp: " + round(temperatureCelsius) + "˚C");
// update the thermometer if it exists, otherwise create a new one
if (foundIt) {
((Thermometer) thermometers.get(i)).temp = temperatureCelsius;
}
else if (thermometers.size() < 10) {
thermometers.add(new Thermometer(data.address,35,450,
(thermometers.size()) * 75 + 40, 20));
((Thermometer) thermometers.get(i)).temp = temperatureCelsius;
}
// draw the thermometers on the screen
for (int j =0; j<thermometers.size(); j++) {
((Thermometer) thermometers.get(j)).render();
}
}
} // end of draw loop
// defines the data object
class SensorData {
int value;
String address;
}
// defines the thermometer objects
class Thermometer {
int sizeX, sizeY, posX, posY;
int maxTemp = 40; // max of scale in degrees Celsius
int minTemp = -10; // min of scale in degress Celcisu
float temp; // stores the temperature locally
String address; // stores the address locally
Thermometer(String _address, int _sizeX, int _sizeY,
int _posX, int _posY) { // initialize thermometer object
address = _address;
sizeX = _sizeX;
sizeY = _sizeY;
posX = _posX;
posY = _posY;
}
void render() { // draw thermometer on screen
noStroke(); // remove shape edges
ellipseMode(CENTER); // center bulb
float bulbSize = sizeX + (sizeX * 0.5); // determine bulb size
int stemSize = 30; // stem augments fixed red bulb
// to help separate it from moving mercury
// limit display to range
float displayTemp = round( temp);
if (temp > maxTemp) {
displayTemp = maxTemp + 1;
}
if ((int)temp < minTemp) {
displayTemp = minTemp;
}
// size for variable red area:
float mercury = ( 1 - ( (displayTemp-minTemp) / (maxTemp-minTemp) ));
// draw edges of objects in black
fill(0);
rect(posX-3,posY-3,sizeX+5,sizeY+5);
ellipse(posX+sizeX/2,posY+sizeY+stemSize, bulbSize+4,bulbSize+4);
rect(posX-3, posY+sizeY, sizeX+5,stemSize+5);
// draw grey mercury background
fill(64);
rect(posX,posY,sizeX,sizeY);
// draw red areas
fill(255,16,16);
// draw mercury area:
rect(posX,posY+(sizeY * mercury),
sizeX, sizeY-(sizeY * mercury));
// draw stem area:
rect(posX, posY+sizeY, sizeX,stemSize);
// draw red bulb:
ellipse(posX+sizeX/2,posY+sizeY + stemSize, bulbSize,bulbSize);
// show text
textAlign(LEFT);
fill(0);
textSize(10);
// show sensor address:
text(address, posX-10, posY + sizeY + bulbSize + stemSize + 4, 65, 40);
// show maximum temperature:
text(maxTemp + "˚C", posX+sizeX + 5, posY);
// show minimum temperature:
text(minTemp + "˚C", posX+sizeX + 5, posY + sizeY);
// show temperature:
text(round(temp) + " ˚C", posX+2,posY+(sizeY * mercury+ 14));
}
}
// used only if getSimulatedData is uncommented in draw loop
//
SensorData getSimulatedData() {
SensorData data = new SensorData();
int value = int(random(750,890));
String address = "00:13:A2:00:12:34:AB:C" + str( round(random(0,9)) );
data.value = value;
data.address = address;
delay(200);
return data;
}
// queries the XBee for incoming I/O data frames
// and parses them into a data object
SensorData getData() {
SensorData data = new SensorData();
int value = -1; // returns an impossible value if there's an error
String address = ""; // returns a null value if there's an error
try {
// we wait here until a packet is received.
XBeeResponse response = xbee.getResponse();
// uncomment next line for additional debugging information
//println("Received response " + response.toString());
// check that this frame is a valid I/O sample, then parse it as such
if (response.getApiId() == ApiId.ZNET_IO_SAMPLE_RESPONSE
&& !response.isError()) {
ZNetRxIoSampleResponse ioSample =
(ZNetRxIoSampleResponse)(XBeeResponse) response;
// get the sender's 64-bit address
int[] addressArray = ioSample.getRemoteAddress64().getAddress();
// parse the address int array into a formatted string
String[] hexAddress = new String[addressArray.length];
for (int i=0; i<addressArray.length;i++) {
// format each address byte with leading zeros:
hexAddress[i] = String.format("%02x", addressArray[i]);
}
// join the array together with colons for readability:
String senderAddress = join(hexAddress, ":");
print("Sender address: " + senderAddress);
data.address = senderAddress;
// get the value of the first input pin
value = ioSample.getAnalog0();
print(" analog value: " + value );
data.value = value;
}
else if (!response.isError()) {
println("Got error in data frame");
}
else {
println("Got non-i/o data frame");
}
}
catch (XBeeException e) {
println("Error receiving response: " + e);
}
return data; // sends the data back to the calling function
}
No preview for this file type
No preview for this file type
No preview for this file type
#log4j.rootCategory=DEBUG, main-appender
log4j.logger.com.rapplogic.xbee.examples=DEBUG, main-appender
log4j.logger.com.rapplogic.xbee.api=WARN, main-appender
log4j.logger.com.rapplogic.xbee.transparent=WARN, main-appender
log4j.logger.com.rapplogic.xbee.RxTxSerialComm=WARN, main-appender
log4j.logger.com.rapplogic.xbee=WARN, console-appender
log4j.appender.main-appender=org.apache.log4j.RollingFileAppender
log4j.appender.main-appender.File=XBee.log
log4j.appender.main-appender.Append=true
log4j.appender.main-appender.MaxFileSize=10MB
log4j.appender.main-appender.MaxBackupIndex=100
log4j.appender.main-appender.ImmediateFlush=true
log4j.appender.main-appender.layout=org.apache.log4j.PatternLayout
log4j.appender.main-appender.layout.ConversionPattern=[%d] [%t] [%p] [%c] %m %n
log4j.appender.console-appender=org.apache.log4j.ConsoleAppender
log4j.appender.console-appender.layout=org.apache.log4j.PatternLayout
log4j.appender.console-appender.layout.ConversionPattern=[%d] [%t] [%p] [%c] %m %n
\ No newline at end of file
No preview for this file type
No preview for this file type
#log4j.rootCategory=DEBUG, main-appender
log4j.logger.com.rapplogic.xbee.examples=DEBUG, main-appender
log4j.logger.com.rapplogic.xbee.api=WARN, main-appender
log4j.logger.com.rapplogic.xbee.transparent=WARN, main-appender
log4j.logger.com.rapplogic.xbee.RxTxSerialComm=WARN, main-appender
log4j.logger.com.rapplogic.xbee=WARN, console-appender
log4j.appender.main-appender=org.apache.log4j.RollingFileAppender
log4j.appender.main-appender.File=XBee.log
log4j.appender.main-appender.Append=true
log4j.appender.main-appender.MaxFileSize=10MB
log4j.appender.main-appender.MaxBackupIndex=100
log4j.appender.main-appender.ImmediateFlush=true
log4j.appender.main-appender.layout=org.apache.log4j.PatternLayout
log4j.appender.main-appender.layout.ConversionPattern=[%d] [%t] [%p] [%c] %m %n
log4j.appender.console-appender=org.apache.log4j.ConsoleAppender
log4j.appender.console-appender.layout=org.apache.log4j.PatternLayout