Hello @Erel,
I have one issue regarding sending of data from b4r end.
I am able o connect successfully from B4r and the program connecting successfully.
Now I want to read the data [String format] at node.js end. But I am not able to resolve the issue and node.js end.
My b4r program log as follows:
Not sure why the below error is coming:
=============
HTTP/1.1 302 Found
Cache-Control: no-cache
Content-5.167.108/
Connection: close
=================
Could you please advice on this please?
Thanks-
Pokhraj Das
I have one issue regarding sending of data from b4r end.
I am able o connect successfully from B4r and the program connecting successfully.
Now I want to read the data [String format] at node.js end. But I am not able to resolve the issue and node.js end.
My b4r program log as follows:
B4X:
********************* PROGRAM STARTING ****************
AppStart
Connect State: 1
****************
AT+CIPSHUT
SHUT OK
AT+CIPSHUT
SHUT OK
Connect State: 2
****************
AT+CIPMUX=0
OK
AT+CIPMUX=0
OK
Connect State: 3
****************
AT+CSTT="airtelgprs.com"
OK
AT+CSTT="airtelgprs.com"
OK
Connect State: 4
****************
AT+CIPSTATUS
OK
STATE: IP START
AT+CIPSTATUS
OK
STATE: IP START
Connect State: 5
****************
AT+CIICR
AT+CIICR
****************
OK
OK
Connect State: 6
****************
AT+CIPSTATUS
OK
STATE: IP GPRSACT
AT+CIPSTATUS
OK
STATE: IP GPRSACT
Connect State: 7
****************
AT+CIFSR
100.121.191.128
Connect State: 8
****************
AT+CIPSTATUS
OK
STATE: IP STATUS
AT+CIPSTATUS
OK
STATE: IP STATUS
Connect State: 9
****************
AT+CIPSTART="TCP","35.185.167.108","80"
OK
AT+CIPSTART="TCP","35.185.167.108","80"
OK
****************
CONNECT OK
Connected!!!
****************
AT+CIPSEND
>
Sending data
****************
POST / HTTP/1.0
Host: 35.185.167.108
Content-Type: applicationtent-Length: 5
11.12
****************
SEND OK
HTTP/1.1 302 Found <<<--- Why this Error is coming
Cache-Control: no-cache
Content-5.167.108/
Connection: close
****************
CLOSED
****************
Not sure why the below error is coming:
=============
HTTP/1.1 302 Found
Cache-Control: no-cache
Content-5.167.108/
Connection: close
=================
B4X:
********************APP Module**************
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Public APN As String="airtelgprs.com"
Public host As String="35.185.167.108"
Private mytemp As String="11.12"
Private timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
timer1.Initialize("timer1_Tick",2000)
timer1.Enabled=True
GSM.Init(10,12)
GSM.Start
End Sub
Private Sub timer1_Tick
GSM.GetTemp(mytemp)
End Sub
B4X:
*************Part of GSM Module************
Private Sub ReadyToSend
Log("Sending data")
ServerResponse = True
astream.Write("POST ").Write("/").Write(" HTTP/1.0").Write(EOL)
astream.Write("Host: ").Write(Main.Host).Write(EOL)
'astream.Write("Authorization: key=").Write(Main.API_KEY).Write(EOL)
astream.Write("Content-Type: application/json").Write(EOL)
astream.Write("Connection: Keep-Alive").Write(EOL)
astream.Write("Content-Length: ").Write(NumberFormat(GlobalStore.Slot0.Length, 0, 0)).Write(EOL)
astream.Write(EOL)
astream.Write(GlobalStore.Slot0)
astream.Write(Array As Byte(0x1a))
End Sub
Could you please advice on this please?
Thanks-
Pokhraj Das