Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. DS18X20 Sensor on RPI config problem

DS18X20 Sensor on RPI config problem

Scheduled Pinned Locked Moved Support
2 Posts 2 Posters 8.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    E
    Eisbaeeer
    wrote on last edited by
    #1

    Hi
    I run into config problems with OneWire Sensor.
    The subAgent is loading but always got the message:

    2019.11.12 07:47:00.477 *W* Unable to add sensor from configuration file. Original configuration record:
    2019.11.12 07:47:00.478 *I* Subagent "DS18X20" (ds18x20.nsm) loaded successfully (version 2.2.8)
    

    The sensor is working and I got some temperatures from it:

    :/sys/bus/w1/devices/28-0000022801e4# cat w1_slave
    35 01 4b 46 7f ff 0b 10 31 : crc=31 YES
    35 01 4b 46 7f ff 0b 10 31 t=19312
    

    The config looks like this, but tried some other things more by try-and-error:

    SubAgent = ds18x20.nsm
    
    # 1Wire Seonsors
    [DS18X20]
    Sensor = Test:28-0000022801e4
    

    Are there anybody who can provide a working "config" or has hints of that issue?
    A higher debug level don´t tell me more informations about the config problem.

    Thank you guys for your help!

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      Hi!

      Let me describe the whole configuration process for DS18x20 sensors on RPi in case if someone needs this later.

      1. A pull-up resistor of 2..10KOhm should be connected between DQ pin of the sensor and +3.3v. GPIO2 and GPIO3 have built-in 1.8KOhm pull-up resistors (at least on RPi 3), so if you don't need I2C, you can connect the sensor to one of these pins.
      2. A kernel module is used to communicate with the sensor. It is activated ty adding dtoverlay=w1-gpio to the end of /boot/config.txt file.
        By default the DQ pin of the sensor should be connected to GPIO4, to use another GPIO the following format could be used: dtoverlay=w1-gpio,gpiopin=3. Reboot RPi when finished editing the file.
        Since kernel version 4.9.28 it's also possible to use dynamic overlay loading: sudo dtoverlay w1-gpio gpiopin=5, in this way it's possible to have sensors on several GPIO pins.
      3. After restart (of after dynamic overlay loading) the sensors should get detected:
      root@raspberrypi:~# ls  /sys/bus/w1/devices/
      28-6cb0611f64ff  w1_bus_master1
      

      here we have one sensor connected, it has name 28-6cb0611f64ff
      4) And we should be able to read the temperature:

      root@raspberrypi:~# cat /sys/bus/w1/devices/28-6cb0611f64ff/w1_slave
      78 01 55 00 7f ff 0c 10 57 : crc=57 YES
      78 01 55 00 7f ff 0c 10 57 t=23500
      

      which in this case is 23,5 degrees C.
      5) To configure NetXMS agent we add the following lines to /etc/nxagentd.conf

      SubAgent=ds18x20.nsm
      
      [DS18X20]
      Sensor = Test:28-6cb0611f64ff
      
      1. After agent restart systemctl restart nxagentd our parameter "Test" should return the temperature.
      user@netxms-server:~$ nxget raspberrypi.lan 'Sensor.Temperature(Test)'
      23.312
      

      Your configuration looks exactly the same. The thing is that the error message in agent log "Unable to add sensor from configuration file. Original configuration record:" looks to be a bug, i am also getting it (as of v. 3.1.274). But the parameter works. Most probably on your system Sensor.Temperature(Test) will also give the result.

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      Powered by NodeBB Contributors
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups