Giter Site home page Giter Site logo

pstolarz / librasp Goto Github PK

View Code? Open in Web Editor NEW
20.0 6.0 2.0 188 KB

Raspberry Pi library for GPIO, 1-Wire, SPI, System Time Counter (STC) access. There have been provided APIs for handling various popular devices.

License: BSD 2-Clause "Simplified" License

Makefile 0.78% C 99.22%
gpio raspberry i2c one-wire sensor spi nrf24l01 ds18b20 dht11 dht22

librasp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

librasp's Issues

False temperature reading with librasp on DS18B20

Thank you for sharing your great library for Raspberry Pi!

Trying to read the temperature off a DS18B20, I'm having the following issue:
Reading the temperature through /dev interface is giving me:
cat //sys/bus/w1/devices/28-000006c5aefc/w1_slave
4b 01 4b 46 7f ff 05 10 e1 : crc=e1 YES
4b 01 4b 46 7f ff 05 10 e1 t=20687

librasp is also seeing that sensor:
./dsth_list2
w1 master [0x00000001]
DS18B20 [0xe9000006c5aefc28]; T:85.0

However, the temperature reading is different (wrong) in librasp reading. The true temperature is about 20,687°C as indicated in the /dev reading.

Do you have any idea what I might be doing wrong?

./dsth_list
Feb 15 12:52:41 DEBUG: [NLSCK:3]: -> netlink [header]: len:0x00000030 type:0x0003 flags:0x0000 seq:0x00000000 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000000 ack:0xffffffff len:0x000c flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x06 status:0x00 len:0x0000 id:0x00000000|0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000034 type:0x0003 flags:0x0000 seq:0x00000000 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000000 ack:0x00000001 len:0x0010 flags:0x6269
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x06 status:0x00 len:0x0004 id:0x6e696c2d|0x672d7875 data[hex bts]:01000000
w1 master [0x00000001]
Feb 15 12:52:41 DEBUG: [NLSCK:3]: -> netlink [header]: len:0x00000034 type:0x0003 flags:0x0000 seq:0x00000001 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000001 ack:0xffffffff len:0x0010 flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x04 status:0x00 len:0x0004 id:0x00000001|0x00000000 data[hex bts]:02000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x0000003c type:0x0003 flags:0x0000 seq:0x00000001 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000001 ack:0x00000002 len:0x0018 flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x04 status:0x00 len:0x000c id:0x00000001|0x00000000 data[hex bts]:0200080028fcaec5060000e9
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000034 type:0x0003 flags:0x0000 seq:0x00000001 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000001 ack:0xffffffff len:0x0010 flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x04 status:0x00 len:0x0004 id:0x00000001|0x00000000 data[hex bts]:02000000
 DS18B20 [0xe9000006c5aefc28]; T:Feb 15 12:52:41 DEBUG: [NLSCK:3]: -> netlink [header]: len:0x0000003e type:0x0003 flags:0x0000 seq:0x00000002 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000002 ack:0xffffffff len:0x001a flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x000e id:0xc5aefc28|0xe9000006 data[hex bts]:04000a00beffffffffffffffffff
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000024 type:0x0003 flags:0x0000 seq:0x00000000 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000000|0x00000000 seq:0x00000000 ack:0x00000000 len:0x0000 flags:0x0000; filtered out: no w1 msg
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x0000003e type:0x0003 flags:0x0000 seq:0x00000002 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000002 ack:0x00000003 len:0x001a flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x000e id:0xc5aefc28|0xe9000006 data[hex bts]:04000a00be50054b467fff0c101c
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000034 type:0x0003 flags:0x0000 seq:0x00000002 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000002 ack:0xffffffff len:0x0010 flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x0004 id:0xc5aefc28|0xe9000006 data[hex bts]:04000000
Feb 15 12:52:41 DEBUG: [dsth_probe] DS therm resolution: 12-bit
Feb 15 12:52:41 DEBUG: [NLSCK:3]: -> netlink [header]: len:0x00000035 type:0x0003 flags:0x0000 seq:0x00000003 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000003 ack:0xffffffff len:0x0011 flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x0005 id:0xc5aefc28|0xe9000006 data[hex bts]:0400010044
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000024 type:0x0003 flags:0x0000 seq:0x00000000 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000000|0x00000000 seq:0x00000000 ack:0x00000000 len:0x0000 flags:0x0000; filtered out: no w1 msg
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000035 type:0x0003 flags:0x0000 seq:0x00000003 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000003 ack:0x00000004 len:0x0011 flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x0005 id:0xc5aefc28|0xe9000006 data[hex bts]:0400010044
Feb 15 12:52:41 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000034 type:0x0003 flags:0x0000 seq:0x00000003 pid:0x00000000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000003 ack:0xffffffff len:0x0010 flags:0x0000
Feb 15 12:52:41 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x0004 id:0xc5aefc28|0xe9000006 data[hex bts]:04000000
Feb 15 12:52:42 DEBUG: [NLSCK:3]: -> netlink [header]: len:0x0000003e type:0x0003 flags:0x0000 seq:0x00000004 pid:0x00000000
Feb 15 12:52:42 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000004 ack:0xffffffff len:0x001a flags:0x0000
Feb 15 12:52:42 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x000e id:0xc5aefc28|0xe9000006 data[hex bts]:04000a00beffffffffffffffffff
Feb 15 12:52:42 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000024 type:0x0003 flags:0x0000 seq:0x00000000 pid:0x00000000
Feb 15 12:52:42 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000000|0x00000000 seq:0x00000000 ack:0x00000000 len:0x0000 flags:0x0000; filtered out: no w1 msg
Feb 15 12:52:42 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x0000003e type:0x0003 flags:0x0000 seq:0x00000004 pid:0x00000000
Feb 15 12:52:42 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000004 ack:0x00000005 len:0x001a flags:0x0000
Feb 15 12:52:42 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x000e id:0xc5aefc28|0xe9000006 data[hex bts]:04000a00be50054b467fff0c101c
Feb 15 12:52:42 DEBUG: [NLSCK:3]: <- netlink [header]: len:0x00000034 type:0x0003 flags:0x0000 seq:0x00000004 pid:0x00000000
Feb 15 12:52:42 DEBUG: [NLSCK:3]:    nest. cn_msg [header]: id:0x00000003|0x00000001 seq:0x00000004 ack:0xffffffff len:0x0010 flags:0x0000
Feb 15 12:52:42 DEBUG: [NLSCK:3]:    nest. w1_msg [header]: type:0x05 status:0x00 len:0x0004 id:0xc5aefc28|0xe9000006 data[hex bts]:04000000
Feb 15 12:52:42 DEBUG: [dsth_probe] temp-lsb:0x50, temp-hsb:0x05
85.0

Thank you very much in advance!

Martin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.