Outils pour utilisateurs

Outils du site


maison2:configuration_open_wrt:owfs

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
maison2:configuration_open_wrt:owfs [04/2012] – [TEST] fredmaison2:configuration_open_wrt:owfs [09/2013] (Version actuelle) – [TEST] 86.68.156.71
Ligne 26: Ligne 26:
  
 </code> </code>
 +===== creation d'un fichier de configuration owfs.conf : owfs -c owfs.conf =====
  
 +<code>
 +# Sources
 +device = /dev/tts/1
 +# owfs specific
 +mountpoint = /tmp/1wire/
 +# Temperature scales
 +Celsius
 +# Timeouts (all in seconds)
 +# cache for values that change on their own
 +timeout_volatile = 0 # seconds "volatile" values remain in cache
 +#0 a cause du boutonde sonnette et des capteurs aqua(niveau)
 +# cache for values that change on command
 +timeout_stable = 0 # seconds "stable" values remain in cache
 +#0 a cause de la sonnette et des pompes aqua
 +# cache for directory lists (non-alarm)
 +timeout_directory = 60 # seconds "directory" values remain in cache
 +# cache for 1-wire device location
 +timeout_presence = 60 # seconds "device presence" (which bus)
 +timeout_serial = 10 # seconds to wait for serial response
 +timeout_usb = 250 # seconds to wait for USB response
 +timeout_network = 250 # seconds to wait for tcp/ip response
 +timeout_ftp = 250 # seconds inactivity before closing ftp session
 +#
 +# Process control 
 +pid_file =/var/run/owfs.pid 
 +error_print = 0 # 0-mixed 1-syslog 2-stderr 3-suppressed 
 +error_level = 9 # increasing noise 
 +
 +# Display 
 +# format = f[.]i[[maison2:c# 1-wire address f amily i d code c rc 
 +format = f.i.c
 +
 +# Cache 
 +cache_size = 100000 # maximum cache size (in bytes) or 0 for no limit (default 0) # 
 +
 +
 +
 +File: /usr/bin/run-owfs
 +#!/bin/sh
 +
 +/etc/init.d/owserver start force
 +/etc/init.d/owfs start force
 +/etc/init.d/owhttpd start force
 +/etc/init.d/owftpd start force
 +
 +</code>
 +===== 1 wire error =====
 +on ajoute un menu sous webif grace a script suivant (/www/cgi-bin/webif/_maison_1wire_stat.sh)
 +<code bash>
 +#!/usr/bin/webif-page
 +<?
 +. /usr/lib/webif/webif.sh
 +header "MAISON" "1 Wire Stat" ""
 +cat <<EOF
 +<h2>1 wire statistics</h2>
 +/var/1wire/bus.0/statistics/errors/
 +EOF
 +cd /var/1wire/bus.0/statistics/errors/
 +echo "<BR>grep sur valeur différente de 0<BR>"
 +tmp=$(grep  [1-9] *)
 +echo $tmp 
 +
 +cd /var/1wire/statistics/read/
 +echo "<BR><BR>/var/1wire/statistics/read/"
 +echo "<BR>success";cat success
 +echo "<BR>tries.ALL";cat tries.ALL
 +
 +cd /var/1wire/statistics/write
 +echo "<BR><BR>/var/1wire/statistics/write"
 +echo "<BR>success";cat success
 +echo "<BR>tries.ALL";cat tries.ALL
 +
 +cd /var/1wire/statistics/threads/overall
 +echo "<BR><BR>var/1wire/statistics/threads/overall"
 +echo "<BR>sum";cat sum
 +echo "<BR>num";cat num
 +echo "<BR>now";cat now
 +echo "<BR>max";cat max
 +?>
 +<? footer ?>
 +<!--
 +##WEBIF:name:MAISON:1_Wire_Statistics
 +-->
 +</code>       
 +
 +<code>
 +fred@Xubuntu:~/WL500GP_File_Structure/tmp/1wire/bus.0/statistics/errors$ grep -v 0 *
 +CRC8_errors:           2
 +CRC8_tries:         169
 +ne fonctionne pas avec 20 a la place de 2 ....
 +
 +mieux :
 +fred@Xubuntu:~/WL500GP_File_Structure/tmp/1wire/bus.0/statistics/errors$ grep  [1-9] *
 +CRC8_errors:           20
 +CRC8_tries:         169
 +max_delay:       0.011
 +
 +maintenant il faudrait substituer les retour chariot par des <BR>
 +
 +</code>
 +
 +
 +
 +====== TEST ======
 +<code>
 +root@OpenWrt:~/1wire/05.A12C27000000# echo 1 >> PIO
 +
 +root@OpenWrt:~/1wire/29.488000000000# echo 255 >> PIO.BYTE
 +root@OpenWrt:~/1wire/29.488000000000# cat PIO.ALL
 +1,1,1,1,1,1,1,1
 +
 +pour lire une entree:
 +root@WL500GP:~/1wire/29.C97F00000000# cat sensed.7
 +sensed passe a 1 quand l’entrée physique est a 5V
 +
 +les led etant commandé en low side quand on a PIO.X=1 on a sensed.X=0 et inversement
 +
 +</code>
 ===== test du lien serie ===== ===== test du lien serie =====
 <code> <code>
Ligne 109: Ligne 228:
 </code> </code>
  
-===== creation d'un fichier de configuration owfs.conf : owfs -c owfs.conf ===== 
- 
-<code> 
-# Sources 
-device = /dev/tts/1 
-# owfs specific 
-mountpoint = /tmp/1wire/ 
-# Temperature scales 
-Celsius 
-# Timeouts (all in seconds) 
-# cache for values that change on their own 
-timeout_volatile = 0 # seconds "volatile" values remain in cache 
-#0 a cause du boutonde sonnette et des capteurs aqua(niveau) 
-# cache for values that change on command 
-timeout_stable = 0 # seconds "stable" values remain in cache 
-#0 a cause de la sonnette et des pompes aqua 
-# cache for directory lists (non-alarm) 
-timeout_directory = 60 # seconds "directory" values remain in cache 
-# cache for 1-wire device location 
-timeout_presence = 60 # seconds "device presence" (which bus) 
-timeout_serial = 10 # seconds to wait for serial response 
-timeout_usb = 250 # seconds to wait for USB response 
-timeout_network = 250 # seconds to wait for tcp/ip response 
-timeout_ftp = 250 # seconds inactivity before closing ftp session 
-# 
-# Process control  
-pid_file =/var/run/owfs.pid  
-error_print = 0 # 0-mixed 1-syslog 2-stderr 3-suppressed  
-error_level = 9 # increasing noise  
- 
-# Display  
-# format = f[.]i[[maison2:c# 1-wire address f amily i d code c rc  
-format = f.i.c 
- 
-# Cache  
-cache_size = 100000 # maximum cache size (in bytes) or 0 for no limit (default 0) #  
- 
- 
- 
-File: /usr/bin/run-owfs 
-#!/bin/sh 
- 
-/etc/init.d/owserver start force 
-/etc/init.d/owfs start force 
-/etc/init.d/owhttpd start force 
-/etc/init.d/owftpd start force 
- 
-</code> 
  
 ====== adresse des différents éléments 1 wire ====== ====== adresse des différents éléments 1 wire ======
Ligne 202: Ligne 273:
 le réseau est visible et stable  le réseau est visible et stable 
  
 +
 +===== modification owfs =====
 +
 +apres avoir installé le package owfs-2.6p8 de facon [[maison2:configuration_open_wrt:owfs|standard]] sur le routeur
 +  * on place {{:maison2:configuration_open_wrt:owfs-2.6p8.zip|owfs-2.6p8.zip}} dans /OpenWrt-SDK-brcm-2.4-for-Linux-i686/dl/
 +  * on place le {{:maison2:configuration_open_wrt:owfs-2.6p8_package_make.zip|package makefile}} dans /OpenWrt-SDK-brcm-2.4-for-Linux-i686/package/owfs-2.6p/
 +  * sous ~/openwrt/OpenWrt-SDK-brcm-2.4-for-Linux-i686/ on fait make clean (:!: ceci va ecraser toutes les modifications faites sous /build_mipsel/ voir après)
 +{{:maison2:configuration_open_wrt:ow_ds9097_modif.zip|}}
 +<code>
 +on modifie ~/openwrt/OpenWrt-SDK-brcm-2.4-for-Linux-i686/build_mipsel/owfs-2.6p8/module/owlib/src/c/ow_ds9097U.c
 +on modifie ~/openwrt/OpenWrt-SDK-brcm-2.4-for-Linux-i686/build_mipsel/owfs-2.6p8/module/owlib/src/c/ow_ds9097.c
 +~/openwrt/OpenWrt-SDK-brcm-2.4-for-Linux-i686/make V=99 à V=1
 +wget http://frederic.simon.free.fr/maison/libow_2.6p8-4FS2_mipsel.ipk
 +wget http://www.lamaisonsimon.fr/dev/libow_2.6p8-4FS2_mipsel.ipk
 +ipkg install -force-overwrite libow_2.6p8-4FS2_mipsel.ipk
 +</code>
 +
 +====== 1 Wire in C ======
 +
 +===== utilisation de OWCAPI =====
 +je n'arrive pas à linker OWCAPI malgrès les liens ci dessous, ca me semble un peu lourd pour mes besoins
 +  * {{:maison2:configuration_open_wrt:lib.zip|}}
 +  * [[http://home.mag.cx/openwrt/source/mk/kamikaze/package/owfs/]]
 +  * [[http://quamquam.org/~tetzlav/freifunk/owfs/|pour kernel2.6...]]
 +
 +===== on passe par le system de fichier que crée OWFS =====
 +
 +  * {{:maison2:configuration_open_wrt:1wire.zip|}}
 +
 +  * [[http://vesta.homelinux.net/wiki/acquisition_senseurs_i2c_fonera_par_messages_xpl.html|sys_log et socket]]
  
  
  
maison2/configuration_open_wrt/owfs.1333575232.txt.gz · Dernière modification : 04/2012 de fred