Home/Support/Support Forum/RE: Wireless Connectivity Kit/XBee

RE: Wireless Connectivity Kit/XBee

0 votes
Hello,

Me again...I was using NetBeans and this file: https://github.com/digidotcom/XBeeJavaLibrary/releases.

I am also using the THT Grove Development Boards. I have an i2c attached (barometer) via Grove Connection. I am trying to get NetBeans to read that software but I am coming up empty.

I tried java -version on Windows but there was no input relating to 32 or 64 bit. So, I tried both.

I also tried multiple paths starting with C:\. What would you do? Please send guidance and/or feedback.

Seth

P.S. If you are interested, please view the error/output:

run:
+
+
| Receive Digital Data Sample |
+
+

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at com.digi.xbee.api.connection.serial.SerialPortRxTx.open(SerialPortRxTx.java:165)
at com.digi.xbee.api.XBeeDevice.open(XBeeDevice.java:334)
at com.digi.xdmk.receivedigitaldata.MainApp.main(MainApp.java:54)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

From:

/**
* Copyright (c) 2015 Digi International Inc.,
* All rights not expressly granted are reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
* =======================================================================
*/
package com.digi.xdmk.receivedigitaldata;

import com.digi.xbee.api.RemoteXBeeDevice;
import com.digi.xbee.api.XBeeDevice;
import com.digi.xbee.api.exceptions.XBeeException;
import com.digi.xbee.api.io.IOLine;
import com.digi.xbee.api.io.IOSample;
import com.digi.xbee.api.io.IOValue;
import com.digi.xbee.api.listeners.IIOSampleReceiveListener;

/**
* XBee-PRO 900HP DigiMesh Kit Receive Digital Data Sample application.
*
* <p>This sample Java application shows how to receive digital data from
* another XBee device on the same network using the XBee Java Library.</p>
*/
public class MainApp {

/* Constants */

// TODO Replace with the port where your receiver module is connected.
private static final String PORT = "COM1";
// TODO Replace with the baud rate of your receiver module.
private static final int BAUD_RATE = 9600;
// Digital line to monitor.
private static final IOLine LINE = IOLine.DIO4_AD4;
// Digital sample listener.
private static DigitalSampleListener listener = new DigitalSampleListener();

/**
* Application main method.
*
* @param args Command line arguments.
*/
public static void main(String[] args) {
System.out.println("+
+");
System.out.println("| Receive Digital Data Sample |");
System.out.println("+
+\n");

XBeeDevice myDevice = new XBeeDevice(PORT, BAUD_RATE);

try {
myDevice.open();

System.out.println("\nListening for IO samples... Press the user button of any remote device.\n");

myDevice.addIOSampleListener(listener);

} catch (XBeeException e) {
e.printStackTrace();
myDevice.close();
System.exit(1);
}
}

/**
* Class to manage the received IO data.
*/
private static class DigitalSampleListener implements IIOSampleReceiveListener {
@Override
public void ioSampleReceived(RemoteXBeeDevice remoteDevice, IOSample ioSample) {
if (ioSample.hasDigitalValue(LINE)) {
IOValue value = ioSample.getDigitalValue(LINE);
System.out.println("Digital data from '" + remoteDevice.get64BitAddress() +
"': " + value + " (" +
(value == IOValue.HIGH ? "button released" : "button pressed") + ")");
}
}
}
}
asked Oct 9, 2017 in Interface/Development Boards by silver2row New to the Community (11 points)

Please log in or register to answer this question.

1 Answer

+1 vote
 
Best answer
First off, the XBee module does not have an I2C interface in which to connect an I2C sensor to.

Next, any data from the Grove board and XBee module would be sent in via the COM port in which Windows Assigned to USB port to.
answered Oct 9, 2017 by mvut Veteran of the Digi Community (11,393 points)
selected Oct 9, 2017 by silver2row
Hello,

Thank you. I thought this THT Grove board had an i2c connection. I can read i2c on the THT board. DIO1 is wehre the listing for the i2c is located.

Well, I am going to listen to your post about the processor. I will attach it to the BeagleBone Black and reply. I am sure I will have sorts of questions.

Seth

P.S. Thank you for your reply.
...