Jump to content

Connecting a cRIO To The Internet Using A Mobile Connection


Recommended Posts

Hi all,

I wonder if anyone can share some advice for me. I am working on a new project that is the pretty standard cRIO + Windows PC combination. The network topology is not super complicated and I have tried to diagram it.

The use case I am trying to solve is this: How can I connect to the cRIO and the Windows PC from my dev PC which is connected via the internet and a mobile phone network? Phrased another way, how do I assign static, internet facing IP addresses to the cRIO and Windows PC?

In my diagram all the IP addresses are totally made up, but are just to prove a point. If the cRIO is on 192.168.1.100 and the Windows PC is 192.168.1.200. As I understand I have to somehow get a static IP address from my mobile phone vendor (say the 136.154.2.75) and then modify the port forwarding on the Mobile Router so that traffic goes to the right place. What if I had two cRIOs, how would I address them independently?

Sorry, these are probably quite basic networking questions. Given the proliferation of IoT and remote monitoring devices I would assume these kinds of things are commonly solved.

Does anyone have any advice or info?

 

Network 1.png

Link to comment

If you can't get a dedicated IP address, one thing you can do is have your software query the outside world and find out what its public IP address is, and then update some location that you can get access to.  This is essentially dynamic DNS.  I have a domain I registered and have a website that I host.  I have the computer that serves the web page update its own DNS every couple of hours because my IP address may change.  Another option might be to do something like write a text file to Dropbox.  Then when you want to connect to it read the dropbox file and that will tell you the public IP.  Then the ports as JKSH mentioned will reference each device.

  • Like 1
Link to comment

We had a customer a while back use GSM modems from SEA like this and configure it with a VPN that worked well for them. I believe when all was said and done it could be targeted from within the Project Explorer on the local PC in LabVIEW even, in addition to accessing it via FTP/MAX/etc. I can look back through my notes and see if anything else jumps out, but I think this is a good approach if you can deal with setting the VPN up.

Link to comment

Thanks everyone for the into. This sounds like the kind of thing that is easy to screw up and I cannot really afford that.

I have got one chance to get my system right, it will be deployed far far away. Does anyone have any recommendations for companies that offer this kind of advice as a (paid for) consultancy? I can do all the LabVIEW development myself but I need good solid advice on choice of hardware and basically IoT related stuff like MQQT and pros and cons of the different IoT platform cloud vendors.

Link to comment

The more I think about hooovahh's idea the more I like it.

Maybe I am thinking about this all wrong and should just embrace the dynamic IP address issue. As long as my cRIO can talk to my cloud then it can store its own IP address somewhere in there.

Is this how the IoT hubs work? Like azure IoT?

Link to comment
7 hours ago, Neil Pate said:

The more I think about hooovahh's idea the more I like it.

...

As long as my cRIO can talk to my cloud then it can store its own IP address somewhere in there.

Important: Make sure you sign up for a 4G service that does not use Carrier Grade NAT. If your cRIO is behind CG-NAT, then knowing its public IP won't help you.

  • If your service gives you a unique public address, then the public IP address points directly to your modem. In this case, you're good to go with hooovah's method.
  • If your service is under CG-NAT, then the public IP address points to your carrier's modem which is outside your control. In this case, hooovah's method won't work.

 

7 hours ago, Neil Pate said:

Maybe I am thinking about this all wrong and should just embrace the dynamic IP address issue.

Dynamic IP addresses are a fact of life now unless you're willing to pay up, or unless you obtained a static address many years ago and you've never cancelled the service since then.

(Hopefully, IPv6 will solve the problem -- but it's not supported everywhere yet)

 

8 hours ago, Neil Pate said:

Does anyone have any recommendations for companies that offer this kind of advice as a (paid for) consultancy?

...

Is this how the IoT hubs work? Like azure IoT?

I'll haven't used any of these before so I'll leave this to experienced people.

Edited by JKSH
Link to comment
  • 3 years later...
6 minutes ago, mcduff said:

I know it's 3 years later, but would you, @Neil Pate, mind sharing which method you chose? I will need to set up a similar system.

 

Thanks

Sure, I will try and remember and type up something tomorrow.

Before you get your hopes too high, I got things working ok with Azure IoT hub and Power BI, but it was never productionised.

Link to comment

OK, this is what I remember.

Hardware was something like this:

  • cRIO
  • Ethernet switch
  • Industrial modem (Teltonika something... you put a SIM in and connect the ethernet to the switch)

Security I just had to kinda figure out. I think I got it working in the end, check out this thread: 

 

 

The big question mark for me was how I was going to manage the cRIO remotely as my LTE connection could not guarantee a fixed IP address, so I had no simple way to connect to the cRIO after it had been deployed in the field. Finally we decided that we would actually need a PC anyway for something else, and the cRIO would be connected to that. The plan was to remote desktop into the PC and then connect to the cRIO that way, or get the dynamic IP address of the cRIO. Or maybe the idea was to the cRIO to broadcast somewhere its IP address. The project was put on ice and never deployed to the field, so I was not able to test these assumptions.

People do get stuff like this to work, so I am sure somebody had a solution for these problems.

Hope this helps!

 

  • Thanks 1
Link to comment
On 6/25/2023 at 9:46 PM, Neil Pate said:

OK, this is what I remember.

Hardware was something like this:

  • cRIO
  • Ethernet switch
  • Industrial modem (Teltonika something... you put a SIM in and connect the ethernet to the switch)

Security I just had to kinda figure out. I think I got it working in the end, check out this thread: 

 

 

The big question mark for me was how I was going to manage the cRIO remotely as my LTE connection could not guarantee a fixed IP address, so I had no simple way to connect to the cRIO after it had been deployed in the field. Finally we decided that we would actually need a PC anyway for something else, and the cRIO would be connected to that. The plan was to remote desktop into the PC and then connect to the cRIO that way, or get the dynamic IP address of the cRIO. Or maybe the idea was to the cRIO to broadcast somewhere its IP address. The project was put on ice and never deployed to the field, so I was not able to test these assumptions.

People do get stuff like this to work, so I am sure somebody had a solution for these problems.

Hope this helps!

 

Some Dynamic DNS or similar could help with the problem of a dynamic IP adres device in the field. It would require a fairly simple modification in the cRIO setup, but if you use an NI Linux RT type this should be pretty trivial. Of course you will need to have access to a Dynamic DNS service somehow, they are usually not for free.

No-IP for instance provides a free version but requires you to manually confirm it every 30 days and does not support SSL certificates on that level. For 1.99 per month you do get SSL and a 1 host name resolution without monthly confirmation. Other services have similar offers. The free tier has usually several limitations that are inconvenient but not a huge problem for private deployments. But they pretty much won't work for a commercial deployment.

  • Thanks 1
Link to comment
22 hours ago, Jordan Kuehn said:

SystemLink is an (expensive) solution to this as well.

Tor is a much cheaper solution both in money and resources.

Technically, The DNS issue is the IT depts problem. But usually they, all of a sudden, plead ignorance on the topic and can't understand what you are asking for.

Edited by ShaunR
Link to comment
3 hours ago, Rolf Kalbermatter said:

Some Dynamic DNS or similar could help with the problem of a dynamic IP adres device in the field. It would require a fairly simple modification in the cRIO setup, but if you use an NI Linux RT type this should be pretty trivial. Of course you will need to have access to a Dynamic DNS service somehow, they are usually not for free.

No-IP for instance provides a free version but requires you to manually confirm it every 30 days and does not support SSL certificates on that level. For 1.99 per month you do get SSL and a 1 host name resolution without monthly confirmation. Other services have similar offers. The free tier has usually several limitations that are inconvenient but not a huge problem for private deployments. But they pretty much won't work for a commercial deployment.

Yup, I was going to use those (no-ip if I recall correctly) but then we needed to introduce a PC and so my problem kinda went away.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.