Usiing SDI12_T3-master library for Teensy4.1 board

danieltsz

Active member
hi, I'm trying to connect some SDi-12 sensors to teensy4.1 board and I found this library https://github.com/duff2013/SDI12_T3

The problem is when compiling the example program provided, I got this error code 'KINETISK_UART_t' does not name a type

I think this library only works for Teensy3.x board so how can I use this library for Teensy4.x board?
 

Attachments

  • Capture.PNG
    Capture.PNG
    18.5 KB · Views: 19
As you mentioned, this library has not been updated to run on Teensy 4.x boards. As far as I can tell he is no longer active with this stuff.

That is, I don't think he has logged into this forum for maybe two and a half years. And likewise, it looks like he has not done anything up on github for a very long time either.

Not sure what your best bet is. Try to modify that library or look for another one, like maybe:
https://github.com/EnviroDIY/Arduino-SDI-12

But I don't know if that will work on a teeny or not...
 
Hi sir Kurt, the library you mentioned is the one I use for my Arduino project. Now I am porting my program to Teensy4.1, but I can't make that library work because the Teensy board is still unsupported. I guess I'll try to modify the library but it will take some time and I'm not sure if it will work.
 
I took a quick look through it, and it looks like it would take a bit of work to add T4.x support to it in the same manner as the current code.

But wondering if a lot of that can be simplified... In particular, it simply looks like it is doing half duplex serial over the TX pin. The main Teensy UART code has that support built in now.
I will try to do some quick hacking to see how hard it would be to build using it... But I have no hardware to test it out...

If I get something that builds, I will post it here...
 
I'd try to modify the EnviroDIY library, But I don't know if that is as simple as that.

I don't know how to upload a zip file here of the library, but I just modified it to include Teensy4.1 board defined(__IMXRT1062__) and PCINT0_vect for the Pin change interrupt.

Tomorrow I will try to connect one SDI-12 sensor and test if I can read some output.
 
I don't know if you can see this but these are the four files I'd modify. I'm so sorry I'm just a novice programmer so I don't know if I am doing it correctly.
 

Attachments

  • SDI12.h
    36.8 KB · Views: 9
  • SDI12.cpp
    26.7 KB · Views: 8
  • SDI12_boards.cpp
    10.4 KB · Views: 9
  • SDI12_boards.h
    14.7 KB · Views: 7
Probably needs someone who have the devices to actually try them out.
It looks like it is not using Serial objects, but is bit banging it. Which might work...

I was doing some quick test to see if T4.x could go as low as 1200 baud. It appears to work. But I think I was seeing
that the protocol is 7E1 Inverted half duplex.

And then I remembered from another thread the current serial code has issue with inverted half duplex on we setup the TX to be PU and needs to be PD.
https://forum.pjrc.com/threads/72740-Serial-Half-Duplex-Support

I have hacked up a version of the 4.x Serial to handle that....

May issue PR back to PaulStoffregen for this. Not sure if or how long it will be before pulled in. And when a release...
I may also do for T3.x, but more a PIA as there are something like 8 copies of the same code in the teensy3 cores.
 
Thank you very much. This week I will try to connect one SDI-12 sensor and test if I can read some output and reply to this thread again for the output.
 
Back
Top