Hello,
im reaching out in order to see if others have had this problem before regadring the Nextion Series Screens.
im trying to send data from the esp32 to 7inch screen i have added my code below, i am able to recive data but unsure of sending data as i used examples from andriod itself to adapt to b4r.
sorry i dont have the sorce code.
you can see here when i use the nextion commands i send a way to list all wifi. from the code below it seems it does send as if i touch the two pins it will for ever loop but not sure if others know if the devcie needs the data to be different format.
*btw i know its not written the best but i was really just testing!
any help will be super great
thanks!
im reaching out in order to see if others have had this problem before regadring the Nextion Series Screens.
im trying to send data from the esp32 to 7inch screen i have added my code below, i am able to recive data but unsure of sending data as i used examples from andriod itself to adapt to b4r.
sorry i dont have the sorce code.
you can see here when i use the nextion commands i send a way to list all wifi. from the code below it seems it does send as if i touch the two pins it will for ever loop but not sure if others know if the devcie needs the data to be different format.
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 600
#End Region
'Ctrl+Click to open the C code folder: ide://run?File=%WINDIR%\System32\explorer.exe&Args=%PROJECT%\Objects\Src
Sub Process_Globals
Public Serial1 As Serial
Private wifi As ESP8266WiFi
Private serialnative2 As Stream
Private astream As AsyncStreams
Private RXD2,TXD2 As Byte 'ignore
Private bc As ByteConverter
Private LeDCount As Int = 60
Public RBG_LIGHT As AdafruitNeoPixel 'RGB WITH WS2812 - OUTPUT
Dim endChar As String = JoinStrings ( Array As String ( 0xff , 0xff , 0xff))
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
astream.Initialize(serialnative2, "astream_NewData", Null)
'example of connecting to a local network
RBG_LIGHT.Initialize(LeDCount,26,RBG_LIGHT.NEO_GRB) 'change led count as import!! to show! Rnd
RXD2 = 4
TXD2 = 2
RunNative("SerialNative2", Null)
Dim nodeInt As Int = wifi.Scan
Dim nodeString As String = nodeInt
GlobalStore.Put(5,nodeString)
Log(GlobalStore.Slot5)
Dim quot() As Byte = bc.HexToBytes(22)
'Dim SSID As String = JoinStrings( Array As String("<cb0.path=cb0.path+",bc.StringFromBytes(quot),wifi.ScannedSSID(i),bc.StringFromBytes(quot),">"))
' Dim SSID As String = JoinStrings( Array As String("t0.txt=\",bc.StringFromBytes(quot),wifi.ScannedSSID(0),"\",bc.StringFromBytes(quot)))
' Log(SSID.GetBytes)
' astream.Write(SSID.GetBytes)
' Dim k() As Byte = "0xff"
' astream.Write(k)
' astream.Write(k)
' astream.Write(k)
Log("write Array")
astream.Write("t2.txt=\""abcd""\").Write(Array As Byte(0xFF, 0xFF, 0xFF))
astream.Write("t2.txt=""abcd""").Write(Array As Byte(0xFF, 0xFF, 0xFF))
astream.Write("t2.txt=""abcd""").Write(Array As Byte(0xFF, 0xFF, 0xFF))
End Sub
#if C
void SerialNative2(B4R::Object* unused){
::Serial2.begin(9600, SERIAL_8N1, b4r_main::_rxd2, b4r_main::_txd2);
b4r_main::_serialnative2->wrappedStream = &::Serial2;
}
#End if
*btw i know its not written the best but i was really just testing!
any help will be super great
thanks!
Attachments
Last edited: