0

FONA 800 FONAtest POST data
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: FONA 800 FONAtest POST data

by adafruit_support_rick on Fri Sep 15, 2017 10:30 am

In the fona library folder, go into the 'includes' folder and edit FONAConfig.h to turn on debug messages:
Code: Select all | TOGGLE FULL SIZE
/* ADAFRUIT_FONA_DEBUG
 * When defined, will cause extensive debug output on the
 * DebugStream set in the appropriate platform/ header.
 */

#define ADAFRUIT_FONA_DEBUG


Run FONATest and try to POST something. Post the complete serial monitor trace

adafruit_support_rick
 
Posts: 34746
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: FONA 800 FONAtest POST data

by Digisol on Fri Sep 15, 2017 6:49 pm

Hello Rick!
Thank you for a speed reply!
I set #define ADAFRUIT_FONA_DEBUG 1, nothing happened, same information on serial monitor. I restarted Arduino IDE, and reprogrammed Arduino UNO. Please let me know what am I doing wrong, what am I missing to update, change, etc.

I wonder what happened at 2 last lines: It sends data, but it is 0 bytes long?

Status: 200
Len: 0

Here is the complete serial monitor trace:

Code: Select all | TOGGLE FULL SIZE
FONA basic test
Initializing....(May take 3 seconds)
Attempting to open comm with ATs
   ---> AT
   <--- OK
   ---> ATE0
   <--- OK
   ---> ATE0
   <--- OK
   ---> AT+CVHU=0
   <--- OK
   ---> ATI
   <--- SIM808 R13.08

OK

FONA is OK
Found FONA 808 (v1)
   ---> AT+GSN
   <--- XXXXXXXXXXXXXXX
Module YMEY: XXXXXXXXXXXXXXX
-------------------------------------
[?] Print this menu
[a] read the ADC 2.8V max (FONA800 & 808)
[b] read the Battery V and % charged
[C] read the SIM CCID
[U] Unlock SIM with PIN code
[i] read RSSI
[n] get Network status
[v] set audio Volume
[V] get Volume
[H] set Headphone audio (FONA800 & 808)
[e] set External audio (FONA800 & 808)
[T] play audio Tone
[P] PWM/Buzzer out (FONA800 & 808)
[f] tune FM radio (FONA800)
[F] turn off FM (FONA800)
[m] set FM volume (FONA800)
[M] get FM volume (FONA800)
[q] get FM station signal level (FONA800)
[c] make phone Call
[A] get call status
[h] Hang up phone
[p] Pick up phone
[N] Number of SMSs
[r] Read SMS #
[R] Read All SMS
[d] Delete SMS #
[s] Send SMS
[u] Send USSD
[y] Enable network time sync (FONA 800 & 808)
[Y] Enable NTP time sync (GPRS FONA 800 & 808)
[t] Get network time
[G] Enable GPRS
[g] Disable GPRS
[l] Query GSMLOC (GPRS)
[w] Read webpage (GPRS)
[W] Post to website (GPRS)
[O] Turn GPS on (FONA 808 & 3G)
[o] Turn GPS off (FONA 808 & 3G)
[L] Query GPS location (FONA 808 & 3G)
[x] GPS fix status (FONA808 v1 only)
[E] Raw NMEA out (FONA808)
[S] create Serial passthru tunnel
-------------------------------------

FONA> b
   ---> AT+CBC
   <--- +CBC: 0,84,4075
VBat = 4075 mV
   ---> AT+CBC
   <--- +CBC: 0,84,4075
VPct = 84%

FONA> i
   ---> AT+CSQ
   <--- +CSQ: 18,0
RSSI = 18: -78 dBm

FONA> n
   ---> AT+CREG?
   <--- +CREG: 0,1
Network status 1: Registered (home)

FONA> G
   ---> AT+CIPSHUT
   <--- SHUT OK
   ---> AT+CGATT=1
   <--- OK
   ---> AT+SAPBR=3,1,"CONTYPE","GPRS"
   <--- OK
   ---> AT+SAPBR=3,1,"APN","internet.itelcel.com"
   <--- OK
   ---> AT+CSTT="internet.itelcel.com","webgprs","webgprs2002"
   <--- OK
   ---> AT+SAPBR=3,1,"USER","webgprs"
   <--- OK
   ---> AT+SAPBR=3,1,"PWD","webgprs2002"
   <--- OK
   ---> AT+SAPBR=1,1
   <--- OK
   ---> AT+CIICR
   <--- OK
   
FONA> W
NOTE: in beta! Use simple websites to post!
URL to post (e.g. httpbin.org/post):
http://www.XXXXXXXXXXXXXXXXXXXX
Data to post (e.g. "foo" or "{"simple":"json"}"):
55550815270254FF
****
   ---> AT+HTTPTERM
   <--- ERROR
   ---> AT+HTTPINIT
   <--- OK
   ---> AT+HTTPPARA="CID"
   <--- OK
   ---> AT+HTTPPARA="UA"
   <--- OK
   ---> AT+HTTPPARA="URL"
   <--- OK
   ---> AT+HTTPPARA="CONTENT"
   <--- OK
   ---> AT+HTTPDATA=17,10000
   <--- DOWNLOAD
   <--- OK
   ---> AT+HTTPACTION=1
   <--- OK
Status: 200
Len: 0
   ---> AT+HTTPREAD
   <--- OK
Failed!
FONA>


With kind regards

Digisol
 
Posts: 5
Joined: Tue Nov 15, 2016 5:14 pm

Re: FONA 800 FONAtest POST data

by adafruit2 on Sat Sep 16, 2017 12:41 pm

huh i dont see the data actually sent. thing is, i didnt write the POST code, someone else did - so i have no idea if it works? :)

adafruit2
Site Admin
 
Posts: 15215
Joined: Fri Mar 11, 2005 7:36 pm

Re: FONA 800 FONAtest POST data

by adafruit_support_rick on Sun Sep 17, 2017 7:10 am

The trace is showing the POST data you're giving it, but I don't understand what that data is.
I thought you wanted to send "{"status": status}"?
But it looks like you've given it 55550815270254FF

The POST has succeeded, as you can see from the return status of 200. However, the server has not sent a response. That's why you see FONAtest printing "Failed!"

adafruit_support_rick
 
Posts: 34746
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: FONA 800 FONAtest POST data

by Digisol on Wed Sep 20, 2017 1:36 pm

Sorry for a long delay.
If I send data using this web site /http://www.http-post.com/ every single time, data is captured at our web site, and everytime I send data using Fona, we get a blank row.
I already checked that our website hast PHP.ini with post_max_size = 128MB, PHP code has header("HTTP/1.1 200");

Using Fona, I can get:
1.- Send and receive SMS.
2.- Enable NTP time sync and get network time.
3.-Enable GPRS
4.- Disable GPRS.
5.- Read webpage (GPRS)

Sometimes it is very difficult to found Fona; that I need to remove battery and USB cable, then Fona is found.
I am not sure if I got a defective Fona.
Thanks for your time and help.

Digisol
 
Posts: 5
Joined: Tue Nov 15, 2016 5:14 pm

Re: FONA 800 FONAtest POST data

by adafruit_support_rick on Wed Sep 20, 2017 3:11 pm

You don't have a defective FONA. You are getting a 200 status from the POST, therefore the connection is established and working. You have some problem with your server. It is probably rejecting the plain text data field

adafruit_support_rick
 
Posts: 34746
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Please be positive and constructive with your questions and comments.