1-Wire on wiringPi: missing w1 folder by path "/sys/bus/w1/devices/"

edited May 2018 in Supported devices

I'm trying to get DS1820 temperature and humidity sensor working on my raspberry pi 3 by running Example-wiringPi.

During the initialization of 1-Wire protocol, the Example-wiringPi tries to access path /sys/bus/w1/devices/, but unfortunately w1 folder is missing in the Emteria.

Does it mean that 1-Wire protocol isn't supported by the Emteria? Or I have to replace w1 with something else?

Thanks for the help!

Comments

  • Maybe you need to load the corresponding kernel module (see https://raspberrypi.stackexchange.com/questions/26623/ds18b20-not-listed-in-sys-bus-w1-devices)? All modules are located in /boot/modules

  • hello kalkov, thank you for referring me to the resource on the StackExchange.

    I was googling a little about that. eventually, I've reached this article: https://pinout.xyz/pinout/1_wire

    it is written there:

    To enable the one-wire interface you need to add the following line to /boot/config.txt, before rebooting your Pi:
    dtoverlay=w1-gpio

    I opened config.txt and even have found similar line there:

    dtoverlay=vc4-kms-v3d,cma-256

    I added dtoverlay=w1-gpio in the end, saved, and rebooted. /sys/bus/w1 hasn't appeared.

    Any ideas what can be wrong?

  • edited May 2018

    as I understand there is another way how setup 1-wire protocol, but it seems I've faced problems with that too.

    in the Example-wiringPi there is a method that initializes 1-wire:

    //1-Wire
    private void insmod1Wire() {
    try {
    DataOutputStream os = new DataOutputStream(mProcess.getOutputStream());
    os.writeBytes("insmod /system/lib/modules/wire.ko\n");
    os.writeBytes("insmod /system/lib/modules/w1-gpio.ko\n");
    os.writeBytes("insmod /system/lib/modules/w1_therm.ko\n");
    os.flush();
    Thread.sleep(100);
    } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }

    I decided to execute insmod command localy on device using the terminal. File wire.ko doesn't exists by the path '/system/lib/modules/'. I managed to find it here: '/boot/modules/'. I tried to execute insmod with corrected path, but it has responded with the error that file doesn't exist:

    insmod /boot/modules/wire.ko
    insmod: failed to load /boot/modules.wire.ko: No such file or directory

  • I pointed you to that location in my last post:

    @kalkov said:
    All modules are located in /boot/modules

    You need to load them in the correct order and with root priviliges (su).

  • rpi3:/ # insmod /boot/modules/w1-gpio.ko
    [ 1964.697588] w1_gpio: Unknown symbol w1_remove_master_device (err 0)
    [ 1964.716717] w1_gpio: Unknown symbol w1_add_master_device (err 0)

    Obviously, there is something missing. You need to find out where those functions are defined and load the corresponding module before loading this one.

  • I also encounter the same problem. Did you manage to find solution?
Sign In or Register to comment.