Forum Replies Created
-
AuthorPosts
-
August 31, 2017 at 8:07 pm in reply to: Fork with MQTT, Magnetic Sensor support ,Close if left open at night – misc #616
lawrence_jeffParticipantIts more geared right now for someone familiar with the development process (especially those who are using some of the other dev MQTT builds). If you are confident in worse case re flashing with the stock firmware over USB I have uploaded a compiled version here
https://github.com/lawrence-jeff/OpenGarage-Firmware/tree/master/CompiledI have noticed some weird things with the pages not updating after update either through the web or USB – so I now flash it with a blank bin first.
lawrence_jeffParticipantThe code posted above fixes this issue.
If your interested in a version with this incorporated you can find my fork here
https://github.com/lawrence-jeff/OpenGarage-FirmwareIt also adds MQTT and integrated automation to close the door at a certain time (my normal use case when I leave it at night)
Lots of other misc changes. I tried to mimic the coding style and conventions if any of it wants to be incorporated back in.
lawrence_jeffParticipantZipp,
I had this issue also – Do you not have the distance sensor attached? If not there are some sensing loops the code gets stuck in and this causes a WDT reset. This updated function will fix itulong OpenGarage::read_distance_once() {
digitalWrite(PIN_TRIG, LOW);
delayMicroseconds(2);
digitalWrite(PIN_TRIG, HIGH);
delayMicroseconds(10);
digitalWrite(PIN_TRIG, LOW);
// wait till echo pin’s rising edge
unsigned long quit_time=micros()+32767L;
while((digitalRead(PIN_ECHO)==LOW)&& (micros()<quit_time));
//Do nothing
unsigned long start_time = micros();
quit_time=start_time+32767L;
//wait till echo pin’s falling edge
while((digitalRead(PIN_ECHO)==HIGH) && (micros()<quit_time));
ulong lapse = micros() – start_time;
if (lapse>32767L) lapse = 32767L;
return lapse;
} -
AuthorPosts