Hello.

Using owfs-3.1p4.

I need to write binary data to an external sensor.

I do this settings:

owfs.conf
...
SCRIPT: "RELAY_SET", "constant_family", b1024, 1, u, /opt/_read, 
/opt/_write, ''
...

The main is b1024. Is it right?

And write from a client by perl script:

OWNet::write( "$dev_ip:4304" , "/relay_setting/RELAY_SET", `echo -n $ss 
| gzip -c` );

As you see, I write a gziped data.

Client Hexdump is -
[0000] 1F 8B 08 00 6C 3D 01 58 00 03 33 D4 F1 F3 D7 31....

But!

root@CONSTANT:~> owread -s 172.19.19.10 /relay_setting/RELAY_SET  | hexdump
0000000 088b 6c00 013d 0058 3303 f1d4 d7f3 d031
0000010 77f1 0373 0692 3a3a 46ca 02e8 e8c6 2602
0000020 02e8 e8a6 6602 02e8 e8e6 1602 02e8 be00
0000030 9c53 88e3 0000 0000 0000 0000 0000 0000
0000040 0000 0000 0000 0000 0000 0000 0000 0000
*
0000400

My script make a simple cat to file. We are can see this file:

cat constant_control.bin  | hexdump
0000000 088b 6c00 013d 0058 3303 f1d4 d7f3 d031
0000010 77f1 0373 0692 3a3a 46ca 02e8 e8c6 2602
0000020 02e8 e8a6 6602 02e8 e8e6 1602 02e8 be00
0000030 9c53 88e3 0000 0000
0000038

I think, first byte is lost and...
By another words, I can unzip the owread data.

Please, where is first byte or my mistake?

cat /opt/_write
#!/bin/sh
RW=$4

case "$RW" in
         read)  cat /etc/constant_control.bin ;;
         write) cat > /etc/constant_control.bin ;;
esac


Thanks.

-- 

== Henry Pootel ==


P.S.
root@CONSTANT:~> echo -n 
'1,NO,0,OFF,0,0,,#2,NO,0,OFF,0,0,,#3,NO,0,OFF,0,0,,#4,NO,0,OFF,0,0,,#5,NO,0,OFF,0,0,,#6,NO,0,OFF,0,0,,#7,NO,0,OFF,0,0,,#8,NO,0,OFF,0,0,,#'|
 
gzip -c  | hexdump
0000000 8b1f 0008 4434 5801 0300 d433 f3f1 31d7
0000010 f1d0 7377 9203 3a06 ca3a e846 c602 02e8
0000020 e826 a602 02e8 e866 e602 02e8 e816 0002
0000030 53be e39c 0088 0000
0000038

root@CONSTANT:~> owwrite -s 172.19.19.10 /relay_setting/RELAY_SET  `echo 
-n 
'1,NO,0,OFF,0,0,,#2,NO,0,OFF,0,0,,#3,NO,0,OFF,0,0,,#4,NO,0,OFF,0,0,,#5,NO,0,OFF,0,0,,#6,NO,0,OFF,0,0,,#7,NO,0,OFF,0,0,,#8,NO,0,OFF,0,0,,#'|
 
gzip -c`

root@CONSTANT2:/etc> cat constant_control.bin  | hexdump
0000000 8b1f 3f08 0144 0358 d433 f3f1 31d7 f1d0
0000010 7377 9203 3a06 ca3a e846 c602 02e8 e826
0000020 a602 02e8 e866 e602 02e8 e816 be02 9c53
0000030 88e3
0000032

root@CONSTANT:~> owread -s 172.19.19.10 /relay_setting/RELAY_SET | hexdump
0000000 8b1f 3f08 0144 0358 d433 f3f1 31d7 f1d0
0000010 7377 9203 3a06 ca3a e846 c602 02e8 e826
0000020 a602 02e8 e866 e602 02e8 e816 be02 9c53
0000030 88e3 0000 0000 0000 0000 0000 0000 0000
0000040 0000 0000 0000 0000 0000 0000 0000 0000
*
0000400


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to