Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ClaudioLNX

Pages: [1]
1
Users / Re: Generic IP Device - Configure
« on: November 12, 2011, 09:03:22 am »
I'm very sorry...thom.....but i dont find the ip variable in IP Camera template.
Perhaps i don't use conn object? is a problem?

IP Camera Template Code
Code: [Select]
conn_.Reconnect()
auth_s=device_.devdata_[114]+":"+device_.devdata_[115]
auth_a=Array.new;
auth_s.each{|c| auth_a.push(c)}

fix_path=device_.devdata_[2];
fix_path='/'+fix_path if(fix_path[0]!='/'[0]);

s = "GET "+fix_path+" HTTP/1.0\r\n"
s+= "Accept: */*\r\n"
s+= "Authorization: Basic "+auth_a.pack("m").chop+"\r\n"
s+= "\r\n"

conn_.Send(s)
My Code
Code: [Select]
require'net/http'
fix_path=device_.devdata_[2];
fix_path='/'+fix_path if(fix_path[0]!='/'[0]);
h=Net::HTTP.new('192.168.1.201',80)
resp,data=h.get(fix_path+absolute_channel.to_s,nil)

Claudio

2
Users / Re: Generic IP Device - Configure
« on: November 10, 2011, 08:56:50 pm »
ok...... look my code......if you have other problem...say me .. i
But because Joakim said: "perhaps this discussion should be in the Developer's forum and not in the Users." ....  ;D ....perhaps we have to open a new topic in Developers!!

Code: [Select]
require'net/http'
fix_path=device_.devdata_[2];
fix_path='/'+fix_path if(fix_path[0]!='/'[0]);
h=Net::HTTP.new('192.168.1.201',80)
resp,data=h.get(fix_path+absolute_channel.to_s,nil)
absolute_channel is an input parameter.
fix_path is a device_data "path"

Claudio

PS:last problem (for me) is a IP: i have hardcode the ip ....

3
Users / Re: Generic IP Device - Configure
« on: November 10, 2011, 03:59:49 pm »
I'm very happy... if i can help u....
but now I do not have access to the code. Tonight I'll copy the code here and I'll explain how to do

Claudio

4
Users / Re: Generic IP Device - Configure
« on: November 06, 2011, 12:04:23 pm »
OK....done... perfect! (the error was because i hadn't restart router)

but if i want know the device data IP in ruby code?
Other data have a number (example #2 for path) .. IP data  no!!! I wish  not replicate IP in other data field.

How i have to do? where i can find the all property of device object?


PS: sorry.....I hope that my behavior is correct, otherwise I apologize


5
Users / Re: Generic IP Device - Configure
« on: November 05, 2011, 04:01:51 pm »
thanks.....i have turn on my first light!!!!!  ;D
but i hardcode :-[ the path and ip.....infact

.. when i use variable path (device_.devdata_[2];) i have the path with ip address.
example
in config: path is only "/forms.htm"
in log if i print variable: path is "192.168.1.201/forms.htm"

i need two  different value: ipaddress and path!
with path i can use a my new data, but with ip? how can i have he value of ip?

thanks again!!!

6
Users / Re: Generic IP Device - Configure
« on: November 01, 2011, 12:56:41 pm »
Thanks......i'll try ....

Claudio

7
Users / Generic IP Device - Configure
« on: October 31, 2011, 12:31:47 pm »
Sorry for my question ( i'm newbie) and for my English (i'm italian) ...:) ...

I have a simple switch over ethernet that i use for different utilities( light, radio, etc) .... I can switch on or off on browser with command
192.168.1.201/forms.htm?led1=1 ----> turn on
192.168.1.201/forms.htm?led1=0 ----> turn off

how can I create a device that implements this switch? i have to write code or i can use any template?

Thanks a lot
Claudio

Pages: [1]