No response coming from SoftwareSerial but when I'm using arduino it is working. Same RX and TX pin.
Here is my code. IT should reply with AT+OK
Here is my code. IT should reply with AT+OK
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Public SoftwareSerial As SoftwareSerial
Public Stream As AsyncStreams
Public Timer As Timer
Dim DP As D1Pins
End Sub
Private Sub AppStart
Serial1.Initialize(9600)
SoftwareSerial.Initialize(9600, DP.D1, DP.D2)
Stream.Initialize(SoftwareSerial.Stream, "Stream_NewData", "Stream_Error")
Timer.Initialize("Timer_Tick", 2500)
Timer.Enabled = True
SoftwareSerial.Listening = True
Delay(1000)
Log("Ready...")
End Sub
Sub Stream_NewData (Buffer() As Byte)
Log("Stream_NewData")
Log(Buffer)
End Sub
Sub Stream_Error
End Sub
Sub Timer_Tick
Log("Sending...")
Stream.Write("AT".GetBytes)
Stream.Write(CRLF)
End Sub