Closed ecdlguy closed 1 year ago
These are the libs and version used:
Resolving denky32 dependencies... Platform espressif32 @ 6.0.1 (required: espressif32) ├── framework-arduinoespressif32 @ 3.20006.221224 (required: platformio/framework-arduinoespressif32 @ ~3.20006.0) ├── tool-cmake @ 3.16.4 (required: platformio/tool-cmake @ ~3.16.0) ├── tool-esptoolpy @ 1.40400.0 (required: platformio/tool-esptoolpy @ ~1.40400.0) ├── tool-mkfatfs @ 2.0.1 (required: platformio/tool-mkfatfs @ ~2.0.0) ├── tool-mklittlefs @ 1.203.210628 (required: platformio/tool-mklittlefs @ ~1.203.0) ├── tool-mkspiffs @ 2.230.0 (required: platformio/tool-mkspiffs @ ~2.230.0) ├── tool-ninja @ 1.7.1 (required: platformio/tool-ninja @ ^1.7.0) └── toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5 (required: espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5)
Libraries ├── ESP Async WebServer @ 1.2.3+sha.f71e3d4 (required: git+https://github.com/me-no-dev/ESPAsyncWebServer.git) │ ├── AsyncTCP @ 1.1.1 (required: me-no-dev/AsyncTCP @ ^1.1.1) │ └── ESPAsyncTCP @ 1.2.2 (required: me-no-dev/ESPAsyncTCP @ ^1.2.2) └── ESP-StepperMotor-Server @ 0.4.8 (required: ESP-StepperMotor-Server) │ ├── ArduinoJson @ 6.19.2 (required: ArduinoJSON @ 6.19.2) │ └── ESP-FlexyStepper @ 1.4.5 (required: ESP-FlexyStepper @ 1.4.5)
Please post you code from main.cpp as well. Also change your apName, looks rather corrupt.
What do you mean by 'll=3'?
Thanks for your promt reply!
regarding "ll=3": loglevel [ll]*: set or get the current log level for serial output.
Here is content of main.cpp:
#include <ESPStepperMotorServer.h>
ESPStepperMotorServer *stepperMotorServer;
const char *wifiName= "FMW WiFi"; // enter the SSID of the wifi network to connect to
const char *wifiSecret = "****"; // enter the password of the the existing wifi network here
void setup()
{
Serial.begin(115200);
stepperMotorServer = new ESPStepperMotorServer(ESPServerRestApiEnabled | ESPServerWebserverEnabled | ESPServerSerialEnabled);
stepperMotorServer->setWifiCredentials(wifiName, wifiSecret);
stepperMotorServer->setWifiMode(ESPServerWifiModeClient); //start the server as a wifi client (DHCP client of an existing wifi network)
stepperMotorServer->start();
}
void loop()
{
}
platformio.ini:
[env:denky32]
platform = espressif32
board = denky32
framework = arduino
lib_deps =
ESP-StepperMotor-Server ;
https://github.com/me-no-dev/ESPAsyncWebServer.git ;
monitor_speed = 115200 ;
monitor_filters = esp32_exception_decoder, default, colorize ;
build_type = debug ;
I have no idea why the AP name looks like this, after first boot it didn't.
Hi Paul,
I think the reason for the crash is that the handling of the interrupt takes too long with "ll=3". This would also explain why the crash doesn't happen with debug logging disabled.
However, I still have the problem that the switch does not interrupt the movement. I found that it is only a problem if moving using the "left" direction arrow. Using the "right" direction, the switch works as expected! (Of course I changed the switch setup accordingly)
This is what I found:
homing switch "begin/left/bottom, active high":
{"settings":{"positionSwitchCounterLimit":10,"statusRegisterCounter":2},"switchStatusRegister":[{"statusRegisterIndex":0,"status":"00000000"},{"statusRegisterIndex":1,"status":"00000000"}],"positionSwitches":[{"id":0,"name":"s1oben","ioPin":19,"position":-1,"stepperId":0,"active":0,"type":{"pinMode":"Active High","switchType":"Homing switch (start-position)"}}]}
-> does not stop movement in either direction (left or right)
homing switch "end/right/top, active high"
{"settings":{"positionSwitchCounterLimit":10,"statusRegisterCounter":2},"switchStatusRegister":[{"statusRegisterIndex":0,"status":"00000000"},{"statusRegisterIndex":1,"status":"00000000"}],"positionSwitches":[{"id":0,"name":"s1oben","ioPin":19,"position":-1,"stepperId":0,"active":0,"type":{"pinMode":"Active High","switchType":"Homing switch (end-position)"}}]}
-> does stop movement in "right" direction
Thanks for looking into this.
cheers, Thorsten
Ok, thanks for the update. Yes, the logging is the cause. The error states "(Interrupt wdt timeout on CPU1). ". The Watchdog timeout is triggered, because logging in an interrupt routine is a bad idea :-) I will remove that log statement from there Newest release v0.4.10 should fix this issue with the Kernel Panic
will check on the direction switch interaction problem in a bit.
I also have a question or maybe found a bug regarding the Web UI, should I just open a new issue there or just aks here?
please open a new issue ticket for UI stuff
Same issue here regarding the direction switch interaction problem. @pkerspe : Can you comment when you can fix this?
@tjhgit can you please provide the version of ESP-FlexyStepper and ESP-StepperMotor-Server you are using? I checked the logic and variable types should be fine, I currently to not have a test setup available, thus the theoretical approach. I will try to setup a physical test rack by the end of this week and give an update. But please check you are running the latest versions of both libraries. You should be using version 1.4.6 (or newer once available) of the ESP-FlexyStepper Library
I've also observed the failure of begin/left/bottom having tested both high and low.
Built in PlatformIO with the following dependency graph.
ESP-StepperMotor-Server @ 0.4.10 (required: ESP-StepperMotor-Server) │ ├── ArduinoJson @ 6.19.4 (required: ArduinoJSON @ 6.19.4) │ └── ESP-FlexyStepper @ 1.4.6 (required: ESP-FlexyStepper @ 1.4.6)
might be actually a problem of the definition of ESP_FlexyStepper::LIMIT_SWITCH_BEGIN:
static const byte LIMIT_SWITCH_BEGIN = -1;
probably not a good idea to use a negative value here since in arduino byte resolves to typedef uint8_t byte;
. I will try to get my development evironment setup again, currently I did not work on the library for a while and seems some libs are outdated so I got compile errors. But for everyone getting these errors try changing line
static const byte LIMIT_SWITCH_BEGIN = -1;
in ESP_FlexyStepper.h to:
static const byte LIMIT_SWITCH_BEGIN = 3;
or
static const signed char LIMIT_SWITCH_BEGIN = -1;
@tjhgit @mrtally did the suggested fix in my previous comment help you guys? Please kindly confirm.
SUCCESS! @pkerspe changing LIMIT_SWITCH_BEGIN from -1 to 3 does fix the problem. I'll try the signed char type approach next.
update: static const signed char LIMIT_SWITCH_BEGIN = -1; works as well.
ok, I update the ESP-FlexyStepper library, version 1.4.8 or above certainly contains the fix
Hi, a simple limit switch does nothing. When triggering the switch using 'll=3' gives:
Here is the config:
I also noticed every time after reboot and after motor movement I get the following line:
E (1441) gpio: gpio_set_level(226): GPIO output gpio_num error
The motor is working, though.