Hello;
I declred verables in main.
After I call this variables on usermodule.
I read an error on log. Where is the problem?
I checked values
WiFiServer.Read32(1)>>> "-"
WiFiServer.Read32(1)>>> "-"
MAIN CODE
USER MODULE >> WifiServer
I declred verables in main.
After I call this variables on usermodule.
I read an error on log. Where is the problem?
I checked values
WiFiServer.Read32(1)>>> "-"
WiFiServer.Read32(1)>>> "-"
MAIN CODE
B4X:
Sub Process_Globals
Public Const C_AP_user As String="Default_AP_for_ARDUINO"
Public Const C_AP_pass As String="12345678"
Public Const C_Host_datetime As String="kartektube.com"
Public Const C_Host_gets_datetime As String="/datetime.asp"
Public Const C_KartekWifi_User As String="KARTEK2"
Public Const C_KartekWifi_Pass As String="kartek6161"
Public Merkez_wifi(2) As String
Public Makine(2) As String
Public Sensor_Kapi As Boolean
Public Sensor_Motor As Boolean
Public Sensor_Sayac As Boolean
end sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
ww=True
Log("step1")
Log("Eeprom size:",eeprom.size)
eeprom.WriteBytes(bc.StringToBytes("tayfur"),4000)
Log("kayıt")
Merkez_wifi(0) = (WiFiServer.ReadSSID)
Log("****1**** ",Merkez_wifi(0))
Merkez_wifi(1) = (WiFiServer.ReadPassword)
Log("****2**** ",Merkez_wifi(1))
Makine(0)=WiFiServer.Read32(1)
Log("****3**** ",Makine(0))
Makine(1)=WiFiServer.Read32(2)
Log("****4**** ",Makine(1))
If WiFiServer.Read32(2)="T" Then Sensor_Kapi=True Else Sensor_Kapi=False
If WiFiServer.Read32(3)="T" Then Sensor_Motor=True Else Sensor_Motor=False
If WiFiServer.Read32(4)="T" Then Sensor_Sayac=True Else Sensor_Sayac=False
end sub
USER MODULE >> WifiServer
B4X:
Private sub logs
Log(">>>>>>>>>1",Main.Makine(0))
end sub
Public Sub Read32(StartPositon As Int) As String
Dim x As String ="-"
Dim header() As Byte = eeprom.ReadBytes(StartPositon*32, 2)
If header(0) = MAGIC_EEPROM Then
Dim data() As Byte = eeprom.ReadBytes(StartPositon*32+2, header(1))
x = bc.StringFromBytes(data)'(bc.SubString2(data, 0, i))
Else
Log("Network data not found.")
x="-"
End If
Return x
End Sub
Public Sub Write32(data As String,StartPositon As Int) As Boolean
If data.Length>30 Then Return False
eeprom.WriteBytes(Array As Byte(MAGIC_EEPROM,data.Length),StartPositon*32)
eeprom.WriteBytes(data,StartPositon*32+2)
Return True
End Sub
>>>>>>>>>1
Exception (28):
epc1=0x4000bf70 epc2=0x00000000 epc3=0x00000000 excvaddr=0x0a0d312c depc=0x00000000
ctx: cont
sp: 3ffefa50 end: 3fff0180 offset: 01a0
>>>stack>>>
3ffefbf0: 3ffefc90 3ffefc70 00000004 00000001
3ffefc00: 0a0d312e 3ffefc60 402091bc 3ffef160
3ffefc10: 3ffefc50 00000009 00000001 40208ae0
3ffefc20: 3ffef09c 00000002 00000000 40202745
3ffefc30: 3ffefc40 00000002 00000001 4020235f
3ffefc40: 4023662c 00000066 0a0d312e 40202365
3ffefc50: 3ffeed98 00000002 00000000 40209472
3ffefc60: 3ffefc90 3ffefc70 00000004 feefeffe
3ffefc70: feefeffe 00000066 4023662c 00000065
3ffefc80: 0a0d312e 3ffe85c2 3ffeeeb8 40201ec3
Exception (28):
epc1=0x4000bf70 epc2=0x00000000 epc3=0x00000000 excvaddr=0x0a0d312c depc=0x00000000
ctx: cont
sp: 3ffefa50 end: 3fff0180 offset: 01a0
>>>stack>>>
3ffefbf0: 3ffefc90 3ffefc70 00000004 00000001
3ffefc00: 0a0d312e 3ffefc60 402091bc 3ffef160
3ffefc10: 3ffefc50 00000009 00000001 40208ae0
3ffefc20: 3ffef09c 00000002 00000000 40202745
3ffefc30: 3ffefc40 00000002 00000001 4020235f
3ffefc40: 4023662c 00000066 0a0d312e 40202365
3ffefc50: 3ffeed98 00000002 00000000 40209472
3ffefc60: 3ffefc90 3ffefc70 00000004 feefeffe
3ffefc70: feefeffe 00000066 4023662c 00000065
3ffefc80: 0a0d312e 3ffe85c2 3ffeeeb8 40201ec3
Last edited: