# Baby monitor over the internet! web client help?

**URL:** <https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623>\
**Category:** Getting Started\
**Created:** [August 24, 2018, 1:14pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623 "2018-08-24T13:14:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lithdk](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lithdk/32/18091_2.png) [@lithdk](https://community.particle.io/u/lithdk)\
**Post date:** [August 24, 2018, 1:14pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623/1 "2018-08-24T13:14:37Z")

</div>

Hey there.

I just ordered my particle photon, and Im in the process of making a baby/sound monitor. So the way it’ll work is, I got this webpage ([www.myowndomain.com](http://www.myowndomain.com)) which has 2 files. Index.php and update.php. Index.php reads 1 value from a database and outputs it in html and plays a sound if value is over a threshold yadayadayada… and update.php updates the database with whatever is in ?value=INT and then we’ll be able to read the page when we are walking the dog or whatever.

So my question is, how do I make the photon go to [www.myowndomain.com/babyalarm/update.php?value=ValueReadFromMicrophoneOnApin](http://www.myowndomain.com/babyalarm/update.php?value=ValueReadFromMicrophoneOnApin) ? The majority of the code I can do myself. I’ll make a variable that holds the value from the pin, I’ll check the deviation from last time it was read, and if it’s greater than X I’d like the photon to “go to that page”.  
I’ve done a little arduinoing before, but never anything internety, so a pointer/link in the right direction would be really helpful :-)!

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ninjatill](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ninjatill/32/17370_2.png) [@ninjatill](https://community.particle.io/u/ninjatill)\
**Post date:** [August 24, 2018, 1:20pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623/2 "2018-08-24T13:20:54Z")

</div>

Check out this post. There are links to 2 github repos by @rickkas7 which demonstrate streaming audio with the Photon over the internet.

> [@Sub-millisecond timer output compare interrupt](https://community.particle.io/t/sub-millisecond-timer-output-compare-interrupt/29401):
>
> I’ve been toying with an Electron for a while; all going well - thanks largely to this community. Thanks to all… In my application, I’ve written code to sample noise in direct bursts (1000 samples in a loop) to do some post processing (FFT’s etc). However - I would like to make the system a little smarter by allowing continuous noise monitoring (i.e. through at fixed interval timer interrupts). Then post process the noise of there is an event “of interest”. The “Timer” function out of the box …

---

<div class="post-metadata">

**Author:** ![lithdk](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lithdk/32/18091_2.png) [@lithdk](https://community.particle.io/u/lithdk)\
**Post date:** [September 11, 2018, 3:30pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623/3 "2018-09-11T15:30:05Z")

</div>

Thanks for the reply ninjatil. But Im not looking to stream audio. Im just looking to update my mysql database by running a script on my server. I just need the photon to go to my webpage, like you would in a normal browser. This is the code Im toying with to get it to work if that gives any indication of what Im trying to do:

```auto
// This #include statement was automatically added by the Particle IDE.
#include <HttpClient.h>
#include <application.h>
HttpClient http;

http_header_t headers[] = {
    { "Accept" , "*/*"},
    { NULL, NULL }
};

http_request_t request;
http_response_t response;

void setup() {

}

void loop() {
request.hostname = "MYWEBSITE.MYDOMAIN.com/babyalarm/update.php?decibel=99";
request.port = 80;
request.path = "";
request.body = "";
http.post(request, response, headers);
delay(5000);
}

```

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [September 11, 2018, 3:38pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623/4 "2018-09-11T15:38:34Z")

</div>

Is this an HTTPS or HTTP address?  
If the former you’ll _need_ to use webhooks - however even with HTTP I’d also go that way.

But if you can run your own server on that site, you could have a look at these [two approaches](https://github.com/rickkas7?utf8=%E2%9C%93&tab=repositories&q=mysql)

---

<div class="post-metadata">

**Author:** ![lithdk](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lithdk/32/18091_2.png) [@lithdk](https://community.particle.io/u/lithdk)\
**Post date:** [September 11, 2018, 3:55pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623/5 "2018-09-11T15:55:09Z")

</div>

Thanks for the help. But I found a much simpler approach with TCPClient. It is my own on-site server.

Gonna try to close the thread if that’s a thing 😉

---

<div class="post-metadata">

**Author:** ![ninjatill](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ninjatill/32/17370_2.png) [@ninjatill](https://community.particle.io/u/ninjatill)\
**Post date:** [September 11, 2018, 3:55pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623/6 "2018-09-11T15:55:56Z")

</div>

> [@lithdk](#):
>
> request.hostname = "[MYWEBSITE.MYDOMAIN.com/babyalarm/update.php?decibel=99](http://MYWEBSITE.MYDOMAIN.com/babyalarm/update.php?decibel=99)";  
> request.port = 80;  
> request.path = "";  
> request.body = "";  
> http.post(request, response, headers);  
> delay(5000);

In addition to what @ScruffR says, why do you have the path within the hostname? Why not something like this:

```c++
char[255] myPath;
int myVolume = 0;

void loop() {
 myVolume = [read from Photon pins or something];
 snprintf(myPath,sizeof(myPath), "/babyalarm/update.php?decibel=%d", myVolume)

 request.hostname = "MYWEBSITE.MYDOMAIN.com";
 request.port = 80;
 request.path = myPath;
 request.body = "";
 http.get(request, response, headers);
 delay(5000);
}

```

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [September 11, 2018, 3:59pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623/7 "2018-09-11T15:59:07Z")

</div>

> [@lithdk](#):
>
> Gonna try to close the thread if that’s a thing

If you got the solution you can mark the post that shows the solution by clicking this icon ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/5/d/5d30cacf30c15e97bcc6018caf9e13fe34935344.png) at the bottom of that post

---

<div class="post-metadata">

**Author:** ![ninjatill](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ninjatill/32/17370_2.png) [@ninjatill](https://community.particle.io/u/ninjatill)\
**Post date:** [September 11, 2018, 4:09pm UTC](https://community.particle.io/t/baby-monitor-over-the-internet-web-client-help/43623/8 "2018-09-11T16:09:18Z")

</div>

Oh and @ScruffR asked about HTTPS because it’s not (reasonably, or easily) possible to make HTTPS requests directly from the Photon… for that you should use a webhook. But if local on your own network, and you don’t care about data security while in-transit, then the HTTPClient library will work fine.
