[quote="szigeti"][quote="szigeti"]After the loaded the (w1-ds2408) kernel module I see the following:
[code]
[email protected] ~ $ ls -l /sys/bus/w1/devices/29-0000000fde25/
total 0
-r--r--r-- 1 root root 1 Sep 7 08:11 activity
-r--r--r-- 1 root root 1 Sep 7 08:11 cond_search_mask
-r--r--r-- 1 root root 1 Sep 7 08:11 cond_search_polarity
lrwxrwxrwx 1 root root 0 Sep 7 08:11 driver -> ../../../bus/w1/drivers/w1_slave_driver
-r--r--r-- 1 root root 4096 Sep 7 08:11 id
-r--r--r-- 1 root root 4096 Sep 7 08:11 name
-rw-rw-r-- 1 root root 1 Sep 7 08:18 output
drwxr-xr-x 2 root root 0 Sep 7 08:11 power
-r--r--r-- 1 root root 1 Sep 7 08:11 state
-rw-rw-r-- 1 root root 1 Sep 7 08:11 status_control
lrwxrwxrwx 1 root root 0 Sep 7 08:11 subsystem -> ../../../bus/w1
-rw-r--r-- 1 root root 4096 Sep 7 08:11 uevent
[email protected] ~ $
[/code]
How can read/write the ports?[/quote]
I got the following examples from the kernel modul's developer but I don't have time to test it.
read: [b]dd if=./output bs=1 count=1 | hexdump[/b]
write: [b]echo \x01 |dd of=./output bs=1 count=1[/b]
I will be happy if somebody try it and send back every feedback.[/quote]
Hi!
I've test those commands, the reading is Ok and returns:
0000000 00ff
0000001
(i think 00ff is the status of switches in binaries it's 11111111)
I'd some problems with the write command. in fact I think it's working but you need some stuff:
you need to wire pin 10 (rzst) and pin 3 (Vcc) of the ds2408 (I found that in the datasheet). and in the directory you need to do:
[code]sudo chmod og=rw output[/code].
If not you may have errors with the output file.
when I do the write command it's working but return an error (erreur d'entrée/sortie) i think it's I/O in english. but when I redo the read command 00ff change (for x01 it return 0078).
I think it could help you.
ps: sorry for my bad english!!!