Connect web application to my local phidget

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

Connect web application to my local phidget

Postby ezapien » Sun Apr 11, 2021 6:06 pm

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: 790
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Connect web application to my local phidget

Postby mparadis » Mon Apr 12, 2021 7:59 am

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

Postby ezapien » Sun Apr 18, 2021 2:59 pm

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: 790
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Connect web application to my local phidget

Postby mparadis » Mon Apr 19, 2021 8:24 am

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.


Return to “Javascript”

Who is online

Users browsing this forum: No registered users and 1 guest