So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By simonharvan
#81852 Hello guys,

I have a problem I am trying to write program for counting people with MLX90640 sensor, it uses a bit more memory and computational power, but reasonably for what is possible with ESP8266.

I am pushed the also not working version into git:

The process is:
  • Get frame from MLX90640
  • Is it trained (calculating average background temperature on X frames)?
  • If yes, use gaussian for noise
  • Thresholding
  • Find object in frame
Altough when I introduced function of finding object, it fails after trying to calculate the object position in frame with stacktrace:
Code: Select allException 0: Illegal instruction
PC: 0x3f800000
EXCVADDR: 0x00000000

Decoding stack results
0x40201a81: ExtractTgcParameters(unsigned short*, paramsMLX90640*) at /var/folders/m1/mggsqh2d7b36s8hdk82x33nw0000gn/T/arduino_build_834749/sketch/MLX90640_API.cpp line 745
0x40203543: loop() at /Users/simonharvan/Documents/Development/Arduino/counting-people/counting-people.ino line 188
0x402055d3: delay(unsigned long) at /Applications/ line 54
0x402032f8: setupWiFi() at /Users/simonharvan/Documents/Development/Arduino/counting-people/counting-people.ino line 122
0x40204a1c: loop_wrapper() at /Applications/ line 125
0x401000e8: app_entry() at /Applications/ line 248

But this is at setup, even though I am already at loop and trying to calculate. Also this happens when I upload the code and then try to comment the line. It fails again. After trying to comment everything, it seems that memory is somehow corrupted and works with the old code.

My configuration:
  • OS: Mac
  • IDE: Arduino 1.8.7
  • Core: 2.6.0 - dev (same thing happens at 2.5.0)
  • Esspressif FW: pre 3.0 (same thing happens with 2.2.1)

If you need any more info, I would gladly provide.