I don’t see TCPClient in the library listings anymore. Has it been pulled? I am looking to create a minimal Photon/Core Client program to read data from an in-house wifi connected temperature server. Thanks.
TCPClient is “built-in” in the Particle so no separate library is required.
Thanks bko, I thought that I remembered seeing a TCPClient example in the library section. Maybe I am getting senile.
There are several HTTP client libraries–maybe that is what you wanted?
Bko, I am new to programming, so forgive my ignorance. I want to used a Photon or Core as a data collector. I want to have several wifi connected “server” processors (at fixed ip addresses) located a various locations in my home sending data (temperature, etc) to the Photon/Core data collector. I want to be able to access the Photon/Core data collections from anywhere I travel. I am looking for the minimal code example that will get me started. I looked at the HTTPClient. Can I substitute ip addresses for the host name? Thanks again for your help.
I am not sure I fully follow your setup: it would be more usual for a Photon to be connected to some sensors for say temperature and pressure–then you could use the Particle Cloud to post data and subscribe to that data on a PC/Mac/Linux box or another Photon. Using web hooks you can also send your data to other services on the web including say a Google Docs spreadsheet. Your use-case seems to be the other way round, but I guess that could work too.
As to HTTPClient, you should use
IPAddress(192,168,0,2) and not
"192.168.0.2" which won’t work. Check out the example in the HTTPClient library for more details.
OK bko, thanks for your help. I’ll take a look a closer look at the HTTPClient library.
The httpclient works without fault if you disconnect from the cloud and send your data to a little linux server like the pi
Thanks Peter and bko for steering me in the the right direction. I was able to modify the httpclient example to get my Photon to receive data from an ESP8266 server connected to my network. I used SYSTEM MODE(SEMI-AUTOMATIC).