Brainstorming Exception (28)

Exception (28):
09:41:12.749 -> epc1=0x4020f1d5 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
09:41:12.842 -> 
09:41:12.842 -> >>>stack>>>
09:41:12.842 -> 
09:41:12.842 -> ctx: cont
09:41:12.842 -> sp: 3ffffbc0 end: 3fffffd0 offset: 0190
09:41:12.935 -> 3ffffd50:  402118ec 3ffffe11 00000002 00000000  
09:41:12.935 -> 3ffffd60:  3ffef3a8 3fff753c 00000000 3ffffe80  
09:41:13.028 -> 3ffffd70:  00000000 3ffe8368 3ffffdd0 4020d685  
09:41:13.028 -> 3ffffd80:  00000002 7fffffff 00002200 3ffe8368  
09:41:13.121 -> 3ffffd90:  40258c04 3ffe8368 402118ec 00000003  
09:41:13.168 -> 3ffffda0:  00000000 0000000a 3ffffe13 00000000  
09:41:13.215 -> 3ffffdb0:  3fff753c 4010558f 3ffecfa8 3ffe8a84  
09:41:13.261 -> 3ffffdc0:  3ffe8a85 3ffe8368 3ffffe80 40211e00  
09:41:13.306 -> 3ffffdd0:  00000000 ffffffff 00000000 00000000  
09:41:13.402 -> 3ffffde0:  00000002 00000000 00302073 0000007f  
09:41:13.402 -> 3ffffdf0:  3fff7580 3ffef370 3fff7480 4021b87c  
09:41:13.496 -> 3ffffe00:  3ffe9dc0 7fffffff 00002200 32000001  
09:41:13.496 -> 3ffffe10:  00373330 3fff747c 000000ff 00000001  
09:41:13.589 -> 3ffffe20:  3ffef014 00000001 00000000 4020801d  
09:41:13.635 -> 3ffffe30:  3fffff10 3fffff00 00000010 00000001  
09:41:13.682 -> 3ffffe40:  3fffff10 3fffff00 0000000c 00000002  
09:41:13.729 -> 3ffffe50:  00000000 3ffeed92 3ffef014 40208211  
09:41:13.776 -> 3ffffe60:  00000005 00000000 00000000 3ffeefc8  
09:41:13.870 -> 3ffffe70:  3fffdad0 3ffe8368 0000002d 4020dcf9  
09:41:13.870 -> 3ffffe80:  3ffeebc4 3fffff10 0000002c ffff0208  
09:41:13.962 -> 3ffffe90:  3ffeebc4 0000002c 00000000 40205774  
09:41:14.008 -> 3ffffea0:  00000000 00000001 3ffeecf8 4020549c  
09:41:14.055 -> 3ffffeb0:  00000000 00000001 3ffeff0c 3ffeff0c  
09:41:14.101 -> 3ffffec0:  00000007 00000007 00000000 40205518  
09:41:14.147 -> 3ffffed0:  3fffff10 00000001 00000001 00000000  
09:41:14.193 -> 3ffffee0:  00000007 3fffff10 3fffff10 3fffff00  
09:41:14.242 -> 3ffffef0:  0000000c 3ffeec1d 3fffff80 402050db  
09:41:14.334 -> 3fffff00:  00000002 3ffeec1d 0000001c 00000000  
09:41:14.334 -> 3fffff10:  00000000 00000000 3ffeee30 40201ac6  
09:41:14.427 -> 3fffff20:  3fffdad0 3ffeeca0 3ffeebc4 40201c4e  
09:41:14.474 -> 3fffff30:  00000000 00000000 00000000 00000000  
09:41:14.519 -> 3fffff40:  00000000 00000000 00000000 00000000  
09:41:14.567 -> 3fffff50:  00000708 000000e1 3ffe862c 401009b2  
09:41:14.613 -> 3fffff60:  3fff053c 3fff01cc 00000000 3ffe8895  
09:41:14.659 -> 3fffff70:  3ffe85cc 00000020 3ffeff54 40100d00  
09:41:14.705 -> 3fffff80:  091c0217 3ffe0225 3ffeee30 40201299  
09:41:14.798 -> 3fffff90:  00000000 00000000 feefeffe feefeffe  
09:41:14.844 -> 3fffffa0:  feefeffe feefeffe feefeffe 3ffeefc8  
09:41:14.890 -> 3fffffb0:  3fffdad0 00000000 3ffeef9c 40207598  
09:41:14.937 -> 3fffffc0:  feefeffe feefeffe 3fffdab0 40100fcd  
09:41:14.983 -> <<<stack<<<
09:41:15.029 -> 
09:41:15.029 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------

This isn’t going to be like my standard type of post. Instead of writing paragraphs I’m going to be working in a bullet point Q&A format where I’m just going to be hammering out every thought I’m having here, instead of working out of a notebook/piece of paper, and see what sticks.

I know I said that I wanted this to be quick, and have still somehow come up with 6 different things to try off the top of my head.
In no particular order, they are:

  • Review what exactly causes a (28)

  • comment out LCD splashscreen message and try again - if prog runs, move splashscreen to the loop and try again.

  • would RTC make a difference with scheduling wifi uploads?

  • Would a serial snIF work to make sure line is free?

  • Retool timing on Serial push from Uno?

  • On demand data from Uno instead of autolaunch?

  • Have Uno listen / respond to requests from Node?

  • Unique Serial print commands on every other line in order to determine what piece(s) of code are triggering the exception.

  • reduce screen display/update time from 2000 millis to 1500 or 1000 millis per row (milli is Arduino slag for millisecond)

  • use a counter to keep track of which line of text the LCD should print, in order to tighten up loop time. (vs printing each line once before looping)

  • Reduce number of lines being printed on display? - counter from 9 would fix as only 1 line would be loaded at a time.

Did I say 6 ideas? Once I start brainstorming, they tend to just keep coming… I haven’t even had a chance to complete my first test, and I’ve increased my list size by over 50%…

OK, I’ve now got my first asnwer: Exception (28) is a request for an invalid memory address, caused by either a cache that has been turned off, or a “wild pointer” (think of pointer as the arduino equivalent of a desktop icon for a string of data you’re working with)

  • Leads me to wonder at what point is the SenPak data actually purged? - Why can’t I see it?
    Is it a case of making sure data is copied to LCD before being uploaded?

  • Does data upload need to be handled by scheduled function to avoid?

The confusing this is that my TEST data stream is received and posted to the spreadsheet, but when I switch to using a similarly formatted, piece of live data the NodeMCU starts crashing almost instantaneously. I think that there is something in the way the data is being received that is doing me in… what is so different between the data strings? Format type? (String vs char vs float, etc), is a process being interrupted by incoming data?

This is probably something…. I’m looking at my test data sting again, and noticed that the spreadsheet isn’t getting all the data that is being sent.
The way that the line with the data starting 999.99 only appeared the once on the spreadsheet tells me that info is absolutely moving or changing before it can be accessed. The test file I’m using pushes 3 strings of SenPakA data and one piece of SenPakX data ar regular intervals, so I would have thought I would have seen equal measures of each piece of the 3 SenPakAs in a repeating sequence. It reinforces my idea that I’m going to have to put something in place where data isn’t refreshed until the NodeMCU wants it to be replaced… prefereably at the end of the LCD display sequence.


  • Between the setup and loop, I found 13 seconds of questionable delays in the code… if its a watchdog timer issue, could this be triggering it?
    -shortened set up loop by reducing character delays in the LCD splash message (If reading debug info correctly, it crashed at line 190 which occurs after a 3 second delay am removing this delay)

  • idea: if data is missing when LCD updates, can I control the migration of data from the “buckets” to the “A values” through the loop, instead of automatically transfer/pushing all the way through as soon as the data is received?

  • Adding a layer of LCD holding buckets that we control the refresh of?


Without a data stream the NodeMCU crashes - there doesn’t seem to be a contingency in the code for what it should do if the “new data” flag isn’t flagged. Alternatively, when I have the Uno transmitting my looping test data it now crashes somewhere around displaying current senpak data. This is a weird development; Though intermittent, I’m pretty sure my test data was accepted without crashing, yesterday.

With the datastream running, the NodeMCU generates the Exception(28) at the point where it is trying to create the file to upload to the spreadsheet…

Wait…I’m starting to get confused - NodeMCU just booted up without a datastream and crashed here, at the point where it was creating the upload file, instead of at the point where it was waiting for the upload file… WHAT THE HONK!?! - Not worrying about it now going to keep pushing ahead on a fix for the spreadsheet upload… I noticed an errant > in the upload string, and I’m thinking this might be what did me in? - uploading new file to test now.
No difference, still crashing at same point… Next - going to print the individual data points to serial and see if they are still there - might have to go backwards to see when they vanished.

Wait a tic… is it crashing because it’s trying to compile nonexistent sensor data? If so popping in some place holder values should do the trick…
Placeholders made no difference to the upload, and the placeholders are recognized in the serial print line I added immediately above the command that stitches the data together for the upload… so there is something wrong with the actual line of code that organizes the data I’m sending to the spreadsheet. Maybe the string is too long? I will reduce it, so its only pulling TDS, Temperature and Humidity data as the previous incarnation was able to upload those successfully.

Progress: Changing 1) the data type from char to String, and 2) populating the SenPakUpload file by manually stringing the pieces together w/o the snprintf command seems to have helped with getting my default 5 pieces of data posted to the spreadsheet.

Going to try it with my test data stream from the Uno now and see how it reacts…

It reacts well - varying sensor data is being uploaded depending on when the void loop meets the data stream.

Time to try with live data…

Live data is going to the spreadsheet, but completly bypassing the LCD.
I am going to try adding some simple text lines for the LCD to print as the computer runs, to see if I can figure out why nothing is on my screen.

OK… I don’t understand this, but somehow my adding the test LCD text to my script has fixed the issue?
I have live data appearing on both the screen (interspersed with bits of my test text), as well as being uploaded to the spreadsheet.

I’m going to let this run for a while and see how stable it is.
I’m feeling fairly confident now, as I have booted up the Colonel twice now without issue, the last of which was 30 mins ago.
(Maybe the LCD troubleshooting lines I added were enough to break up a loop detected by the watchdog?)

Cannabal

Part time mad scientist, gardener, tinker and dreamer.

https://www.cannabalurges.com
Previous
Previous

Marla

Next
Next

OS upgraded! (or Not)