Search found 67 matches

by Divergentti
Sun Jan 17, 2021 3:30 pm
Forum: ESP32 boards
Topic: Why UART2 read do not work after hard reset?
Replies: 10
Views: 4702

Re: Why UART2 read do not work after hard reset?

Pins 34 - 39 are input only. You can use them for RX but not for TX. So true. I already forgot that. Thank you for heads-up. I re-checked documentation of ESP32 and by the doc UART2 shall also be moved to other pins too https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en....
by Divergentti
Sun Jan 17, 2021 2:06 pm
Forum: ESP32 boards
Topic: Why UART2 read do not work after hard reset?
Replies: 10
Views: 4702

Re: Why UART2 read do not work after hard reset?

If you still use Pins 16 and 17: on some boards these are used for flash or SPIRAM. Normally the board crashes when you try to use them for other purposes. In your case obviously not. But there may still be a side effect. You could try to use other pins for the UART. I tried UART2 with pins 34 & 35...
by Divergentti
Sun Jan 17, 2021 1:20 pm
Forum: ESP32 boards
Topic: Why UART2 read do not work after hard reset?
Replies: 10
Views: 4702

Re: Why UART2 read do not work after hard reset?

Update: If boot reason is 1 (power on boot), UART2 does not work. I was able to fix it by: # CO2 sensor co2sensor = MHZ19bCO2(uart=CO2_SENSOR_UART, rxpin=CO2_SENSOR_RX_PIN, txpin=CO2_SENSOR_TX_PIN) if reset_cause() == 1: del co2sensor utime.sleep(5) co2sensor = MHZ19bCO2(uart=CO2_SENSOR_UART, rxpin=...
by Divergentti
Fri Jan 15, 2021 5:02 pm
Forum: ESP32 boards
Topic: Why UART2 read do not work after hard reset?
Replies: 10
Views: 4702

Why UART2 read do not work after hard reset?

I am reading MH-Z19 CO2 sensor from UART1 (pins 17 and 18) asynchronously, code here: https://github.com/divergentti/airquality/blob/main/esp32/esp32-mhz19-ili9341-touchscreen/MHZ19B.py and in the main.py code https://github.com/divergentti/airquality/blob/main/esp32/esp32-mhz19-ili9341-touchscreen/...
by Divergentti
Fri Jan 15, 2021 8:22 am
Forum: Drivers for External Components
Topic: xpt2046
Replies: 25
Views: 19366

Re: xpt2046

Roberthh wrote:
Thu Nov 21, 2019 2:57 pm
I found a reason: Thw SPI baud rate is too high. For the XPT2046 it must not be more than 2000000 (2 MHz).
This saved my day!

I found 1.2 MHz best value in my case. I guess S/NR of the cabling / connectors might have something do with this as well.
by Divergentti
Fri Jan 15, 2021 7:30 am
Forum: General Discussion and Questions
Topic: Why hard reset WiFi connection typically fail?
Replies: 3
Views: 2816

Re: Why hard reset WiFi connection typically fail?

The only thing that I have come across is " that the WiFi connection persists across soft-reboots not a hard reset". Yours sounds like the opposite! If you do a machine.reset(), say in boot, and let the program run automatically does it also behave like a a hard reset? If i use: from machine import...
by Divergentti
Thu Jan 14, 2021 3:57 pm
Forum: General Discussion and Questions
Topic: Why hard reset WiFi connection typically fail?
Replies: 3
Views: 2816

Why hard reset WiFi connection typically fail?

I noticed that after every hard reset WiFi connection wont establish correctly, but after soft reboot WiFi works fine. See video. What might cause this? I have it in all my setups, but I have not yet understood why this happens. ESP32 either SMD, DevBoard, esp32-idf4-20200902-v1.13.bin Video https:/...
by Divergentti
Thu Jan 14, 2021 7:44 am
Forum: ESP32 boards
Topic: Best driver for ili9341 display
Replies: 40
Views: 25980

Re: Best driver for ili9341 display

Hi @Divergentti you might be able to scrape some code and ideas from my air quality project? Similar project - ILI9341 display, particulate sensor, MQTT, uasyncio. Here are some links: Github: https://github.com/miketeachman/micropython-street-sense Hackaday project: https://hackaday.io/project/162...
by Divergentti
Wed Jan 13, 2021 2:01 pm
Forum: ESP32 boards
Topic: Best driver for ili9341 display
Replies: 40
Views: 25980

Re: Best driver for ili9341 display

I got ILI9341 and touchscreen working. This is very very first draft, started yesterday https://github.com/divergentti/airquality/blob/main/esp32/esp32-mhz19-ili9341-touchscreen/main.py At this moment MH-Z19 CO2 NDIR is updated asynchronously in the backgroud, PMS7003 particle sensor and BME280 will...
by Divergentti
Fri Jan 08, 2021 9:35 am
Forum: General Discussion and Questions
Topic: Async main and WebREPL
Replies: 2
Views: 1896

Re: Async main and WebREPL

I got this working. I had to change distance measurement loop to use await and add some delay: async def measure_distance_cm(self): try: distance = self.sensor.distance_cm() if distance > 0: self.distancecm = distance await asyncio.sleep_ms(100) else: self.distancecm = None except OSError as ex: pri...