https_test test program not working

Moderators: lily.li, violet, jessie, chao.zhang

Post Reply
rhbroberg
Pre-kindergarten
Pre-kindergarten
Posts: 27
Joined: Thu Feb 04, 2016 12:20 pm

https_test test program not working

Post by rhbroberg » Fri Feb 05, 2016 9:44 am

I have a t-mobile SIM card which has a data plan on it (verified by using the SIM card in an android phone).

I built and ran the traceable dog collar demo, which works - so I know that my rephone recognizes my SIM card - I can text it and call it, and I see output on the serial console.

However, when I run the https_test program the serial console shows no output at all, indicating that it is not successfully connecting to the URL in the test program.

What do I need to do to make it work?

dbelam
Elementary-1
Elementary-1
Posts: 157
Joined: Wed Feb 03, 2016 2:59 am

Re: https_test test program not working

Post by dbelam » Fri Feb 05, 2016 1:59 pm

Wthout any prior reading of api and documentation: it has 2 serial outputs, the modem and debug. Have you tried both?

rhbroberg
Pre-kindergarten
Pre-kindergarten
Posts: 27
Joined: Thu Feb 04, 2016 12:20 pm

Re: https_test test program not working

Post by rhbroberg » Fri Feb 05, 2016 11:45 pm

Notice in my original post that I already have the serial output working and verified with a different demo, so I understand the configuration for the correct console output. Instrumenting the https_test demo code with additional output does show my debugging lines, so it's not as simple as the console not working.

m.duerr
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Sun Jan 24, 2016 5:48 am

Re: https_test test program not working

Post by m.duerr » Sun Feb 07, 2016 4:04 am

The scirpt waits for an input. You simply have to press a key on your keyboard.

I made a test with my thingspeak account.

I replaced the URL like this.
#define TEST_URL "http://api.thingspeak.com/update?key=Y O U R K E Y &field1=5"

It works fine and is very simple!
Last edited by m.duerr on Thu Feb 11, 2016 4:55 am, edited 1 time in total.

rhbroberg
Pre-kindergarten
Pre-kindergarten
Posts: 27
Joined: Thu Feb 04, 2016 12:20 pm

Re: https_test test program not working

Post by rhbroberg » Thu Feb 11, 2016 3:44 am

I got it to work; I was too impatient. The first time a URL is sent out (https, not http), it takes a good 15 seconds to process; the library call sends every request out with the same request Id, so if you make another request before the first one comes back, the first one is cancelled.

So starting it, pressing a key, and waiting until it comes back worked for me too.

I've discovered that subsequent calls to post the request without cancelling (closing) the channel happen quite quickly; in fact, they can occur once per second even to a https site, which is good enough for me

Post Reply