Power & Source of Big Ideas

Matrix 1-wire problem

Moderators: chensy, FATechsupport

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.


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
Hi,
Our matrix accessories Matrix-Temperature_Sensor is used with DS18B20, inside the example you can refer to
http://wiki.friendlyarm.com/wiki/index. ... _Sensor/zh
Thanks!
chensy,

I believe that for the NanoPi I would need a significantly different code base. For example, with the NanoPi everything is compiled-in and does not use modules.

I lose about 5% of my readings, which is not a significant problem for me.

Thanks anyhow.

Dave

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 42 on 15 Jul 2016, 01:04

Users browsing this forum: No registered users and 1 guest