HTTP POST using 4G library fails - error code 17

Wireless communications in Waspmote, topologies, node types...
B2L_steve
Posts: 18
Joined: Mon Jun 17, 2019 4:26 am
Company: Bio2Lab Pty Ltd

HTTP POST using 4G library fails - error code 17

Post by B2L_steve » Tue Jun 18, 2019 2:25 am

Dear Libelium team,
I'm using a P&S Smart Water with 4G connection as a stand-alone sensor. I want to send sensor data directly to a RESTful API using HTTP POST, but this seems suprisingly difficult:

Using the supplied 4G example (_4G_07_http_post), I consistently get error code 17

I'm using a v15 board, v041 of the IDE, and v3.0 of the example sketch _4G_07_http_post.pde. Sim card supplied by M2M, using the telstra network

Response as below:

H#
Start program
********************************************************************
POST method to the Libelium's test url
You can use this php to test the HTTP connection of the module.
The php returns the parameters that the user sends with the URL.
********************************************************************
*****************************
APN: telstea.m2m
LOGIN:
PASSWORD:
*****************************
[LE910] ==> ERROR CODE: operation not supported
1. 4G module ready...
2. HTTP POST request...[LE910] CREG: 0,1
[LE910] CGREG: 0,1
[LE910] GPRS context activation:1
[LE910] IP address:10.114.21.124
Failed. Error code: 17
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!

Any ideas as to what the problem is?

thanks, S

B2L_steve
Posts: 18
Joined: Mon Jun 17, 2019 4:26 am
Company: Bio2Lab Pty Ltd

Re: HTTP POST using 4G library fails - error code 17

Post by B2L_steve » Tue Jun 18, 2019 5:20 am

Also noticed that the FTP example fails with message 16 - could these issues be related?

[LE910] ==> ERROR CODE: operation not supported
1. 4G module ready...
[LE910] Checking connection
[LE910] CREG: 0,1
[LE910] CGREG: 0,1
[LE910] GPRS context activation:1
[LE910] IP address:10.114.29.90
[LE910] Opening FTP session
[LE910] ==> ERROR CODE: UNKNOWN
[LE910] ==> ERROR CODE: UNKNOWN
2.1. FTP connection error: 16
3. Switch OFF 4G module
4. Enter deep sleep...

Using the following 4G module:

Start program
[LE910] ==> ERROR CODE: operation not supported
4G module ready

1.1. Manufacturer identification: Telit
1.2. Model identification: LE910-AU
1.3. Revision identification: 20.00.102
1.4. IMEI: 358173069984238
1.5. IMSI: 505016001972062
1.6. ICCID: 89610185002361318474

Is there possibly a firmware update I've missed out on?

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: HTTP POST using 4G library fails - error code 17

Post by libelium-dev » Tue Jun 18, 2019 7:38 am

Hi,

Is the pin of the sim card disabled?

Did you upload the example codes without modifications (only the apn settings?)

Could you please enable debug mode 2 and share the output with us again to debug the issue in more deep? You can enable it inside Wasp4G.h file

Regards

B2L_steve
Posts: 18
Joined: Mon Jun 17, 2019 4:26 am
Company: Bio2Lab Pty Ltd

Re: HTTP POST using 4G library fails - error code 17

Post by B2L_steve » Tue Jun 18, 2019 9:00 am

Debug mode is enabled, and the sim does not require a pin.

I have tested the TCP example, and this works ok, but the FTP and HTTP examples fail as above

B2L_steve
Posts: 18
Joined: Mon Jun 17, 2019 4:26 am
Company: Bio2Lab Pty Ltd

Re: HTTP POST using 4G library fails - error code 17

Post by B2L_steve » Tue Jun 18, 2019 9:03 am

Start program
********************************************************************
POST method testing
********************************************************************
APN connection details:*****************************
APN: telstra.m2m
LOGIN:
PASSWORD:
*****************************
[LE910] ==> ERROR CODE: operation not supported
2. HTTP get request...[LE910] CREG: 0,1
[LE910] CGREG: 0,1
[LE910] GPRS context activation:1
[LE910] IP address:10.116.129.192
Failed. Error code: 17
3. Switch OFF 4G module
4. Enter deep sleep...

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: HTTP POST using 4G library fails - error code 17

Post by libelium-dev » Wed Jun 19, 2019 8:28 am

Hi,

Apologies for the mistake, you are right, the debug was enabled in your first outputs.

What is the serial ID of the node? Do you have another node to test the http requests?

Does the HTTP get example work?

Please in order to discard any bug in the library, send the following commands manually to the 4G module to check its functionality. To send commands manually, you have to upload the following code, then open the serial monitor and select Carriage return at the bottom of the window. Now wait around 20 seconds and introduce the next commands at the upper part of the serial monitor. Please share with us the answer of the module
  • AT
  • AT+WS46=25
  • AT+CGDCONT=1,"IP","telstra.m2m"
  • AT+CREG? //to send up to module will return CREG: 0,1 or CREG: 0,5
  • AT+CGREG? //to send up to module will return CGREG: 0,1 or CREG: 0,5
  • AT#GPRS=1
  • AT#HTTPCFG=0,"test.libelium.com",80
  • AT#HTTPSND=0,0,"/test-get-post.php?",6
  • varA=1

Code: Select all

void setup()
{  
  // init USB port
  USB.ON();
  USB.println(F("Bridge between USB port and SOCKET1"));

  Utils.setMuxSocket1();
  
  // begin serial communication
  beginSerial( 115200, SOCKET1);
  
  // switch on 3G/GPRS or expansion board in SOCKET1
  pinMode(GPRS_PW, OUTPUT);
  digitalWrite(GPRS_PW, HIGH);
  pinMode(DIGITAL6,OUTPUT);
  digitalWrite(DIGITAL6,HIGH);
  delay(1000);

  serialFlush(0);
  serialFlush(1);
  USB.ON();
}

void loop()
{   
  // UART1 ----> UART0 (USB)
  while( serialAvailable(1) > 0 ) 
  {
    // print
    printByte(serialRead(1),0);       
  }

  // USB (UART0) ----> UART1
  while( serialAvailable(0) > 0 ) 
  {
    // print 
    printByte(serialRead(0), 1);
  } 
}
Regards

B2L_steve
Posts: 18
Joined: Mon Jun 17, 2019 4:26 am
Company: Bio2Lab Pty Ltd

Re: HTTP POST using 4G library fails - error code 17

Post by B2L_steve » Wed Jun 19, 2019 10:13 am

Thanks Libellium Team

I do not understand the first two questions. The P&S is operating solo, so there is only one node broadcasting directly to the target. There is no meshelium.

The HTTP get example also fails with the same error message. Note the FTP example also fails, as detailed in a previous post.

I have upoloaded the code provided to bridge the USB port and SOCKET1 - commands and responses below:

H#
Bridge between USB port and SOCKET1
ATAT

NO CARRIER
AT+WS46=25

ERROR
AT+CGDCONT=1,"IP","telstra.m2m"

OK
AT+CREG?

+CREG: 0,1

OK
AT+CGREG?

+CGREG: 0,1

OK
AT#GPRS=1

+IP: 10.116.77.178

OK
AT#HTTPCFG=0,"test.libelium.com",80

OK
AT#HTTPSND=0,0,"/test-get-post.php?",6

ERROR

//Just in case the previous command had any errors, i also sent the following, with the responses listed below:

AT#HTTPSND=0,0,"/test-get-post.php?"

ERROR
varA=1
AT#HTTPSND=0,0,"/test-get-post.php?varA=1"

ERROR
AT#HTTPSND=0,0,"/test-get-post.php?varA=1"

ERROR

thanks for your help,
S

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: HTTP POST using 4G library fails - error code 17

Post by libelium-dev » Thu Jun 20, 2019 8:21 am

Hi,

Where are you from? We mean, in which country are you testing the node? Maybe it doesn't work due to latency problems.

In this case, we recommend using the TCP and SSL connection to create the HTTP request manually.

Regards

B2L_steve
Posts: 18
Joined: Mon Jun 17, 2019 4:26 am
Company: Bio2Lab Pty Ltd

Re: HTTP POST using 4G library fails - error code 17

Post by B2L_steve » Fri Jun 21, 2019 6:43 am

Australia - telstra network

how could I test if latency is an issue?

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: HTTP POST using 4G library fails - error code 17

Post by libelium-dev » Fri Jun 21, 2019 7:51 am

Hi,

It seems that there is a latency problem since our server is in Europe. Could you try to perform an http request to a server in Australia?

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest