AchimPieters / ESP8266-HomeKit-Motion-Sensor

ESP8266 – HomeKit Motion Sensor
MIT License
7 stars 4 forks source link

Board need resetting every two days #3

Open AR-Tawil opened 3 years ago

AR-Tawil commented 3 years ago

Hi Achim, I'm using your motion sensor code and it works perfectly. However, I noticed that the board needs resetting every two days or it will go into a No Responsive state?!!!

Thank you for your help AR Tawil

IMG_8899

AchimPieters commented 3 years ago

@AR-Tawil

This can be, due to some optimisations bij Maxim. Try to download the latest esp-homekit repro here and compile it again. let me know if it worked out.

AchimPieters commented 3 years ago

@AR-Tawil

btw. I saw that you have 7 different blinds repro's. I curious how you solved some coding issues and hardware issues. I really would like to have a peek at you code en know how you connected eg stepper etc. If you want we can do a private chat?

best regards, Achim

AR-Tawil commented 3 years ago

Hi Achim, I have updated the code to the latest esp-homekit repro, recompiled and updated my boards. I'm still having the same issue where the boarded requires resetting after ~2 days. As I mentioned in my previous message the code works perfectly until the reset is required. It seems to me that it depends on the number of sensor activations until a reset becomes needed?!! Thank you for your help.

AR-Tawil commented 3 years ago

@AR-Tawil

btw. I saw that you have 7 different blinds repro's. I curious how you solved some coding issues and hardware issues. I really would like to have a peek at you code en know how you connected eg stepper etc. If you want we can do a private chat?

best regards, Achim

Hi Achim, I'm learning and it's still a hit or miss exercise for me. Please find below the adapted stepper code I use for my blinds:

include

//#include //#include

// ESP-12F(WeMos D1 mini)

define IN1 5 //(GPIO5)

define IN2 4 //(GPIO4)

define IN3 0 //(GPIO0)

define IN4 14 //(GPIO2)

const int NBSTEPS = 4095; const int STEPTIME = 900; int Step = 0; bool Clockwise = true;

int arrayDefault[4] = {0, 0, 0, 0}; void stepper(); void setDirection(); void test(int outArray[4]);

int stepsMatrix[8][4] = { {0, 0, 0, 1}, {0, 0, 1, 1}, {0, 0, 1, 0}, {0, 1, 1, 0}, {0, 1, 0, 0}, {1, 1, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 1} };

bool set_gpio() { gpio_enable(IN1, GPIO_OUTPUT); gpio_enable(IN2, GPIO_OUTPUT); gpio_enable(IN3, GPIO_OUTPUT); gpio_enable(IN4, GPIO_OUTPUT);

return true; }

void writeStep(int outArray[4]) { test(outArray);
gpio_write(IN1, outArray[0]); gpio_write(IN2, outArray[1]); gpio_write(IN3, outArray[2]); gpio_write(IN4, outArray[3]); }

void setDirection() { (Clockwise == true) ? (Step++) : (Step--);

if (Step > 7) { Step = 0; } else if (Step < 0) { Step = 7; } }

void step() {

if ((Step >= 0) && (Step < 8)) { writeStep(stepsMatrix[Step]); } else { writeStep(arrayDefault); } setDirection(); }

void sleep(){ writeStep(arrayDefault); }

void reverse(){ Clockwise = !Clockwise; }

bool clockwise(){ return Clockwise; }

AchimPieters commented 3 years ago

@AR-Tawil I saw that you already contacted Maxim https://github.com/maximkulkin/esp-homekit-demo/issues/376 and he noticed that you having trouble with your DHCP, is this issue solved? maybe you can have a look here: https://github.com/maximkulkin/esp-homekit/issues if they having the same problems as you?

AR-Tawil commented 3 years ago

Hi Achim, I have updated the code to the latest esp-homekit repro, recompiled and updated my boards. I'm still having the same issue where the boarded requires resetting after ~2 days. As I mentioned in my previous message the code works perfectly until the reset is required. It seems to me that it depends on the number of sensor activations until a reset becomes needed?!! Thank you for your help.

Hi Achim, I think DHCP is working better now. Do have any ideas or suggestions to fix the motion sensor board resetting issue? Thank you for your continuous support :)

AchimPieters commented 3 years ago

@AR-Tawil do you have a log report to see what's happing when it resets?

AR-Tawil commented 3 years ago

@AchimPieters Is there a way to get log reports without using a direct USB connection to the device?

AchimPieters commented 3 years ago

yes off course! open your terminal and type:

nc -kulnw0 45678

AchimPieters commented 3 years ago

@AR-Tawil did you managed to fix your problem?