I need code to get data from a sensor via Raven X

Hello all.

Somebody had a Perl script that was able to do this successfully but we cannot get our hands on the code (long story). We have a probe/sensor that’s attached to a Raven X’s serial port. I believe that they used the pass through mode on the Raven. I have a decent amount of experience with consuming data via HTTP request using php scripts, but I’ve never gone through a modem, gateway or serial ports.

I need a way to programmatically:

  1. connect to the Raven from a remote computer via it’s IP address. We have a way to determine the IP via DSN. We’re using a cheap tablet plan for the cell service and therefore we can’t connect via phone number
  2. connect to the probe. As I mentioned, I believe they used pass through mode on the Rave in the past. I don’t fully understand these concepts.
  3. send an AT command to the probe. I’ve never used AT commands and could use some detailed help here. I believe the most of the needed documentation is on pages 9 and 10 of this sensor’s documentation: s.campbellsci.com/documents/us/m … -cs455.pdf
  4. consume the string that’s returned and parse it. I can handle this part – it’s a pretty simple string

Then I’ll connect to our database and insert the data. I’m comfortable doing this in a number of languages. The Perl code is straight forward

While the original, successful code was done using Perl, I’d prefer to use php. But from what I’ve read it sounds like php isn’t quite designed for this stuff. Python is another option. VB.net,C#,C,C++ are not options as our current web host doesn’t support cron jobs in these languages. Like I said, I’ll make do with Perl if needed. It also be nice to get some thorough examples of how to do this.

Thanks for your time. I’m really stumped on how to do this as I’ve never faced this kind of data transfer.


I would suggest going through your reseller or distributor as they should be able to help. On the Raven X side you will probably need to do some change some serial settings (baud rate, TCP/UDP auto answer, device port or the even the serial startup mode), a template of the proper settings should be available through your reseller.