Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR300 , Cellular, Serial Port, and PakBus


Bret Berger May 9, 2019 06:27 PM

Hardware is CR300 modem connected to a MultiTech MTC-MVW1-B01 LTE Cat M1 Cellular Modem via serial port. Goal is to power up modem once per hour, connect to LoggerNet server to dump data and then power down. I am developing on the bench right now and believe I have worked out the AT commands, issued to cellular modem with SerialOut, to send to cellular modem over serial port to get it to connect to LoggerNet server. I gather the cellular modem's responses with SerialIn command and display on an LCD (serial LCD via C1 port) for debugging. The modem's responses are all as expected.

I use a remote LoggerNet server reachable via Windows Remote Desktop Connection. I think I have the CR300 configured correctly there using Setup with the proper PakBus port.

Problem: I am unable to connect to the CR300 on the remote LoggerNet server after the link is set up. I wonder if the serial port on the CR300 knows it is a PakBus port after the cellular modem has set up the link?

To clarify, I am not using the TCP/IP stack on the CR300. The cellular modem does the TCP networking.  After the link is set up the CR300 needs to speak Pakbus over the serial port.

I am developing on the bench with a local install of LoggerNet connected to the CR300 over USB. I unplug the USB cable between local PC and the CR300 before initiating a connection via cellular.

I have working installs of CR200Xs communicating to LoggerNet via MutiTech cellular modems. I'm now trying to replicate with the CR300.

thanks!

-bret


Bret Berger May 10, 2019 01:08 PM

Follow up on problem.

In hopes of forcing a PacBus route, I added the following to program just after the cellular modem sets up connection:

StaticRoute (COMRS232,4094,4094)

I get the following errors from Connect when I try to connect to the CR300 on the remotely accessable LoggerNet server:

Failure: 5/9/2019 23:20:27.075
transaction failure","unreachable destination","Get Logger Program Status
Failure: 5/9/2019 23:20:27.075
transaction failure","unreachable destination","check/set clock
Failure: 5/9/2019 23:21:06.121
PakBus/TCP Client Disconnected","207.189.176.141","26901","connection failed
Failure: 5/10/2019 06:07:16.361
PakBus framing error","Invalid low level signature
Failure: 5/10/2019 18:04:29.919
PakBus/TCP Client Disconnected","97.41.135.100","11190","connection failed","10053","software caused connection abort
Failure: 5/10/2019 19:01:01.107
transaction failure","unreachable destination","Get Logger Program Status
Failure: 5/10/2019 19:01:01.107
transaction failure","unreachable destination","check/set clock
Failure: 5/10/2019 19:01:01.107
delivery failure received","timed out or resource error
Failure: 5/9/2019 23:21:06.121
PakBus/TCP Client Disconnected","207.189.176.141","26901","connection failed
Failure: 5/10/2019 06:07:16.361
PakBus framing error","Invalid low level signature
Failure: 5/10/2019 18:04:29.919
PakBus/TCP Client Disconnected","97.41.135.100","11190","connection failed","10053","software caused connection abort
Failure: 5/10/2019 19:01:01.107
delivery failure received","timed out or resource error

 


Bret Berger May 10, 2019 01:35 PM

Futher follow up...

My cellular plan on the device used brings the modem up with a non-routable (10.xxx.xxx.xxx block) static IP address. The IP address 207.189.176.138 which shows up in the error message above, belongs to the block 207.189.176.0/24 which I think is associated with my cellular provider. I am checking on this.

It would appear the link is being set up properly but communications are somehow corrupted. 

I am reviewing https://www.campbellsci.com/faqs?v=1304 but don't see a clear cause.


Bret Berger May 10, 2019 02:29 PM

More follow up...

DCE interface speed on modem was set at 115200. Hoping that slowing down the link might help, I turned this down to 9600 and also changed the param in SerialOpen() to match. Also turned off DTE flow control. Set (already default setting) framing to 8 data bits, 1 stop bit.

Connect error this time showed two seperate IP address. The IP adddress 97.41.141.99 is assigned to Verizon. The other, 207.189.176.141, is assigned to Wyless, Inc who I beleive to be associated with my cellular provider KORE/Verizon.

Failure: 5/10/2019 19:17:02.263
   transaction failure","unreachable destination","Get Logger Program Status
Failure: 5/10/2019 19:17:02.263
   transaction failure","unreachable destination","check/set clock
Failure: 5/10/2019 19:17:02.263
   delivery failure received","timed out or resource error
Failure: 5/10/2019 19:17:49.171
   PakBus/TCP Client Disconnected","207.189.176.141","64716","connection failed
Failure: 5/10/2019 19:30:31.540
   PakBus/TCP Client Disconnected","97.41.141.99","16166","connection failed
Failure: 5/10/2019 20:18:01.920
   transaction failure","unreachable destination","Get Logger Program Status
Failure: 5/10/2019 20:18:01.920
   transaction failure","unreachable destination","check/set clock
Failure: 5/10/2019 20:18:01.920
   delivery failure received","timed out or resource error
Failure: 5/10/2019 19:17:02.263
   delivery failure received","timed out or resource error
Failure: 5/10/2019 19:17:49.171
   PakBus/TCP Client Disconnected","207.189.176.141","64716","connection failed
Failure: 5/10/2019 19:30:31.540
   PakBus/TCP Client Disconnected","97.41.141.99","16166","connection failed
Failure: 5/10/2019 20:18:01.920
   delivery failure received","timed out or resource error

 


Bret Berger May 10, 2019 04:23 PM

Confirmed with my cellular provider that the IP block 207.189.176.0/24 is associated with my LTE modem.


Bret Berger May 10, 2019 05:12 PM

Whoa, success!

Adding the following after setting up cellular connection over serial port:

  'Flush serial port
  SerialFlush (COMRS232)
  'Hello McFly?
  Broadcast (COMRS232,14)

 ...allows me to manually connect back to CR300 from LoggerNet. Still need to figure out how to force data collection from CR300 program each time stations connects to LoggerNet.


GaryTRoberts May 10, 2019 07:22 PM

If the logger is controlling the callbacks, you can use SendVariable to LoggerNet which will cause LoggerNet to collect the data from the datalogger.

 

SendVariables (SendResult,COMRS232,0,4094,0000,0,"Public","Callback",Scratch,1)

 

Look at the second example for SendVariables() for an example an some details. The CRBasic help for SendVariables() also has more details on this "call back" method.


Bret Berger May 13, 2019 12:49 PM

Thanks @GaryTRoberts!

Log in or register to post/reply in the forum.