sinricpro / esp8266-esp32-sdk

Library for https://sinric.pro - simple way to connect your device to Alexa, Google Home, SmartThings and cloud
https://sinric.pro
Other
236 stars 125 forks source link

Example Code on ESP8266 causing Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address #111

Closed ritter-tech closed 3 years ago

ritter-tech commented 3 years ago

HI,

Any assistance you can offer would be greatly appreciated, this platform looks excellent for what I am trying to do and far more robust than FauxMo.

My issue is that I can't get past the following issue;

Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address PC: 0x4021081b: _scanf_i at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfscanf_i.c line 221 EXCVADDR: 0x3fffff6f

I am trying to use the temperaturesensor example and have obtained and populated, TEMP_SENSOR_ID, APP_KEY, a APP_SECRET.

The example code is unchanged except for the above and WIFI_SSID and WIFI_PASS.

sivar2311 commented 3 years ago

Hi,

i have checked the example and could not reproduce the error.

Please let me know

ritter-tech commented 3 years ago

NodeMCU 1.0 ESP-12E Arduino IDE (MacOS) + Arduino 1.8.13 SinircPro 2.7.6 DHT.h - Using the latest version from https://github.com/markruys/arduino-DHT

I have tried using the NeoPixel Example, which also fails at setupSinricPro(). I have tested the components with other code and it works as expected.

I'll destroy the credentials and device once solved, but they are below if it will help with diagnosis.

TEMP_SENSOR_ID: 5fcaffdddbb2021cadb5489d APP_KEY: ea586276-7751-487a-a194-2bf64526b94f APP_SECRET: 757ccc75-cef5-40c0-b29d-a0c98040d2c2-f1ff3185-631a-4395-98ac-33c7983c530a

`Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address PC: 0x4021081b: _scanf_i at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfscanf_i.c line 221 EXCVADDR: 0x3fffff6f

Decoding stack results 0x4020cb78: _strtol_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/strtol.c line 139 0x4020ffdc: ssvfscanf_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfscanf.c line 462 0x4020ffdc: __ssvfscanf_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfscanf.c line 462 0x4020f72a: ssputs_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 233 0x4020f72a: ssputs_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 233 0x4020f65c: __ssputs_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 180 0x4020b1c8: _printf_i at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf_i.c line 244 0x4020b0c0: _printf_i at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf_i.c line 194 0x4020f72a: ssputs_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 233 0x4020fb9c: _sungetc_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfscanf.c line 221 0x4020fc30: __ssrefill_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfscanf.c line 269 0x4020b998: sscanf at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/sscanf.c line 431 0x40205f99: Print::printf(char const, ...) at /Users//Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/Print.cpp line 78 0x4020ba54: seofread at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/stdio.c line 73 0x4020b998: sscanf at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/sscanf.c line 431 0x4020ba54: seofread at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/stdio.c line 73 0x402077f5: malloc(size_t) at /Users//Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/heap.cpp line 95 0x4020365c: std::vector >::emplace_back (SinricProDeviceInterface&&) at /Users//Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/xtensa-lx106-elf/include/c++/4.8.2/bits/vector.tcc line 419 0x402018c3: AppSecret_Bin_t::fromString(char const*) at /Users//Documents/Arduino/libraries/SinricPro/SinricProId.h line 81 0x4020143c: std::_Function_base::_Base_manager ::_M_manager(std::_Any_data &, const std::_Any_data &, std::_Manager_operation) at /Users//Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/xtensa-lx106-elf/include/c++/4.8.2/functional line 1954 0x40208f1c: std::_Function_base::~_Function_base() at /Users//Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/xtensa-lx106-elf/include/c++/4.8.2/functional line 2031 0x40203a61: setupSinricPro() at /Users//Documents/Arduino/temperaturesensor/temperaturesensor.ino line 147 0x4020122a: DHT::setup(unsigned char, DHT::DHT_MODEL_t) at /var/folders/6s/5dzqlf6s4gj42mkmnxbcn6b00000gp/T/arduino_build_907153/sketch/DHT.cpp line 40 0x40203ac9: setup() at /Users//Documents/Arduino/temperaturesensor/temperaturesensor.ino line 158 0x40206e30: loop_wrapper() at /Users//Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/core_esp8266_main.cpp line 122`

sivar2311 commented 3 years ago

Looks like you're using a very old Arudino Core (2.5.2) Please update to latest Arduino Core Version (2.7.4) !! Use this URL http://arduino.esp8266.com/stable/package_esp8266com_index.json in File / Preferences / Additional Boards Manager URL To update / check the installed Version go to Tools / Board / BoardManager and type in ESP8266 image

ritter-tech commented 3 years ago

sivar2311,

This is excellent. This solves the issue, I forgot I had configured an older core version to use an older solution.

I really appreciate the response, I honestly didn't expect it to be addressed so quickly.