B4R Question esp8266 stops running

positrom2

Active Member
Licensed User
Longtime User
The bouncing ball code (tutorial) stops after about an hour or two.
I have seen several posts reporting an 71 min issue related to some timers.
Is there a general running time limit for the esp8266?
 

positrom2

Active Member
Licensed User
Longtime User
To be safe (in suitable cases), would the watchdog timer not be a fix?
How to enable that? (I did not find a related post.)
When trying the easymesh examples I saw that the watchdog timer keeps the thing running if something else fails.
 
Upvote 0

janderkan

Well-Known Member
Licensed User
Longtime User
I use the RX/TX pins for communication between units so the Log(" ") workaround does not work for me.
I create my own timer:
B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private pins As D1Pins
    Private pinLed As Pin                    'D4
    Private LastSecondTick As ULong=0
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log(CRLF,CRLF)
    Log("AppStart")

    pinLed.Initialize(pins.D4,pinLed.MODE_OUTPUT)
    pinLed.DigitalWrite(True)

    AddLooper("Looper")
End Sub

private Sub Looper
    Dim Elapsed As ULong = Millis-LastSecondTick
    If Elapsed >= 1000 Then
        LastSecondTick=Millis
        Second_Tick
    End If
End Sub

private Sub Second_Tick
    Blink(1)
End Sub   

public Sub Blink(On As Byte)
    Select On
        Case 0
            pinLed.DigitalWrite(True)
        Case 1
            pinLed.DigitalWrite(False)
            CallSubPlus("Blink",50,0)
    End Select
End Sub
 
Upvote 0

janderkan

Well-Known Member
Licensed User
Longtime User
Why are you using Looper instead of a timer?

Where is the Timer_Tick event that calls Log(" ") ?

I use the hardware Serial1 to RS485 communication between units.
Sending a 'space' will disturb this function.
And the looper works without writing to the Log.
 
Upvote 0

janderkan

Well-Known Member
Licensed User
Longtime User
Using a looper instead of a timer is a mistake. It is not related to the issue we are discussing here.

You can try to send data through a different pin with SoftwareSerial. Even if nothing is connected.

I am sending and receiving data on Serial1.
I am using all available pins.
Using a looper is the only way for me to get a timer function.
I tried to wrap the https://github.com/jfturcot/SimpleTimer project, but I cannot C.

The problem with Timer not running occurs only with the built in timer and can only be fixed with the built in Log function.
 
Upvote 0

janderkan

Well-Known Member
Licensed User
Longtime User
Multi function board.
RS485, 2 PWM output, 4 digital input, 1 analog input, Neopixel output, Lora.
But not everything at the same time :)

5bdb582f688e316522375c01_EventCubes%20app%20mockup%20png.png

5bdb57e14359904b5f08ac75_Sensor%20png.png
 

Attachments

  • image.png
    image.png
    326.2 KB · Views: 243
Upvote 0

janderkan

Well-Known Member
Licensed User
Longtime User
Using a looper instead of a timer is a mistake. It is not related to the issue we are discussing here.

You can try to send data through a different pin with SoftwareSerial. Even if nothing is connected.

How is it a mistake?
It wil fail in the long run?
It is not good programming?
or ?
 
Upvote 0
Top