About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

Cannot get 1 wire pi plus to work on Raspberry pi 4

189 Views - Created 29/01/2021

29/01/2021

Posted by:
marksidell

Users Avatar

I cannot get the 1 wire pi plus to work on a Raspberry pi 4. The command "i2cdetect -y 1" detects the device, so at least I know I2C is working. But owserver fails to start:

root@mqtt:/home/pi# systemctl status owserver
● owserver.service - Backend server for 1-wire control
   Loaded: loaded (/lib/systemd/system/owserver.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2021-01-29 10:40:45 EST; 6s ago
     Docs: man:owserver(1)
  Process: 2083 ExecStart=/usr/bin/owserver -c /etc/owfs.conf (code=exited, status=1/FAILURE)
 Main PID: 2083 (code=exited, status=1/FAILURE)

Jan 29 10:40:45 mqtt.sidell.org systemd[1]: owserver.service: Service RestartSec=100ms expired, scheduling restart.
Jan 29 10:40:45 mqtt.sidell.org systemd[1]: owserver.service: Scheduled restart job, restart counter is at 5.
Jan 29 10:40:45 mqtt.sidell.org systemd[1]: Stopped Backend server for 1-wire control.
Jan 29 10:40:45 mqtt.sidell.org systemd[1]: owserver.service: Start request repeated too quickly.
Jan 29 10:40:45 mqtt.sidell.org systemd[1]: owserver.service: Failed with result 'exit-code'.
Jan 29 10:40:45 mqtt.sidell.org systemd[1]: Failed to start Backend server for 1-wire control.
 

I also tried the setup using the ds2482 kernel module described in another discussion. Nada.

Any suggestions?

29/01/2021

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Hi Mark

Have you gone through all of the steps in our OWFS tutorial?  https://www.abelectronics.co.uk/kb/article/3/owfs-with-i2c-support-on-raspberry-pi

AB Electronics UK Tech Support

29/01/2021

Posted by:
marksidell

Users Avatar

I have! And I've triple-checked all of the settings.

30/01/2021

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

I have just tried setting up a new installation of Raspberry Pi OS and a 1 Wire Pi Plus using our tutorial and everything appears to be working correctly.

Do you have a spare SD card you could use to set up a clean install of the current version of Raspberry Pi OS?  If OWFS works on your clean install then that would narrow the problem down to your current linux install, if OWFS still fails then that would mean there is a problem with the 1 Wire Pi Plus.

AB Electronics UK Tech Support

15 days ago

Posted by:
marksidell

Last edited: 02/05/2021

Users Avatar

I started with a fresh installation of the Raspberry Pi OS on a Raspberry Pi 4. I followed your instructions, to the letter.

There does seem to be one omission in the instructions. They say to enable the owserver service, but they don't say to start it. So after enabling the service, I rebooted. Presumably that would start the service. Also, since the instructions say to enable /mnt/1wire in the OWFS section of /etc/owfs.conf, it appears to be unnecessary to run the owfs command manually, as shown at the end of the instructions.

Anyhoo, it still doesn't work. I see none of my devices listed when I run the example Python program. Also, if I do "i2cdetect -y 1" I don't see the 1wire device at address 18, as I would expect.

So, wow, a lot of work for nothing.

Another bit of info. After I ran the Python program, I used journalctl -u owserver and saw the following. It would appear that the error message was logged at the moment the Python program tried to enumerate the 1wire devices.

root@raspberrypi:/home/pi# journalctl -u owserver -n 10
-- Logs begin at Sun 2021-05-02 09:35:22 EDT, end at Sun 2021-05-02 09:36:20 EDT. --
May 02 09:35:26 raspberrypi systemd[1]: Starting Backend server for 1-wire control...
May 02 09:35:26 raspberrypi owserver[386]: DEFAULT: ow_opt.c:(670) systemd mode -- ignore 'p' option
May 02 09:35:27 raspberrypi systemd[1]: Started Backend server for 1-wire control.
May 02 09:36:18 raspberrypi owserver[386]: DEFAULT: ow_reconnect.c:(69) Failed to reconnect DS2482-100 bus master!
 

15 days ago

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

I am not sure why OWFS can not see the 1 Wire Pi.  Could you try using the w1 subsystem instead of OWFS.  w1 is a Linux kernel driver for 1-Wire devices that is built into the Raspberry Pi kernel so detected 1-wire devices will appear within the file system similar to how owfs works.

First you will need to uninstall owfs.

sudo apt-get remove owfs python-ow ow-shell

Reboot your Pi and check that the 1 Wire Pi is available on 0x18 on the I2C port using

sudo i2cdetect -y 1

To enable the w1 subsystem run the three commands below

sudo modprobe ds2482
sudo sh -c "echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device"
sudo modprobe wire

If it works your 1-wire devices should be available in the /sys/bus/w1/devices/ directory.

You can enable the w1 subsystem at boot time by adding the three above commands without sudo to the /etc/rc.local file above the "exit 0" line.

If the 1-Wire Pi still does not work can you try checking the 5V and GND pins next to the RJ12 connector with a multimeter to make sure there is 5V getting to the board.  If 5V is not present on those pins check that the jumper is installed on the J1 holes.  If 5V is present then there could be a fault with the board in which case I will send you a replacement.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.