Using TRB142 with PPP over RS232 - storing settings permanently

I’m attempting to use the TRB142 together with a Campbell Scientific CR300 datalogger in PPP mode.
The datalogger controls the power to the modem, so it will only be on for the 1-2 minutes a day it takes to send data to our server.

I have set the modem control to full and I can get PPP working when echo is activated (ATE1) - so every time the datalogger powers up the modem it will send ATE1, and without this command PPP is not working for me.

The problem is that the power consumption remains high (10x the expected) when the datalogger is idle and modem is shut down, and as far as I can tell its caused by the RS232 port remaining active. Power consumption is critical for this application. Without the echo command the power consumption is low and as expected for idle sleep. I have previously configured similar setups with other modems over RS232 (Maestro/Lantronix M100 and M114) where this has not been an issue - but in these cases the datalogger does not need to send ATE1 inside the modem power up routine as its always active.

Is there a way to set the TRB142 to always echo and storing this setting permanently so it remains after powering down the modem? Being a novice at this, I also appreciate other tips on how to solve this (i.e. proper setup of PPP with Campbell dataloggers with TRB142).

This topic was automatically closed after 15 days. New replies are no longer allowed.

Hello,

We apologize for a late response.
To clarify, it seems you would like the modem to retain the ATE1 setting from boot. If RS232 is configured in full modem control mode, you can achieve this by using the AT&W command to save the following settings:

ATE
ATQ
ATS0
ATS7
ATS10
ATS12
ATV
ATX
AT&C
AT&D
AT+IPR
AT+CREG
AT+CGREG
AT+CEREG

Additionally, the ATZ command can be used to save these parameters:

ATE
ATQ
ATS0
ATS7
ATS10
ATS12
ATV
ATX
AT&C
AT&D
AT+CREG
AT+CGREG
AT+CEREG

Therefore, running the following commands in the RS232 modem console should be sufficient:

ATE1
AT&W

Let me know if any additional help is needed!

Best regards,

And as for establishing a PPP connection, as well as other useful information, I’d like to send you a manual.
I’ve sent you a form to fill out. Once you fill it out, I will contact you and provide the manual. Please use 5813 as the ticket ID. Thanks!

Best regards,

Hi All.

I’m trying to do pretty much the same thing and have created a new thread here.

PPP Help: Connect Campbell Scientific CR350 via TRB142 to MQTT Server.

I don’t suppose either of you guys could contact me and help me out.
I can’t seem to figure out how to chat or message in this forum.

Thanks
Gareth

Thanks @Daumantas - I eventually did get it working back in May, and part of what was done/tested was the ATE1 and AT&W. Great to have this list of settings and how to store them.

Not sure if the problems I had were only due to the modem, or also just how the datalogger works (and the biggest issue probably being my limited understanding of all of this), but what eventually got it working was to run ATE1 in the logger program each time the modem was started and also turn it off each time the modem was shut down. So below are the CR Basic routines that are called in my logger program to power up and down the modem (modem powered on SW12). These can probably be simplified and improved, but it works for our use case at least. The datalogger needs to be configured with PPP on RS232 and use the baud rate in the settings in the program (we used 115200), and the modem in “full modem control mode”. Maybe with the settings @Daumantas listed below this is no longer needed, but I’m not able to test this as the setup is deployed in the field. Hope this can be of some help to you @balistic

Sub ModemOn
  SW12(True)
  Delay(1,20, sec) ' Delay until the modem is ready to receive serial commands
  SerialOpen (Modemport,Modembaud,0,0,100)
  SerialOut (Modemport,"ATE1","OK",3,1500) ' ATE1 is needed for PPP to work on TRB142.
  SerialClose(Modemport) ' Needed so PPP can continue
  Delay(1,1, sec)
  P3_IP = PPPOpen
EndSub

Sub ModemOff
  SerialOpen (Modemport,Modembaud,0,0,100)
  SerialOut (Modemport,"+++","OK"+CHR(13),1,150)
  SerialOut (Modemport,"AT+CFUN=0"+CHR(13),"OK"+CHR(13),1,300)
  SerialOut (Modemport,"ATE0"+CHR(13),"OK",1,500)
  Delay (1,2,sec)
  SerialClose(Modemport)
  PPPClose
  SW12(False)
EndSub

1 Like

Also pinging @babbey from the other thread (I was not allowed to mention more than 2 people at the time in a post).

Hi @balistic ,

Sent you a form to fill out to your email address. I’ll send you the PPP connection manual privately.
In the form, please use ID 5813.

Best regards,

Appreciate the ping @rkivl!

I had a chat with one of the engineers here in Australia which basically resulted in resetting the TRB256 back to factory defaults and starting again, and got connected to a Campbells CR310 datalogger through the ethernet port (and have an MQTT broker running on the modem). Now that I’ve cracked that nut I’m hopeful that I’ll have more success going back to the RS232 connection when I get back in the office in a couple of days.

@balistic I’ll see if I can work out how to get directly in touch with you, given the ridiculous 15-day hard limit on these topics - until a kindly engineer re-opens them it seems! :slightly_smiling_face:

Cheers!

@Daumantas I have another configuration example to work through from the wiki pages, but if you could also send me this PPP connection manual that would be great.

Hello @babbey ,
Sure, I’ve sent you a form to fill out, please use 58132 as the ID. Thanks!

Received the file thanks @Daumantas - but in the end the solution to my problem was in @rkivl’s post. Adding the ATE1 command to our power-up sequence seems to have solved it for me. I’m going to make a few posts here to try to cover off what settings in the logger and the TRB256 worked for me - hopefully they’ll help anyone else who stumbles across this thread in the future.

Actually, I’ll try to cover this off in two posts - I saw another thread mentioning people being prevented from posting for 14 hours due to making too many posts so I’ll avoid that if I can…

Campbell Scientific CR310 datalogger settings (using Device Config)

Com Port Settings tab: ComPort RS-232 (duh), baud rate 115200; we don’t have the loggers talking to each other over PakBus so Beacon and Verify Intervals are both 0 and there are no neighbors
Ethernet tab: Disable Ethernet Power (possibly not relevant but I set this so that I was SURE the RS232 connection was being used)
PPP tab: Config/Port Used: RS232
IP Address: 0.0.0.0
User Name and Password:
Modem Dial String: ATD*99***1#dial string might be different for you
Modem Dial Response: CONNECT

Think that’s all that matters for the logger, so here’s the code we use when powering up the modem:

Dim Echo_Query As String * 50
Dim Echo_Ok As Boolean
Dim Echo_Retry As Long
  
SerialOpen(ComRS232,115200,3,0,1000)
SerialFlush(ComRS232)
  
For Echo_Retry = 1 To 3
  Delay(1,500,mSec)
  SerialOut(ComRS232,"ATE1" + CHR(13),"",1,20)
  SerialIn(Echo_Query,ComRS232,100,0,50)
  Echo_Ok = InStr(1,Echo_Query,"OK",2)
  If Echo_Ok Then ExitFor
Next Echo_Retry

Note that this is a tiny part of over 3000 lines of code, so if it seems like a bit of overkill there’s a reason… :smiley:

TRB256 settings in the next post!

TRB256 settings

Hmm, seems like I don’t have this licked just yet… My connection dropped out while I was looking through the modem settings, but that could have been because I also tried to use the CLI to retrieve our APN configuration. Will keep an eye on this and see what happens.

OK, a quick note on our environment. I work for a Government department, and we pay telstra (main telco in Australia) for a VPN and SIM card with static IP addresses, so we have to do some configuration before enabling full control in the serial services section. Your situation may be the same or different, but I’m going to assume that if you’re playing around with this stuff you’ll know how you need to configure the connection in the Network → Mobile section.

Once that’s done, head to Services → Modem Control - add a new instance using the rs232 device (again, duh). Enable it, set Baud rate to 115200, 8-1-None-None, and set Mode to Full Control (add a startup message on the Advanced tab if you like - I found this useful in troubleshooting as I could watch for this message when in watch mode in Device Config’s Terminal tab)

I think that should cover most of it, but I won’t be surprised if I’ve missed something, as I was playing around with the ethernet connection before coming back to this RS232 stuff. @balistic if this doesn’t work for you let me know and we’ll see if we can work out what I’ve missed to get you up and running! :slight_smile: