B4R Question Arduino restart

orpailleur

Member
Licensed User
Hallo,
After running B4R on my pc, i go to log Windows, and click Connect for displaying the messages from the arduino board. In this case the arduino program restart, why ?i wish looking for the messages arduino send, not restarting the arduino
Best regards
 

thetahsk

Active Member
Licensed User
We need more information about your code,hardware,Arduino-Version, etc.
How does your MCU behave when you have this minimal sketch with only a log output ?

B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private Timer1 As Timer
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    Timer1.Initialize("Timer1_Tick", 2000)
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick
    Dim bState As Boolean = True
    Log("State: ", bState)
    Log("State: ", Not(bState))
End Sub
 

tigrot

Well-Known Member
Licensed User
After connection arduino restarts, as far as I remember, so the issue is somewhere else. You should see the logs from the beginning
 

Mostez

Active Member
Not all programs make arduino restart after connection, I've developed many .NET applications for arduino and they don't make arduino restart. Hyper terminal makes arduino restart after connection.
 

tigrot

Well-Known Member
Licensed User
He is talking about debug window, probably from B4R Editor GUI. It restarts the sketch for sure.
 

kolbe

Active Member
Licensed User
I believe this is a hardware thing. A Pro Mini will restart every time you reconnect. The ESP32 doesn't do this. In the past I just keep the Pro Mini connected to catch a log I need. Use something like PuTTy to write to file or capture long periods of logs. I've done this before on occasion.
 
Top