please choosego to mobile | Continue to access the PC version
View: 13261|Reply: 3

1 Wire on OPI Zero

[Copy link]

1

threads

1

posts

9

credits

Novice

Rank: 1

credits
9
Published in 2017-7-26 15:35:18 | Show all floors |Read mode
Hello every one,


if i enable kernel modules
  1. w1-sunxi
  2. w1-gpio
  3. w1-therm
Copy code
where should i connect data from 1-wire bus so can populate /sys/bus/w1/devices?

Every tutorial states PA20 but i cannot use it on OPI Zero.

Best Regards
G





10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2017-8-5 16:09:03 | Show all floors
Edited by nopnop2002 at 2017-8-5 17:10

1.edit your /etc/default/cpufrequtils
After edit.
$ cat /etc/default/cpufrequtils
ENABLE=true
MIN_SPEED=480000
MAX_SPEED=1200000
GOVERNOR=interactive


2.reboot


3.driver load
sudo modprobe w1-sunxi
sudo modprobe w1-gpio
sudo modprobe w1-therm


4.check gpio

$dmesg

[   34.067409] W1_SUNXI: Added w1-gpio on GPIO-10


I connected ds18b20 to gpio10 with pullup

orangepi@orangepizero:~$ ls /sys/bus/w1/devices/
28-021600b0a4ff  w1_bus_master1
orangepi@orangepizero:~$ cat /sys/bus/w1/devices/28-021600b0a4ff/w1_slave
ce 01 4b 46 7f ff 0c 10 97 : crc=97 YES
ce 01 4b 46 7f ff 0c 10 97 t=28875
orangepi@orangepizero:~$




7

threads

38

posts

181

credits

Registered member

Rank: 2

credits
181
Published in 2018-2-11 20:50:09 | Show all floors
# cat /boot/armbianEnv.txt
verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3 w1-gpio
param_w1_pin=PA15
rootdev=UUID=ebe9dacf-124f-486c-b6c1-08749e209374
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

# ls /sys/bus/w1/devices/ ; cat /sys/bus/w1/devices/28*/w1_slave
28-0517025727ff  w1_bus_master1
62 00 4b 46 7f ff 0c 10 af : crc=af YES
62 00 4b 46 7f ff 0c 10 af t=6125

ARMBIAN 5.35 user-built Ubuntu 16.04.3 LTS 4.13.16-sunxi

1W can only work on pin MOSI; if this pin is already used, you are doomed.

NB: on opi0, there are two MOSI, so with a bit of work, it should be possible to use the NAND MOSI for 1W.

https://forum.armbian.com/topic/1395-orange-pi-pc-1-wire/?page=2

0

threads

1

posts

8

credits

Novice

Rank: 1

credits
8
Published in 2018-5-5 22:31:37 | Show all floors
1W can only work on pin MOSI
it can work also on I2C (DS2482) and UART (DS2480B): https://github.com/rororor/opiot-01
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list