Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

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

The 1 Wire Pi Plus and 1 Wire Pi Zero are a 1 Wire interface for the Raspberry Pi

29/01/2021

Posted by:
marksidell

marksidell 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

andrew Avatar

Hi Mark

Have you gone through all of the steps in our OWFS tutorial? owfs with i2c support on raspberry pi.

29/01/2021

Posted by:
marksidell

marksidell Avatar

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

30/01/2021

Posted by:
andrew

andrew Avatar

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.

02/05/2021

Posted by:
marksidell

marksidell 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!

02/05/2021

Posted by:
andrew

andrew Avatar

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 are 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.

Sign in to post your reply


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.

Home

Shop

Learn

Forum

FAQ

Contact

0 item

Your cart is empty

Please browse our shop to order from the wide range of Raspberry Pi boards and accessories.

Subtotal:£0.00
View Basket Continue to Checkout