• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 gets hung up and stops processing temperatures on charts and gauges

Q&A Forum › ESP32 gets hung up and stops processing temperatures on charts and gauges
0 Vote Up Vote Down
Gayland Monken asked 6 years ago

Rui,
Question from my following thread: Python esp32 course chapter Node-Red, How does one add an additional temp sensor (DS18B20)?
I guess my problem is that my ESP32 gets hung up and stops processing.  Charts stop recording and gauges stop.  I monitored the serial monitor and got the following:
 
Found DS devices: [bytearray(b”(‘\xa9\xb3/\x14\x01\xb6″), bytearray(b'(\x89\xa0%0\x14\x01\xf7′), bytearray(b'(\xde[\xae/\x14\x01\xd2′), bytearray(b'(bc*0\x14\x01\xd0’)]
Temperatures:
 
 
74.075 Valid temperature
73.5125 Valid temperature
73.5125 Valid temperature
73.85 Valid temperature
 
 
Found DS devices: [bytearray(b”(‘\xa9\xb3/\x14\x01\xb6″), bytearray(b'(\x89\xa0%0\x14\x01\xf7′), bytearray(b'(\xde[\xae/\x14\x01\xd2′), bytearray(b'(bc*0\x14\x01\xd0’)]
Temperatures:
 
 
74.075 Valid temperature
Traceback (most recent call last):
File “main.py”, line 137, in <module>
File “main.py”, line 125, in <module>
File “main.py”, line 21, in read_ds_sensor
File “ds18x20.py”, line 39, in read_temp
File “ds18x20.py”, line 29, in read_scratch
Exception: CRC error
MicroPython v1.9.4-762-gfa50047bb on 2018-12-28; ESP32 module with ESP32
Type “help()” for more information.

>>

 
I’ve reproduced this several times with the same message.  I’m using the code that you recommended when adding three additional temperature sensors. Any suggestions as to why the ESP32 stops processing and how to fix it?

1 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

I’m not sure how to fix that error to be honest, because I’ve only used one sensor at a time.

I would recommend adding an exception in your code that restarts the ESP32 when it encounter an error.

In the last line of the main.py file, can you add another exception like this?

(...)
except OSError as e:
  restart_and_reconnect()
except:
  restart_and_reconnect()

This should solve your problem (it will restart the ESP upon any sort of error).

How often does that error occur to you?

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.