Dear friends!

I'm sorry, I distract you from your work...
I've made a mistake, I'll find it by own.
So, I've wrote a simple script and test my situation.

root@CONSTANT:~> cat test.pl
#!/usr/bin/perl

use OWNet;
use IO::Compress::Gzip qw(gzip $GzipError) ;
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);

$test_string = 
'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,,#';

print "$test_string\n";
gzip \$test_string => \$gz_data;
OWNet::write( "172.19.19.10:4304" , "/relay_setting/RELAY_SET", $gz_data );

$result = OWNet::read( "172.19.19.10:4304" , "/relay_setting/RELAY_SET");
gunzip \$result => \$uncompressed;
print "$uncompressed\n";



root@CONSTANT:~> ./test.pl
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,,#
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,,#


As you see, all right.

;-) But we are can't send binary file by cli.

Thank you very much for help!


16.10.2016 01:18, Stefano Miccoli пишет:
>
>> On 15 Oct 2016, at 15:23, Henry Pootel <henry.poo...@regall.net
>> <mailto:henry.poo...@regall.net>> wrote:
>>
>> root@CONSTANT:~> owwrite -s 172.19.19.10 /relay_setting/RELAY_SET
>>  `cat ee`
>
> I see a couple of problems here.
>
> First, owwrite seems to have problems with nul characters in his
> arguments, but please wait for confirmation by Jan.
>
> Second, assuming you are using bash, the command should be
>
> $ owwrite -s 172.19.19.10 /relay_setting/RELAY_SET "$(< ee)"
>
> Brief explanation
>
>   * $(command) is preferred over `command` see
>     http://mywiki.wooledge.org/BashFAQ/082
>   * $(<pathname) is a shortcut for $(cat pathname) see bash manpage
>   * double quotes are necessary because command substitution is
>     subjected to word splitting, if not protected by double quotes.
>
>
> In other words with your command the shell will split the content of
> ‘ee' at whitespace, thus causing further problems.
>
> You can confirm that owserver is functioning properly with
> pyownet http://pyownet.readthedocs.io/en/latest/
>
>>>> data = open('ee', 'rb').read()
>>>> from pyownet import protocol
>>>> owp = protocol.proxy(host=‘172.19.19.10’)
>>>> owp.write('/relay_setting/RELAY_SET', data)
>
> From my experiments, with pyownet+owserver the data is transmitted cleanly.
>
> Stefano
>
>
>
> ------------------------------------------------------------------------------
> 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
>

-- 

== Henry Pootel ==

------------------------------------------------------------------------------
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