Connect web application to my local phidget

Supporting Browser-based Javascript and Node.js
Post Reply
ezapien
Fresh meat
Posts: 2
Joined: Sun Apr 11, 2021 5:54 pm
Contact:

Connect web application to my local phidget

Post by ezapien »

Is there a way to connect my web application to a temperature sensor Phidget that I have running on my local computer?
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Connect web application to my local phidget

Post 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
ezapien
Fresh meat
Posts: 2
Joined: Sun Apr 11, 2021 5:54 pm
Contact:

Re: Connect web application to my local phidget

Post 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!
User avatar
mparadis
Site Admin
Posts: 660
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Connect web application to my local phidget

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests