02-11-2015 07:02 AM - edited 02-11-2015 07:03 AM
So I have a web service running on a myRIO which at the moment is just taking in a boolean value. When the MyRIO receives the GET request it starts a network stream writer to a receiver which is running in a different loop also running on the MyRIO itself. If I run the program by just clicking "Start" on the web service then it behaves exactly as requested.
When I go to http://172.16.0.1:8001/web/connect?Connect={value} from a separate PC on the network then it starts the network stream, writes the value and deletes the stream waiting for the next request. However when I choose to deploy the service to the application server on port 8080 and go to http://172.16.0.1:8080/web/connect?Connect={value} nothing happens on the recieving end and I can't debug it on the sending end to see why not.
I am guessing something to do with the IP I am passing it when I create the writer, in debug mode (8001) it is happy with 172.16.0.1 but I thought maybe when it's deployed to 8080 it maybe needs 127.0.0.1 as its connecting to a stream on itself however I tried this and it didn't work.
Here is my web service code
I have attached the source files. "connect.vi" is the web service running on the myrio and the network stream sender and "web control" is the vi running on the myrio and the network stream sender.
02-11-2015 07:24 AM
I read through this a few times to try and understand what might be going wrong and I can't see anything obvious - you probably need to use the localhost IP of 127.0.0.1 if you're talking to a network stream on the same device but you said that you tried that and it still doesn't work.
I can't open your VI as I don't have LV2014 but are you 're-listening' on the reader after the connection drops? Once you destroy the endpoint from either side I believe you have to re-create the reader endpoint to listen for an incoming connection.
Also, according to the documentation here, you must set the appropriate wait condition before destroying the writer?
02-11-2015 07:36 AM
Hi, On the receiving end I have a state machine which constantly destroys the endpoint and reconnects it and waits for a connection if it is lost. As I say it is working perfectly on 8001 just won't work on 8080. I wouldn't mind but data dashboard on ipad can't see the 8001 web services only 8080.
Other bonus information, windows firewall is turned off. I have tested other communication on port 8080 and it works fine (simple buttons just setting shared variables) it seems to just be the network stream part which it doesn't like.
02-11-2015
09:22 AM
- last edited on
01-13-2025
11:19 AM
by
Content Cleaner
Have a look at the tutorial here: https://www.ni.com/docs/en-US/bundle/labview/page/tutorial-creating-and-publishing-a-labview-web-ser...
If you can get that working on 8080, you should be able to figure out what's wrong with your own code.
Hope it helps.
02-11-2015 09:59 AM
Hi thanks for the suggestion but in my post above I just explained that I have already had web services running and working on port 8080. I've had buttons sending and booleans receiving and strings sending and receiving all across network shared variables. it is only when I have added this network stream code that port 8080 doesn't work. 8001 is working fine though.
02-11-2015
10:08 AM
- last edited on
01-13-2025
11:19 AM
by
Content Cleaner
Ah, my bad. Network streaming is a different animal I'm not so familiar with.
There is this discussion here: https://forums.ni.com/t5/LabVIEW/which-ports-to-forward-for-network-streams/td-p/1567988
Not sure if it will be helpful or not.
Good luck with your project.