1 1
eddievxx

Help wanted changing resolution of DS18B20 on Orange Pi

Recommended Posts

Hello, I have got my Orange Pi PC+ reading a DS18B20, but it only gives 0.5 degree increments so I believe the resolution is set to 9 bit. This is nowhere near good enough for the application I plan to use it for.

 

When I cat w1_slave I get:

90 01 80 01 1f ff 02 04 5c : crc=5c YES

90 01 80 01 1f ff 02 04 5c t=25000

 

I have attempted to use this: https://github.com/danjperron/BitBangingDS18B20

but it appears to be specifically for RaspPi.

 

Does anyone know how I can change the resolution to 11 or 12 bit?

 

Many thanks

Share this post


Link to post
Share on other sites

There is a thread where someone tweak the kernel to get this functionality :

https://forum.armbian.com/index.php/topic/1558-w1-therm-driver-modifications/#entry12058

But it seem that he never completed the task to provide actual patch for Armbian build.

 

Looking at kernel history, I saw that someone else done it a different way :

https://github.com/megous/linux/commit/0a19f129d71f18e73249d54de96c835186b8607e

It should be done like :

echo 12 > /sys/bus/w1/devices/28-000005a2fac5/w1_slave

But comments say that this change is volatile and will be reset at next power recycle :

Writing a value between 9 and 12 to the sysfs w1_slave file will change the precision of the sensor for the next readings. This value is in (volatile) SRAM, so it is reset when the sensor gets power-cycled. To store the current precision configuration into EEPROM, the value 0 has to be written to the sysfs w1_slave file. Since the EEPROM has a limited amount of writes (>50k), this command should be used wisely.

Share this post


Link to post
Share on other sites

rc14_one:/sys/bus/w1/devices/28-0115832712ff/driver# echo 12 > 28-0115831d2eff/w1_slave
-bash: 28-0115831d2eff/w1_slave: Permission denied

 

setting manual write permission to w1_slave

 

rc14_one:/sys/bus/w1/devices/28-0115832712ff/driver/28-0315826d08ff# echo 12 > w1_slave
-bash: echo: write error: Input/output error

 

I was using latest armbian debian jessie.

How can I implement that to it?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
1 1