Comments (1)
@TerminalMan
Sorry for late response.
At least the documentation is wrong. According the code the byte for length is not included
Lines 1459ff
# add payload and calculate checksum
set sum 1
foreach b $bytes { # iterates over bytes which is the payload w/o static prefix 0x0f and w/o length!
lappend full_req $b
set sum [ expr $sum + [ scan $b %d ] ]
}
set sum [ expr $sum & 255 ]
lappend full_req $sum
# static suffix 0xffff
lappend full_req 255
lappend full_req 255
return [ gatt_char_write_req $HANDLES(command) $full_req ]
}
Your python code seems to be correct.
I've double checked this example from debug mode:
[FC:69:47:06:CB:C6][LE]> char-write-cmd 002b 0f0c01000b0d0a0e0107e8000022ffff
Notification handle = 0x002e value: 0f 04 01 00 00 02 ff ff
Checksum is 0x22
this python code also calculates checksum of 0x22
ba = bytearray.fromhex('01000b0d0a0e0107e80000')
sum = 1
for b in ba:
sum += b
print(hex(sum & 0xff))
In terms of the notification the length-byte is included.
from voltcraft-sem-6000.
Related Issues (17)
- Get Wh for shorter period HOT 3
- Total Power always zero HOT 3
- Integration into lm_sensors HOT 1
- Power factor not in --status --json output HOT 1
- Sending PIN is not needed for capturing measurement HOT 1
- Total energy consumption is 0 HOT 1
- Random Authentification fails HOT 1
- Just: Thank you!
- Auth failed HOT 14
- adding ssh for remote overwatch HOT 2
- Unable to Authenticate HOT 27
- connect error: Function not implemented (38) HOT 12
- Time is 1h ahead HOT 1
- Consumption trigger problem HOT 2
- Only working with firmware 1.16? HOT 2
- It's possible to connect Voltcraft SEM-6000 to Arduino ESP32? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from voltcraft-sem-6000.