Hi,
I'm using the rESP8266FileSystem library to write to / read from a config file on my WeMos D1 R2's built-in flash file system.
When I first boot the board, I can write to the config file as many times as I want with no issues - however when I send config data from a B4A app via UDP, copy that config data into variables on the WeMos & then write it to the config, the board crashes with this error:
The weird thing is that this crash happens after the file has been written & closed - so it's not an issue with the format of the data (it's the same variables that I'm writing every time anyway & even if I hard code data in there, I still get the crash).
I've done some searching online & it seems that the "Exception(9)" is something to do with the WiFi resetting (or something), but I haven't really been able to find anything to help me.
Here's the code I use to write to the config:
This is driving me absolutely nuts. I can't get it to work no matter what I do.
- Colin.
I'm using the rESP8266FileSystem library to write to / read from a config file on my WeMos D1 R2's built-in flash file system.
When I first boot the board, I can write to the config file as many times as I want with no issues - however when I send config data from a B4A app via UDP, copy that config data into variables on the WeMos & then write it to the config, the board crashes with this error:
Exception (9):
epc1=0x402095a6 epc2=0x00000000 epc3=0x00000000 excvaddr=0x342e333a depc=0x00000000
ctx: cont
sp: 3ffef840 end: 3ffefa80 offset: 01a0
>>>stack>>>
3ffef9e0: 3ffee874 3fff1b4c 3fff103c 3fff0f14
3ffef9f0: 3fffdad0 3fff0354 3ffee874 40208b37
3ffefa00: 3ffe8700 00008bc1 3ffee7b0 40207355
3ffefa10: 00000000 000084e3 3ffee788 4020751a
3ffefa20: 3ffe8480 00000001 3ffee814 3ffeea58
3ffefa30: 3fffdad0 3fff0354 3ffee7a8 40207414
3ffefa40: 3fffdad0 3ffee7b0 3fff10b4 4020747b
3ffefa50: feefeffe 00000000 3ffeea50 40208cd3
3ffefa60: feefeffe feefeffe feefeffe 4020a4c4
3ffefa70: feefeffe feefeffe 3ffeea60 40100718
<<<stack<<<
ets Jan 8 2013,rst cause:2, boot mode1,6)
ets Jan 8 2013,rst cause:4, boot mode1,6)
wdt reset
The weird thing is that this crash happens after the file has been written & closed - so it's not an issue with the format of the data (it's the same variables that I'm writing every time anyway & even if I hard code data in there, I still get the crash).
I've done some searching online & it seems that the "Exception(9)" is something to do with the WiFi resetting (or something), but I haven't really been able to find anything to help me.
Here's the code I use to write to the config:
B4X:
Private Sub saveConfig
Private buffer() As Byte
Private bc As ByteConverter
If fs.OpenReadWrite("myFuelConfig.dat") Then
Log("Config open for writing")
fs.Position = 0
buffer = bc.StringToBytes(JoinStrings(Array As String(supplyRate, ":", returnRate, ":", calibrationOffset))) 'local config variables
Log("BUFFER: ", buffer)
fs.Stream.WriteBytes(buffer, 0, buffer.Length)
fs.Stream.Flush
fs.Close
Log("Config Saved")
End If
End Sub
This is driving me absolutely nuts. I can't get it to work no matter what I do.
- Colin.