Has anyone had success in using the SDI-12 on the Boron or other mesh devices without using a shield?
We came across the electron-sdi12-library and referenced the Electron and Boron pinouts when changing the library's source code to match the pins on the Boron.
Upload the modified library to the Web IDE and add it to our project.
When compiling in the Web IDE, the following errors are returned:
error
lib/electron-sdi12-library/SDI12Master.cpp:79:16: 'Serial4' was not declared in this scope
error
lib/electron-sdi12-library/SDI12Master.cpp:84:16: 'Serial5' was not declared in this scope
error
lib/electron-sdi12-library/SDI12Master.cpp:85:12: 'MO' was not declared in this scope
error
lib/electron-sdi12-library/SDI12Master.cpp:272:17: 'C3' was not declared in this scope
error
lib/electron-sdi12-library/SDI12Master.cpp:275:12: 'MO' was not declared in this scope
error
lib/electron-sdi12-library/SDI12Master.cpp:322:12: 'C3' was not declared in this scope
error
lib/electron-sdi12-library/SDI12Master.cpp:326:12: 'MO' was not declared in this scope
error
lib/electron-sdi12-library/SDI12Master.cpp:361:12: 'MO' was not declared in this scope
Is there a possibility of this library working with the Boron, or will I need to develop one for the Boron based on the SDI-12 specification? If not we are just going to use the already working Arduino for SDI-12 data collection and connect the Boron to it.
The simple answer to your question is that you should be able to port this library easily to your boron by removing the offending lines as shown in the error message.
The complex answer to your question is that SDI-12 is a little finicky – your hardware will need to match whatever the creator of that libraries hardware looked like.
My advice would be to try to get your Boron talking to your SDI-12 sensor via a transceiver chip with simple Serial.print commands and whatnot and go from there.
@Eyeohtee, that library was written for the Electron’s multiple serial ports. It would not take much work to either remove the Electron-specific code or add compiler directives to turn on and off sections of code based on the Particle device type.
@crispy I know this might sound bad, but we didn’t have time to port the library and instead just used an Arduino Nano copy to handle the SDI-12 from our ClimaVUE50 weather station. We parsed it on the Nano and then sent the data to the Boron’s RX pin through a voltage divider. From there it made it to our server. Sorry I couldn’t be of more help on the mesh SDI-12 library.
@crispy, the library is perfectly suited for the Boron. I can clone the repo and make the necessary changes. It also needs to be updated to the v2.0 library format. The testing I will need to leave to you as I don’t have an SDI-12 device to test against.
In looking at the original library posted, it looks like it requires external hardware to be able to do SDI-12. It has been implemented without extra hardware using softwareserial. Does anyone know if softwareserial could work on the boron or do we need to build some external circuitry (or use @Eyeohtee solution)?
@crispy, softwareserial is not possible on the Mesh devices at this time. It will run on the Gen2 devices if @ScruffR’s ParticleSoftSerial is used and adapted.
I need to do SDI-12 on Boron, and am not clear what the answer was to the question of if it was possible. I have a custom board that level shifts to 5V, I just need to know if there’s a lib or if the Electron code can work to send/receive SDI-12 on a GPIO. Right now honestly I’m having timing issues…
Thanks for any help, we chose Boron for the LTE and hope to sell 100s of these a year for telemetry.
In essence the answer was: It should be possible, you may just need to remove the Electron specific stuff from the library and then test whether it actually works.
Since no-one seems to have done the testing, the concept is still to be proven
However, you cannot use any arbitrary GPIO but need to use the UART pins (RX/TX).
A soft-serial approach is no option for exactly that reason.
Thank you for answering. I am confused however about using a UART to talk on a 1-wire data interface, when the UART is 2 wire for RX/TX. I see from @crispy
it looks like it requires external hardware to be able to do SDI-12. It has been implemented without extra hardware using softwareserial
My advice would be to try to get your Boron talking to your SDI-12 sensor via a transceiver chip with simple Serial.print commands and whatnot and go from there.
So I think most of my confusion comes from the multiple ways to skin the cat being talked about, and I'm not sure if some are the same, dependent on each other, or what.
It very helps. I will take this to my people. I already had sdi12 working with Arduino, so I might decide that’s the less troublesome route, to have the Arduino do sdi12 and talk to the boron on the uart
My people talk of the “curse of sdi12” , this seems to be it.
I’m not a fan of SDI-12 either, but its what our customers want . We use it with high-end soil moisture sensors. I wish all these sensors supported MODBUS over RS485.
The PCB we use for this is our “Valve” controller. I’m not opposed to selling you one to prototype on, although we currently have a limited supply. If you’re interested, send me a DM.