Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Hallo,

ich versuche jetzt schon länger eine CRC Prüfung der DS18B20 umzusetzen. Scheitere aber daran. Mein Code funktioniert zwar aber es ergeben sich meistens die Falschen CRC Werte.

Hat das vielleicht schomal jemand umgesetzt für die DS18B20 Sensoren? Bzw. wie stellt ihr sicher das die richtigen Werte ankommen?

Hier mal ein Codeausschnitt Achtung es wird die lib crc8 benötigt.

hash = crc8.crc8()
string = address # Onewire Modul Adresse in HEX
stringoutput = ''
for q in range(0, -12, -2):
    stringoutput = '/x' + string[-2:] + stringoutput
    string = string[:-2]
print(stringoutput.encode('utf-8'))
hash.update(stringoutput.encode('utf-8'))
print(hash.hexdigest())
print(crc)

Output wäre dann sowas:

b'/x4/x16/x63/x9d/x1e/xff'
24
8c
b'/x4/x16/x62/x4d/x71/xff'
b5
58
b'/x4/x16/x62/x2b/x63/xff'
3e
3e

Es werden 3 Sensoren geprüft jedoch nur beim letzten stimmt auch der CRC zusammen.

Würde mich über jede Hilfe/ Tipps freuen :-)

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.