Open DatCodeWork opened 1 year ago
@DatCodeWork Thanks for reporting this. I have also encountered the issues with Thonny that you mention, and from my investigation it seems to be related to the addition of battery monitoring code.
Until I push a fix you could try commenting out the below section of code from enviro/__init__.py
old_state = Pin(WIFI_CS_PIN).value()
Pin(WIFI_CS_PIN, Pin.OUT, value=True)
sample_count = 10
battery_voltage = 0
for i in range(0, sample_count):
battery_voltage += (ADC(29).read_u16() * 3.3 / 65535) * 3
battery_voltage /= sample_count
battery_voltage = round(battery_voltage, 3)
Pin(WIFI_CS_PIN).value(old_state)
Then add a line like battery_voltage = 0.0
so that later code still works
Hi Everyone,
I just flashed the new firmware "enviro-v0.0.8.uf2" to my Enviro Urban and the wifi connection has some issues.
When I connected it to my pc and used Thonny to run main.py, it had never successfully connected to my wifi. When I used an external battery to power it, it connected to the wifi, sent data successfully, then the light turned red. I checked the log and I saw the connection to my wifi failed again. However, it just connected successfully 20 seconds before that.
Also, my Enviro Urban is new, it just came today. With the older firmware that come with the board, I dont see this behavior. So I guess the new firmware causes it.
This is the log: