EnviroDIY / Arduino-SDI-12

An Arduino library for SDI-12 communication with a wide variety of environmental sensors. This library provides a general software solution, without requiring any additional hardware.
https://github.com/EnviroDIY/Arduino-SDI-12/wiki
BSD 3-Clause "New" or "Revised" License
159 stars 100 forks source link

How to use this library along with xbee-arduino library #38

Closed lilcano closed 6 years ago

lilcano commented 6 years ago

Hello,

I am new to the Arduino platform, i have used the Arduino SDI-12 library to get data from 5TM soil sensors. I am trying to send the data via Xbee to my computer connected with another Xbee as coordinator. I cant seam to see the data at the computer. I am wondering can it have to deal with the serial interface used by both the SDI12 sensor and the Xbee for communication? am i to use an Arduino with two serial interfaces like the Leonardo or may be use the Software serial library with arduino Uno? Please if there are some specific steps needed to get the library to work with Xbee radios let me know thanks.

SRGDamia1 commented 6 years ago

This library definitely works on both Leonardo's and Unos and either can be used to send data over XBee networks.

The SDI-12 bus created by this library is not a standard serial port, it's an SDI-12 bus. The SDI-12 bus uses a single wire for communication and only works at 1200 baud. XBee's do NOT communicate over SDI-12. They use a standard two-wire UART port and can be configured for a range of baud rates. Some XBee's can also communicate over and SPI line. XBee's and SDI-12 devices simply cannot communicate directly with each other and they cannot communicate with any processor on the same set of wires. Use a UART (Serial) port for communicating with the XBee and another pin that supports pin change interrupts for the SDI-12 bus. This library WILL conflict with SoftwareSerial (see #8), so do not use that to communicate with your XBee. If a software-emulated serial port is your only option, stick to AltSoftSerial instead.