Page 1 of 1
Connect web application to my local phidget
Posted: Sun Apr 11, 2021 6:06 pm
by ezapien
Is there a way to connect my web application to a temperature sensor Phidget that I have running on my local computer?
Re: Connect web application to my local phidget
Posted: Mon Apr 12, 2021 7:59 am
by mparadis
Yes, when you create the "Connection" object, use the IP address or hostname of your local computer. The local computer must be running the Phidget Network Server (which you can run through the Phidget control Panel if you're in Windows or MacOS).
JavaScript API
Network Server
Re: Connect web application to my local phidget
Posted: Sun Apr 18, 2021 2:59 pm
by ezapien
Thank you for the quick reply mparadis!
I took a look at the Network Server docs and it seems that I'm looking to implement a remote connection? I also came across this section:
"Opening a Phidget remotely means communicating with it using the Network Server. You can remotely open any Phidget on your network, ..."
Just wanted to confirm on the "on your network" part. Does this mean that the Client computer would have to be on the same local network as the Host computer?
Also, sorry looking at my original post I may have left out some important details. The Web application is hosted on an external site (Gandi) and I'm trying to connect that web application to the Phidget that I have running on my local computer (1048_0B temperature sensor).
Thank you again for your help!
Re: Connect web application to my local phidget
Posted: Mon Apr 19, 2021 8:24 am
by mparadis
The documentation says "on your network" simply because the majority of network server users are accessing Phidgets in their local area network. If you add a connection with the proper IP address, port and password, you can connect to a remote server. You may also have to configure your firewall to allow traffic on port 8989 and 5661 or whichever ports you have configured on your local machine's Phidget Network Server.