Plug & Sense 4G(Au) HTTPS POST Requets

Post Reply
Nishant
Posts: 10
Joined: Mon Sep 10, 2018 2:02 am
Company: UC

Plug & Sense 4G(Au) HTTPS POST Requets

Post by Nishant » Thu Dec 13, 2018 1:23 pm

Hey dev, we have tried to send the data with the plug & sense 4G(AU) for HTTPS POST request, but with no success, we had a look at previous forums where they were suggested to use SSL example for 4G, we have tried with that example as well but to no success, help us with this issue asap.

Thanks
Nishant

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

Re: Plug & Sense 4G(Au) HTTPS POST Requets

Post by libelium-dev » Fri Dec 14, 2018 8:50 am

Hi,

For https post request, you have to use the example code for ssl sockets.
http://www.libelium.com/development/was ... l-sockets/

What code and API version are you using?

Regards

Nishant
Posts: 10
Joined: Mon Sep 10, 2018 2:02 am
Company: UC

Re: Plug & Sense 4G(Au) is not working with either SIM cards

Post by Nishant » Sun Sep 01, 2019 11:04 am

J#
Start program
Starting PM Sensor
PM Information string extracted:
Battery Level: 100 % | Battery (Volts): 4.1640000343 V
Sound Pressure Level with A-Weighting (SLOW): 65.7410964965 dBA
Particle sensor started
Measure performed
PM 1: 1.280 ug/m3
PM 2.5: 1.710 ug/m3
PM 10: 1.790 ug/m3
***************************************
Temperature: 21.72 Celsius degrees
RH: 27.13 %
Pressure: 94657.38 Pa
***************************************
Luminosity: 43 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 0.000 ppm
***************************************
1. 4G module ready...
2.1. Opening a socket... done!
===============================
Current ASCII Frame:
Length: 137
Frame Type: 134
frame (HEX): 3C3D3E860A23324236393138464443333337444536362373635F3030312330234E4F4953453A36352E373423504D313A312E3238303023504D325F353A312E3731303023504D31303A312E373930302354433A32312E37322348554D3A32372E3123505245533A39343635372E3338234C55583A343323434F323A302E303030234241543A31303023
frame (STR): <=>†
#2B6918FDC337DE66#sc_001#0#NOISE:65.74#PM1:1.2800#PM2_5:1.7100#PM10:1.7900#TC:21.72#HUM:27.1#PRES:94657.38#LUX:43#CO2:0.000#BAT:100#
===============================
data to send:GET /api/v2/nodeupload?frame=3C3D3E860A23324236393138464443333337444536362373635F3030312330234E4F4953453A36352E373423504D313A312E3238303023504D325F353A312E3731303023504D31303A312E373930302354433A32312E37322348554D3A32372E3123505245533A39343635372E3338234C55583A343323434F323A302E303030234241543A31303023&accesskey=8788d67c9fe547965dd19350 HTTP/1.1
Host: qprcapi.cbrdata.com
Content-Length: 0


2.3. Sending a frame... done!
2.4. Waiting to receive data...
-----------------------------------
Data received:HTTP/1.1 201 Created
Date: Sun, 01 Sep 2019 08:40:58 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 26
Connection: keep-alive
Set-Cookie: __cfduid=d9ad809420e1b546dd17369666a79c5d01567327258; expires=Mon, 31-Aug-20 08:40:58 GMT; path=/; domain=.cbrdata.com; HttpOnly
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Origin: *
ETag: W/"1a-3Pv2Zp7wFFOxlEGSjROaYGo+j+A"
Server: cloudflare
CF-RAY: 50f5f1430c56d96a-H
-----------------------------------
2.5. Socket closed OK
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 98 % | Battery (Volts): 4.1440000534 V
Sound Pressure Level with A-Weighting (SLOW): 64.0806961059 dBA
Particle sensor started
Measure performed
PM 1: 1.030 ug/m3
PM 2.5: 1.460 ug/m3
PM 10: 10.920 ug/m3
***************************************
Temperature: 21.74 Celsius degrees
RH: 27.84 %
Pressure: 94656.22 Pa
***************************************
Luminosity: 43 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 0.000 ppm
***************************************
1. 4G module ready...
2.1. Opening a socket... done!
===============================
Current ASCII Frame:
Length: 137
Frame Type: 134
frame (HEX): 3C3D3E860A23324236393138464443333337444536362373635F3030312331234E4F4953453A36342E303823504D313A312E3033303023504D325F353A312E3436303023504D31303A31302E393230302354433A32312E37342348554D3A32372E3823505245533A39343635362E3232234C55583A343323434F323A302E303030234241543A393823
frame (STR): <=>†
#2B6918FDC337DE66#sc_001#1#NOISE:64.08#PM1:1.0300#PM2_5:1.4600#PM10:10.9200#TC:21.74#HUM:27.8#PRES:94656.22#LUX:43#CO2:0.000#BAT:98#
===============================
data to send:GET /api/v2/nodeupload?frame=3C3D3E860A23324236393138464443333337444536362373635F3030312331234E4F4953453A36342E303823504D313A312E3033303023504D325F353A312E3436303023504D31303A31302E393230302354433A32312E37342348554D3A32372E3823505245533A39343635362E3232234C55583A343323434F323A302E303030234241543A393823&accesskey=8788d67c9fe547965dd19350 HTTP/1.1
Host: qprcapi.cbrdata.com
Content-Length: 0


2.3. Sending a frame... done!
2.4. Waiting to receive data...
-----------------------------------
Data received:HTTP/1.1 201 Created
Date: Sun, 01 Sep 2019 08:41:54 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 26
Connection: keep-alive
Set-Cookie: __cfduid=d71ef059df0594ecae0bd46152d48314b1567327314; expires=Mon, 31-Aug-20 08:41:54 GMT; path=/; domain=.cbrdata.com; HttpOnly
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Origin: *
ETag: W/"1a-3Pv2Zp7wFFOxlEGSjROaYGo+j+A"
Server: cloudflare
CF-RAY: 50f5f2a3281e3371-H
-----------------------------------
2.5. Socket closed OK
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 98 % | Battery (Volts): 4.1440000534 V
Sound Pressure Level with A-Weighting (SLOW): 61.7546997070 dBA
Particle sensor started
Measure performed
PM 1: 0.930 ug/m3
PM 2.5: 1.240 ug/m3
PM 10: 9.830 ug/m3
***************************************
Temperature: 21.74 Celsius degrees
RH: 37.03 %
Pressure: 94659.66 Pa
***************************************
Luminosity: 44 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 1162.083 ppm
***************************************
1. 4G module ready...
2.1. Opening a socket... done!
===============================
Current ASCII Frame:
Length: 139
Frame Type: 134
frame (HEX): 3C3D3E860A23324236393138464443333337444536362373635F3030312332234E4F4953453A36312E373523504D313A302E3933303023504D325F353A312E3234303023504D31303A392E383330302354433A32312E37342348554D3A33372E3023505245533A39343635392E3636234C55583A343423434F323A313136322E303833234241543A393823
frame (STR): <=>†
#2B6918FDC337DE66#sc_001#2#NOISE:61.75#PM1:0.9300#PM2_5:1.2400#PM10:9.8300#TC:21.74#HUM:37.0#PRES:94659.66#LUX:44#CO2:1162.083#BAT:98#
===============================
data to send:GET /api/v2/nodeupload?frame=3C3D3E860A23324236393138464443333337444536362373635F3030312332234E4F4953453A36312E373523504D313A302E3933303023504D325F353A312E3234303023504D31303A392E383330302354433A32312E37342348554D3A33372E3023505245533A39343635392E3636234C55583A343423434F323A313136322E303833234241543A393823&accesskey=8788d67c9fe547965dd19350 HTTP/1.1
Host: qprcapi.cbrdata.com
Content-Length: 0


2.3. Sending a frame... done!
2.4. Waiting to receive data...
-----------------------------------
Data received:HTTP/1.1 201 Created
Date: Sun, 01 Sep 2019 08:42:50 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 26
Connection: keep-alive
Set-Cookie: __cfduid=d7cfeff27577b535ea881eb1f15416c911567327370; expires=Mon, 31-Aug-20 08:42:50 GMT; path=/; domain=.cbrdata.com; HttpOnly
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Origin: *
ETag: W/"1a-3Pv2Zp7wFFOxlEGSjROaYGo+j+A"
Server: cloudflare
CF-RAY: 50f5f400783484fa-H
-----------------------------------
2.5. Socket closed OK
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 98 % | Battery (Volts): 4.1490001678 V
Sound Pressure Level with A-Weighting (SLOW): 43.2717971801 dBA
Particle sensor started
Measure performed
PM 1: 1.130 ug/m3
PM 2.5: 1.480 ug/m3
PM 10: 1.560 ug/m3
***************************************
Temperature: 21.78 Celsius degrees
RH: 27.72 %
Pressure: 94665.36 Pa
***************************************
Luminosity: 44 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 1332.531 ppm
***************************************
1. 4G module ready...
2.1. Error opening socket. Error code: 26
2.5. Error closing socket. Error code: 1
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 98 % | Battery (Volts): 4.1890001296 V
Sound Pressure Level with A-Weighting (SLOW): 40.6196975708 dBA
Particle sensor started
Measure performed
PM 1: 1.000 ug/m3
PM 2.5: 1.340 ug/m3
PM 10: 1.660 ug/m3
***************************************
Temperature: 21.78 Celsius degrees
RH: 26.74 %
Pressure: 94661.17 Pa
***************************************
Luminosity: 5 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 986.308 ppm
***************************************
1. 4G module ready...
2.1. Opening a socket... done!
===============================
Current ASCII Frame:
Length: 137
Frame Type: 134
frame (HEX): 3C3D3E860A23324236393138464443333337444536362373635F3030312333234E4F4953453A34302E363223504D313A312E3030303023504D325F353A312E3334303023504D31303A312E363630302354433A32312E37382348554D3A32362E3723505245533A39343636312E3136234C55583A3523434F323A3938362E333038234241543A393823
frame (STR): <=>†
#2B6918FDC337DE66#sc_001#3#NOISE:40.62#PM1:1.0000#PM2_5:1.3400#PM10:1.6600#TC:21.78#HUM:26.7#PRES:94661.16#LUX:5#CO2:986.308#BAT:98#
===============================
data to send:GET /api/v2/nodeupload?frame=3C3D3E860A23324236393138464443333337444536362373635F3030312333234E4F4953453A34302E363223504D313A312E3030303023504D325F353A312E3334303023504D31303A312E363630302354433A32312E37382348554D3A32362E3723505245533A39343636312E3136234C55583A3523434F323A3938362E333038234241543A393823&accesskey=8788d67c9fe547965dd19350 HTTP/1.1
Host: qprcapi.cbrdata.com
Content-Length: 0


2.3. Sending a frame... done!
2.4. Waiting to receive data...
-----------------------------------
Data received:HTTP/1.1 201 Created
Date: Sun, 01 Sep 2019 08:44:50 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 26
Connection: keep-alive
Set-Cookie: __cfduid=dc7fb73a9a62e23f5fcd1b0c7954a6b941567327489; expires=Mon, 31-Aug-20 08:44:49 GMT; path=/; domain=.cbrdata.com; HttpOnly
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Origin: *
ETag: W/"1a-3Pv2Zp7wFFOxlEGSjROaYGo+j+A"
Server: cloudflare
CF-RAY: 50f5f6ea897ea336-H
-----------------------------------
2.5. Socket closed OK
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 98 % | Battery (Volts): 4.1440000534 V
Sound Pressure Level with A-Weighting (SLOW): 44.0924987792 dBA
Particle sensor started
Measure performed
PM 1: 0.920 ug/m3
PM 2.5: 1.190 ug/m3
PM 10: 1.430 ug/m3
***************************************
Temperature: 21.73 Celsius degrees
RH: 27.71 %
Pressure: 94653.55 Pa
***************************************
Luminosity: 0 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 743.655 ppm
***************************************
1. 4G module ready...
2.1. Opening a socket... done!
===============================
Current ASCII Frame:
Length: 137
Frame Type: 134
frame (HEX): 3C3D3E860A23324236393138464443333337444536362373635F3030312334234E4F4953453A34342E303923504D313A302E3932303023504D325F353A312E3139303023504D31303A312E343330302354433A32312E37332348554D3A32372E3723505245533A39343635332E3535234C55583A3023434F323A3734332E363535234241543A393823
frame (STR): <=>†
#2B6918FDC337DE66#sc_001#4#NOISE:44.09#PM1:0.9200#PM2_5:1.1900#PM10:1.4300#TC:21.73#HUM:27.7#PRES:94653.55#LUX:0#CO2:743.655#BAT:98#
===============================
data to send:GET /api/v2/nodeupload?frame=3C3D3E860A23324236393138464443333337444536362373635F3030312334234E4F4953453A34342E303923504D313A302E3932303023504D325F353A312E3139303023504D31303A312E343330302354433A32312E37332348554D3A32372E3723505245533A39343635332E3535234C55583A3023434F323A3734332E363535234241543A393823&accesskey=8788d67c9fe547965dd19350 HTTP/1.1
Host: qprcapi.cbrdata.com
Content-Length: 0


2.3. Sending a frame... done!
2.4. Waiting to receive data...
-----------------------------------
Data received:HTTP/1.1 201 Created
Date: Sun, 01 Sep 2019 08:45:47 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 26
Connection: keep-alive
Set-Cookie: __cfduid=d15f759641dddc979b170f58aba6464131567327547; expires=Mon, 31-Aug-20 08:45:47 GMT; path=/; domain=.cbrdata.com; HttpOnly
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Origin: *
ETag: W/"1a-3Pv2Zp7wFFOxlEGSjROaYGo+j+A"
Server: cloudflare
CF-RAY: 50f5f851a956a2ca-H
-----------------------------------
2.5. Socket closed OK
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 93 % | Battery (Volts): 4.1440000534 V
Sound Pressure Level with A-Weighting (SLOW): 41.4568977355 dBA
Particle sensor started
Measure performed
PM 1: 1.100 ug/m3
PM 2.5: 1.380 ug/m3
PM 10: 1.390 ug/m3
***************************************
Temperature: 21.70 Celsius degrees
RH: 27.68 %
Pressure: 94663.50 Pa
***************************************
Luminosity: 0 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 670.169 ppm
***************************************
1. 4G module ready...
2.1. Error opening socket. Error code: 26
2.5. Error closing socket. Error code: 1
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 95 % | Battery (Volts): 4.1640000343 V
Sound Pressure Level with A-Weighting (SLOW): 40.4034004211 dBA
Particle sensor started
Measure performed
PM 1: 0.840 ug/m3
PM 2.5: 1.200 ug/m3
PM 10: 4.100 ug/m3
***************************************
Temperature: 21.65 Celsius degrees
RH: 27.69 %
Pressure: 94664.66 Pa
***************************************
Luminosity: 0 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 639.837 ppm
***************************************
1. 4G module ready...
2.1. Error opening socket. Error code: 26
2.5. Error closing socket. Error code: 1
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 95 % | Battery (Volts): 4.1640000343 V
Sound Pressure Level with A-Weighting (SLOW): 40.6530990600 dBA
Particle sensor started
Measure performed
PM 1: 0.780 ug/m3
PM 2.5: 1.040 ug/m3
PM 10: 1.060 ug/m3
***************************************
Temperature: 21.61 Celsius degrees
RH: 27.65 %
Pressure: 94658.19 Pa
***************************************
Luminosity: 0 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 609.013 ppm
***************************************
1. 4G module ready...
2.1. Error opening socket. Error code: 26
2.5. Error closing socket. Error code: 1
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 97 % | Battery (Volts): 4.1789999008 V
Sound Pressure Level with A-Weighting (SLOW): 40.8899002075 dBA
Particle sensor started
Measure performed
PM 1: 0.860 ug/m3
PM 2.5: 1.200 ug/m3
PM 10: 1.280 ug/m3
***************************************
Temperature: 21.58 Celsius degrees
RH: 27.18 %
Pressure: 94663.55 Pa
***************************************
Luminosity: 0 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 571.431 ppm
***************************************
1. 4G module ready...
2.1. Error opening socket. Error code: 26
2.5. Error closing socket. Error code: 1
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 99 % | Battery (Volts): 4.1939997673 V
Sound Pressure Level with A-Weighting (SLOW): 42.9563980102 dBA
Particle sensor started
Measure performed
PM 1: 0.680 ug/m3
PM 2.5: 0.810 ug/m3
PM 10: 0.830 ug/m3
***************************************
Temperature: 21.56 Celsius degrees
RH: 27.67 %
Pressure: 94668.51 Pa
***************************************
Luminosity: 43 luxes
Enter deep sleep mode to wait for NDIR heating time...
***************************************
Gas concentration: 614.142 ppm
***************************************
1. 4G module ready...
2.1. Error opening socket. Error code: 26
2.5. Error closing socket. Error code: 1
3. Switch OFF 4G module
4. Enter deep sleep...
5. Wake up!!


Battery Level: 95 % | Battery (Volts): 4.1890001296 V
Sound Pressure Level with A-Weighting (SLOW): 40.9100990295 dBA

Nishant
Posts: 10
Joined: Mon Sep 10, 2018 2:02 am
Company: UC

4G Au is not working

Post by Nishant » Sun Sep 01, 2019 2:47 pm

Hey Dev,

I have tried using all sim cards for Smart cities pro, but still gives me error 26 for optus sim cards and error 2 for rest of the sim cards.

I have also tried debug mode and it says 4g is detected and working but it still returns the error.

I have set up the apn as well, Please get back asap, Thanks.

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

Re: Plug & Sense 4G(Au) HTTPS POST Requets

Post by libelium-dev » Mon Sep 02, 2019 8:08 am

Hi,

What API did you use to upload the code?

We see that the HTTP request works at the beginning of the log. Did you change something then?

Regards

Nishant
Posts: 10
Joined: Mon Sep 10, 2018 2:02 am
Company: UC

Re: Plug & Sense 4G(Au) HTTPS POST Requets

Post by Nishant » Mon Sep 02, 2019 3:46 pm

Hey dev,

I'm using the current API version 42.

I haven't changed any settings, the apn is correct as it has worked with other 4 P&S models.

It uplaods first 5-6 times and then returns error code 26. As I discussed before i have also tried using different sim operators but it return error code 2. There is no sim pin on either of these sim cards.

We have worked with 4 smart cities plug and sense 4g AU and none of these models had issues with 4g. We just plug in the sim card and it works.

Thanks
Nishant

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

Re: Plug & Sense 4G(Au) HTTPS POST Requets

Post by libelium-dev » Tue Sep 03, 2019 8:16 am

Hi,

Could you please share the code uploaded with us? So we will debug if there is any issue in the code.

Is the node trying to send data through an HTTP GET request? Could you please try to perform the HTTP request using the following example codes? Please copy here the output with debug mode 2 enabled for 4G module (Wasp4G.h file)

Code: Select all

#define DEBUG_WASP4G 	2
http://www.libelium.com/development/was ... -http-get/
http://www.libelium.com/development/was ... cp-client/

In addition please upload the following code to know more information about the 4G module
http://www.libelium.com/development/was ... dule-info/

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest