I am trying to read DS18B20 1-wire sensors using code adapted from the Matrix Temperature sensor example, as found at Armworks. I have noticed that the current Wiki example is quite different and appears NOT to be suitable for the NanoPi.
and periodically can get the following error:
Appreciate any comments.
Thanks,
davef
Code: Select all
//temp sensors
if ((devFD = ds18b20Init(GPIO_PIN1)) == -1)
{
printf("Fail to init ds18b20\n");
return -1;
}
if (ds18b20Read(temperature1) > 0)
{
printf("HotWaterTemp = %s\n", temperature1);
}
else
{
printf("Fail to get HotWaterTemp\n");
}
hot_water_temp = atoi (temperature1);
free(temperature1);
ds18b20DeInit(devFD);
and periodically can get the following error:
Code: Select all
FAHW-Lib: Fail to read /sys/devices/w1_bus_master1/w1_master_max_slave_count/w1_slave
Appreciate any comments.
Thanks,
davef