New user - console and blibk question ESP32 devkitV1


#1

I notice when I upload this sketch that it stops blinking if I close the console. Should this be happening ?

I also notice the console resets count to 0 for this sketch if the console is closed . Shouldn’t the iteration count number be kept even if console is closed then opened again . I thought all the data came from the ESP?

Code below ( combination of blink and hello world sketches)

###############################################################################

Hello Zerynth

Created by Zerynth Team 2015 CC

Authors: G. Baldi, D. Mazzei

###############################################################################

import the streams module, it is needed to send data around

import streams
import pwr
pinMode(LED0,OUTPUT)

open the default serial port, the output will be visible in the serial console

streams.serial()
temp = 0

loop forever

while True:
print("This is how many times it iterated %d times " %(temp) ) # print automatically knows where to print!
temp = temp +1
sleep(1000)
digitalWrite(LED0, HIGH) # turn the LED ON by setting the voltage HIGH
sleep(1000) # wait for a second
digitalWrite(LED0, LOW) # turn the LED OFF by setting the voltage LOW
sleep(1000) # wait for a second


#2

hi @The_Kaveman
I have tried your code on my Doit ESP32 DevKit V1
It blinks and counts the iterations normally regardless of the console is opened or not.

Have you tried that code on another board with Zerynth?


#3

No I only have one ESP32 DOIT. I tried a different code app and it seems to stop working when I close the monitor window which makes no sense. I wonder if there is some setup function I am not aware of ?


#4

Hi @The_Kaveman,

can you try to not print and see if it keeps blinking?


#5

process:
I upload the software into the ESP32 DOit V1
It finishes compiling and transferring successfully.
Nothing is visible on board until I open the monitor .
If I close the Monitor the program ceases running againon the ESP32( or appears to stop as blink stops working ).

If I disconnect and reconnect the ESP32 to USB it starts blinking without the monitor program opened.
if I then open the monitor window the ESP32 stops working for a small time( like it is resetting) and then continues to flash .If I then close this monitor window the ESP32 STOPS working.
If I delete the print command in the program the above symptoms still occur.


#6

Read response ty for assisting


#7

It’s a strange behaviour for sure and I am unable to replicate it on other ESP32 boards we support.
At the moment I am not able to test on an ESP32 DOIT, but I will let you know as soon as I am able to.


#8

Not sure if there is any diagnostic I can run as it seems to me like the ESP32 talks to thezerynth and knows when it is connected or not .


#9

Here is the latest code - very simple

New test blink

Created at 2019-01-03 15:06:53.813873

pinMode(LED0,OUTPUT)

while True:

sleep(10)
digitalWrite(LED0, HIGH)  # turn the LED ON by setting the voltage HIGH
sleep(50)
digitalWrite(LED0, LOW)   # turn the LED OFF by setting the voltage LOW
sleep(200)               # wait for a second