Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team

Question
Guest Turmoil
I'm using a button on an HC2 (at level 4.58) virtual device to create an Net.FHttp object but the instance:GET never completes. The VD button code is:
local devId = fibaro:getSelfId();
local ipAddr = fibaro:getValue( devId, "IPAddress");
local tcpPort = fibaro:getValue( devId, "TCPPort");
local vdConn = Net.FHttp(ipAddr, tcpPort);
local resp, stat, retc = vdConn:GET("/");
fibaro:debug( resp .." - "..stat .." - "..retc);
The server sees the request arrive as:
GET / HTTP/1.1
Connection: Close
Content-Length: 0
Host: 10.0.0.100:999
It returns:
0000+ 48545450 2F312E31 20323030 204F4B0D +HTTP/1.1 200 OK.+
0010+ 0A536572 7665723A 204D6963 6B79204D +.Server: Micky M+
0020+ 6F757365 0D0A436F 6E74656E 742D4C6F +ouse..Content-Lo+
0030+ 63617469 6F6E3A20 68747470 3A2F2F31 +cation: http://1+
0040+ 302E302E 302E3130 303A3332 37302F63 +0.0.0.100:3270/c+
0050+ 3A5C4653 5C74656D 702F6465 6661756C +:\FS\temp/defaul+
0060+ 742E6874 6D0D0A43 6F6E7465 6E742D54 +t.htm..Content-T+
0070+ 7970653A 20746578 742F6874 6D6C0D0A +ype: text/html..+
0080+ 4C617374 2D4D6F64 69666965 643A204D +Last-Modified: M+
0090+ 6F6E2C20 31382053 65702032 30303020 +on, 18 Sep 2000 +
00A0+ 31353A34 323A3030 20474D54 0D0A436F +15:42:00 GMT..Co+
00B0+ 6E74656E 742D4C65 6E677468 3A203635 +ntent-Length: 65+
00C0+ 33380D0A 0D0AEFBB BF3C2144 4F435459 +38.... <!DOCTY+
00D0+ 50452068 746D6C3E 0D0A3C68 746D6C3E +PE html>..<html>+
00E0+ 0D0A3C3F 7068700D 0A096966 28697373 +..<?php.. if(iss+
00F0+ 65742824 5F474554 5B277061 6765275D +et($_GET['page']+
.........
server then issues shutdown as requested but the fibaro GET call never completes. Does anyone know what might be wrong here?
Ironically I was trying to write some virtual device help/experiences info and decided to explore all the TCP calls. Strings and Net.FTcpSocket worked OK eventually.
Grateful for any help
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.