Has any body got an example program for a CR1000 (via NL120) connected to the ethernet port of a Hughes 9502 Bgan Satellite unit. Thanks
Kevin, what kind of example program do you envision is required? The logger connects to the 9502 via Ethernet. It will obtain a local IP address from the 9502 via DHCP. Are you paying for a public IP address for the 9502? If not you might wish to configure the logger (Device Configuration Utility -> Advanced tab) to maintain a PakBus/TCP connection back to a LoggerNet computer or to another PakBus router. Alternatively, you may wish to transfer your data to a server using a combination of the TableFile() instruction and either the FTPClient() or EmailSend() instructions.
Hi
Thanks for your reply. The Hughes has a payed public IP address
I'm wanting to use callback to keep the connection open once the logger initializes the call to my external static IP address. Comm's will occur every hour.
I'm not sure what settings I have to configure via the device configuration utility in the NL120, or whether all the configuration can be done in the .CR1 program? All hardware connections are via the CR1000 & Hughes 9502 Ethernet ports.
I have included a basic test program that I hope will prove communication connectivity below. Once I have the comm's working, then i'll worry about adding the appropriate sensors. I'm not sure what else to include about the NL120.
Public PanelTemperature, BatteryVoltage, Result1, Test1
Dim Socket As Long
DataTable (CLBK1,1,1000)
DataInterval (0,0,min,10)
Sample (1,PanelTemperature,FP2)
EndTable
BeginProg
Scan (60,sec,3,0)
PanelTemp (PanelTemperature,250)
Battery (BatteryVoltage)
If IfTime (1,5,Min) Then
Socket = TCPOpen ("202.36.xxx.xx",6785,0)
SendVariables (Result1,Socket,0,4094,0000,100,"Public","Callback",Test1,1)
EndIf
CallTable CLBK1
NextScan
EndProg
Many Thanks
I'm running a couple of Bgan "Sabre" units with CR850s. I run a Moxa NPort5110A From the logger rs232 to the Sabre ethernet port. There's no program code required, just a couple of tweaks of the logger setup.
Kevin,
If your HughesNet terminal has a static public IP address, then configuring communications is a cinch. You simply configure an IPPort or PakBusTCPServer root with your logger and the static IP address, port 6785, and you are in business.
If you want the logger to open the connection back to LoggerNet (often referred to as "IP callback"), then it isn't that much more difficult.
1) Find out what the public, static, IP address is for your LoggerNet server. Make sure that it is publicly accessible over the internet and that at least port 6785 (default, but not set in stone) is open and accessible.
2) Configure LoggerNet with a PakBusTCPServer root. Place a CR1000 underneath that PakBusTCPServer root.
Configure:
PakBus Port Always Open = Enabled
Beacon Interval = 0
PakBus Verify Interval = 1 hour
IP Port Used for Callback = 6785
TCP Password = set something and remember it
Datalogger PakBus Address = unique PB address of logger
Setup your data collection schedule
3) Configure your CR1000 using DevConfig
Set the PakBus address
Set your PakBus/TCP Password to match what you entered into LoggerNet above
You will probably leave the IP address at 0's to indicate DHCP (gotten from Hughes terminal)
Set one of the Net Services PakBus/TCP Client Connections to point to the IP address or host name of your LoggerNet computer that is listening on port 6785
4) Use a simple program like the following to control weather or not the Ethernet connection is up and usable (causing the logger to open a connection back to LoggerNet with above settings in place)
Public EthernetOn As Boolean
BeginProg
Scan (1,Sec,0,0)
If EthernetOn Then
IPNetPower (1,-1)
Else
IPNetPower (1,0)
EndIf
NextScan
EndProg
What causes EthernetOn to be true or false is up to you. For example, you might turn the EthernetOn at boot for 10 minutes and everyday between 8AM and 5PM. Whatever it is up to you. For demonstration sake, I have include a program that does the above.
Public SecsIntoDay As Long
BeginProg
Scan (1,Sec,0,0)
SecsIntoDay = Public.Timestamp(4,1)
If SecsIntoDay >= 32400 AND SecsIntoDay <= 61200 Then
'it is between 9AM and 5PM
IPNetPower (1,-1)
ElseIf Public.Record(1,1) <= 600
'we probably rebooted within
'the last 10 minutes if each
'scan is 1 sec
IPNetPower (1,-1)
Else
'drop ethernet connection and thus
'connection to hughes terminal and
'LoggerNet
IPNetPower (0,-1)
EndIf
NextScan
EndProg
* Last updated by: Sam on 2/13/2013 @ 9:09 PM *
Forgive the sales pitch, and I am surprised Sam did not do this as it is his "baby", but if user 131 needs to connect CR850s to ethernet devices in the future they might like to consider the new CS NL200 interface.
In addition to power control, as described by Sam for the CR1000, it also opens up the possibility of the logger using standard internet services such as internet time synchronisation, ftp, email, http etc.
Hmm, interesting. I've used a relay controlled with code via SW12 to power the Bgan unit. The NL200 could simplify things.
Andrew is correct. When using the HughesNet 9502 one could connect a CR1000 or CR3000 to the terminal using a NL115 or NL120. Additionally, when using a CR800/850, CR1000, or CR3000 one could use the NL200 in "bridge mode". Lastly, when using a legacy -PB logger (e.g. CR10X-PB), CR200(X), CR800, CR850, CR1000, or CR3000, one could also use the NL200 or (NL100 if you've got one) in "pakbus" serial server mode.
IPNetPower() can be used to sleep or activate your NL115 Ethernet, NL120, NL200 (bridgemode=enabled), or NL240 (bridgemode=enabled). You can save about 20mA of current draw when sleeping the NL115 or NL120 Ethernet. You can save about 50mA of current when sleeping the NL200.
IPNetPower() does NOT control power to the HughesNet terminal directly.
There are 3 ways to control the power of the HughesNet 9502.
a) System power. Power the 9502 from the SW12V port of the logger and use the SW12() command in CRBasic. When switched off, the 9502 will be drawing 0mA@13V.
b) GNSS port, pin 9. The 9502 can be configured via it's on board web interface so that when pin 9 of the GNSS port is pulled high (e.g. by the CR1000 control port) the unit goes to sleep. When the unit is asleep, the 9502 will be drawing approximately 5mA@13V. Use the PortSet() or WriteIO() commands to set the state of the control port on the CR1000.
c) Absence of Ethernet traffic. The 9502 can be configured so that when no Ethernet traffic is present for a period of time the unit goes to sleep. The best way I know to ensure there is no Ethernet traffic generated by the logger is to use the IPNetPower() instruction to power off my Ethernet interface. If using the CR200(X), CR10X-PB, etc. with the NL200, then put the NL200 on SW Battery and use the SWBatt() instruction to toggle power to the NL200.
When on and active the 9502 will add about 225 mA to your system draw. When on and idle it will add about 95 mA to your system draw.
During my field tests I used the CR1000 with NL120 connected via Ethernet to the HughesNet 9502. I configured the CR1000 to maintain a connection back to a PakBus router so I could contact it with LoggerNet (for example LoggerNet, NL200/100, another CR800/1000/3000). I did not have a static, public, IP address to work with so I had to maintain the connection back using the PakBus/TCP Client connection setting under the "Net Services" tab. Alternatively, I could have sent my data to a server using FTP or Email. I controlled the sleep state of the 9502 by attaching pin 9 of the GNSS port to a control port of my datalogger. When I wanted my system to sleep and go into the lowest power state possible, I used IPNetPower() to sleep my NL120 and used PortSet() to sleep the 9502.
* Last updated by: Sam on 2/14/2013 @ 5:31 PM *
Just one word of warning, the HughesNet 9502 datasheet says it can use up to 20W when transmitting. This is well above the current limit of the SW12 output. That output is protected by a thermal fuse that does take some while to trip so it is unlikely to trip for short bursts of high current but the current at which it trips decreases with increasing temperature so there is some risk at high temperatures.
If the installation requires that high power mode then I would advise using separate higher current relay OR one of the other two tricks Sam gives to control the power, which avoid any external switching of power to the 9502.
* Last updated by: aps on 3/1/2013 @ 10:48 AM *
Many Thanks for your input.
I have got this working... just needed to wait until IT dept opened up the firewall to allow TCP on port 6785.