Well, I thought I was on the home stretch with the weather station…

UPDATE.  I found the reason for the below exception:  I was using too much time in processing the software interrupt (ESP8266Interrupt library) in loop().  I was doing some A-D conversion to get the LiPo battery voltage status and evidently used too much time.  So, THAT’S fixed.

Now, I’m getting very weird stuff happening when I’m testing for long periods of time:  the temperature probe occasionally reads WAY high (300 degrees?), the time acquired from the DS3231 loses the Time Zone I’m in, and the OLED display gets scrambled a display and I have to re-initialize it from time to time (still in progress, that fix is).  Nice, huh?  Oh, and I got an Exception 0 panic – Illegal Instruction.  Maybe I wrote so many times to the D1 Mini that I corrupted the memory?  Jeez.   I’m starting to get a little discouraged with this project and I still have more to do.   I just want to make sure the hardware is sound so I can work on a PCB and send it off to JLCPCB.  

(The below is OLD PANIC INFO)

I’m using Khoi Hoang’s ESP8266Interrupt library as the main “driver” in the code; all the data gathering is interrupt driven.  Another chance to learn more about PlatformIO and debugging code, I guess.  I found there’s an option in the platformio.ini file to filter and decode any exception that is thrown by the program.  Below in bold is the output from the program (I hate calling it a “sketch”. )  🙂   It gets the reading in degrees from the MLX90316 angle sensor, that works great (albeit a bit power hungry).  Then I enable interrupts to get a count of reed switch closings from the anemometer, get the count, and turn off interrupts.  Hmm, maybe that’s the issue?

Heading: 109 Compass: E

getWindData(): WindSensorPin interrupt enabled. sTimer ID is 0 at 21:15:44
getWindSpeedMPH(): WindSensorPin interrupt disabled at 21:15:49
pulseCount: 0 revCount: 0 rps: 0 rpm: 0 MPH: 0
WiFi Radio is ON. Connecting to AMADEUS as MetOneWX…
…Connected to WiFi. My IP is 10.0.0.240 Channel 1
MAC address: 3C:71:BF:28:DB:31
3.00 secs
Connected to broker
MQTT_CONNECTED
Message sent
MQTT_CONNECTED
Message sent
set_wifi(): WiFi radio OFF
034B:LOAD Disabled
Lithium Ion AIN2: 432
LiPo Voltage: 3.9076 V
Solar cell Voltage: -0.0041 V

User exception (panic/abort/assert)
————— CUT HERE FOR EXCEPTION DECODER —————

Panic core_esp8266_main.cpp:191 __yield

>>>stack>>>

ctx: cont
sp: 3ffffd10 end: 3fffffc0 offset: 0010
3ffffd20: 00000038 0000002f 3fff156c 4020edc5
3ffffd30: 00000038 00000038 3ffefc60 4020a56c
3ffffd40: 3fff14fc 00000000 00000017 4020dd02
3ffffd50: 00000000 0015001f 00000000 00000030
3ffffd60: 00000038 00000038 3ffefc60 40203670
3ffffd70: 3ffffda0 00000002 3ffffda0 4020e929
3ffffd80: 3ffefa54 3ffefa54 3ffffda0 3ffefac2 

(Cut short because this is fixed.)

Leave a Reply

Your email address will not be published. Required fields are marked *