Форум » » Помощь новичку :) » Ответить

Помощь новичку :)

aptech: Ребят привет. Этот форум еще работает? есть ряд вопросов по Crestron Нужно управлять через Crestron светом организованным на Lutron HW Illumination Lutron HW Illumination - поддерживает 4 телнет сессии Вот я и хочу управлять через telnet Может кто уже сталкивался с такой задачей помогите плиз.

Ответов - 18

Игорь K.: Форум работает. Многих, кто задавал глобальные вопросы с работы повыгоняли давно, а он все работает. Насчет управления Lutron поступайте просто, подавайте команды через telnet сессию.

aptech: Игорь спасибо за столь быстрый ответ о работе форума, Это радует что есть что то постоянное. По поводу Lutron а как поднят telnet сессию c Crestron? Чтобы в нее кинуть команды? Нужно же какой то модуль создать наверное? может есть пример чтобы понять мне что надо делать?

Igor: По Telnet средствами Crestron управляются, например, кодеки ВКС LifeSize, и управляются относительно просто - в среде Crestron поднимается TCP/IP-клиент на порту №23, через который отправляются и принимаются данные управления согласно протоколу управляемого оборудования. В качестве примера можно испоьзовать демо-программу Crestron для LifeSize.


aptech: А демо-программу Crestron для LifeSize где ее найти можно? можете поянить? У меня вот что осталось от прошлого проекта но он что то сбоит не работает :( Пишет вот такую ошибку: Error: Module S-1.1.1.7 : S2_PIF_Lutron_TCP_IP_Engine at line 370: Invalid Number of bytes for string __FN_DST_STR___Wait1. NumBytes = 2048. TimeStamp: 14:16:49 5-06-14 UpTime: 0 days 00:17:09.82 Task: RX_WAIT /************************************************************ ******************************* SIMPL+ Module Information (Fill in comments below) ************************************************************ *******************************/ /* Dealer Name: System Name: System Number: Programmer: Comments: */ /************************************************************ ******************************* Compiler Directives (Uncomment and declare compiler directives as needed) ************************************************************ *******************************/ #SYMBOL_NAME "PIF Lutron P5 Engine" #HINT "This module works with P5 Lutron processors " #HELP_BEGIN The using of this modul: Parameter: Password - the password using in your home works ilumination prorramm. Inputs RX$ -data receiving from processor Connect - digital input to establisch communicationwithprocessor. Otput TX$ - data sending to processor; KeypadKLS$ - output return informanion about state of keypads in HWI system KeypadKBP$ - output return informanion about pressing of keypads in HWI system KeypadKBDT$ - output return informanion about double press of keypads in HWI system #HELP_END //Useful constants #DEFINE_CONSTANT Init_login "LutronGUI" //#DEFINE_CONSTANT loginPassword "LutronGUI,jetski" #DEFINE_CONSTANT MAX_MESSAGE_LENGTH 2048 #DEFINE_CONSTANT PULS_TIME 10 #DEFINE_CONSTANT logOutCMD "LOGOUT" #DEFINE_CONSTANT CMD_KLMON "KLMON" #DEFINE_CONSTANT CMD_KBMON "KBMON" #DEFINE_CONSTANT CMD_DLMON "DLMON" #HELP_BEGIN This modul works with Home Works proocessor P5 series only. #HELP_END /************************************************************ ******************************* Include Libraries (Uncomment and include additional libraries as needed) ************************************************************ *******************************/ // #CRESTRON_LIBRARY "" // #USER_LIBRARY "" /************************************************************ ******************************* DIGITAL, ANALOG and SERIAL INPUTS and OUTPUTS (Uncomment and declare inputs and outputs as needed) ************************************************************ *******************************/ DIGITAL_INPUT Connection; //ANALOG_INPUT ADR_PROCESOR; BUFFER_INPUT Rx$[MAX_MESSAGE_LENGTH]; // BUFFER_INPUT STRING_OUTPUT Tx$; DIGITAL_OUTPUT Estab_Connect; DIGITAL_OUTPUT Connection_fb; DIGITAL_OUTPUT New_Data; STRING_OUTPUT KeypadKLS$, KeypadKBP$,KeypadKBDT$, DimmerDL$; /************************************************************ ******************************* Parameters (Uncomment and declare parameters as needed) ************************************************************ *******************************/ // INTEGER_PARAMETER // SIGNED_INTEGER_PARAMETER // LONG_INTEGER_PARAMETER // SIGNED_LONG_INTEGER_PARAMETER STRING_PARAMETER Init_Password[13]; /************************************************************ ******************************* Structure Definitions (Uncomment and define structure definitions as needed) Note: Be sure to initialize all declared STRING variables as needed For example, in Function Main: struct.myString = ""; ************************************************************ *******************************/ /* STRUCTURE MyStruct1 { }; MyStruct1 struct; */ /************************************************************ ******************************* Global Variables (Uncomment and declare global variables as needed) Note: Be sure to initialize all declared STRING variables as needed For example, in Function Main: myString = ""; ************************************************************ *******************************/ INTEGER ThereIsConect; // LONG_INTEGER // SIGNED_INTEGER // SIGNED_LONG_INTEGER // STRING /************************************************************ ******************************* Functions (Add any additional functions here) Note: Functions must be physically placed before the location in the code that calls them. ************************************************************ *******************************/ Function Initial_Proces() { string data_out[30]; MakeString(data_out,"%s,%s\n",Init_login, Init_Password); Tx$ = data_out; } Function Disconnect_Proces() { string data_out[30]; MakeString(data_out,"%s\n",logOutCMD); Tx$ = data_out; print("Disconect! \n"); ThereIsConect = 0; Connection_fb =OFF; } function Estab_Connection() { string data_out[30]; MakeString(data_out,"%s\n",CMD_KLMON); Tx$ = data_out; print("Sent KLMON \n"); MakeString(data_out,"%s\n",CMD_KBMON); Tx$ = data_out; print("Sent KLMON \n"); MakeString(data_out,"%s\n",CMD_DLMON); Tx$ = data_out; print("Sent DLMON \n"); ThereIsConect = 1; Connection_fb =ON; } Function DL_Parse_Message(string message) { // Parsing for string -DL, [01:01:00:02], 50 integer fist_ch; integer len_str; string temp_str[100]; string ADR_str[100]; string STATE_str[100]; //print("Received for parsing: %S\n",message); while(find("DL",message)) { fist_ch = find("DL",message); temp_str = RemoveByLength(fist_ch+4,message); ADR_str = RemoveByLength(11,message); temp_str = RemoveByLength(2,message); STATE_str = message; //print ("ADR KLS is: %s STATE is: %s\n",ADR_str,STATE_str); MakeString(temp_str,"DL[%s]%s\r",ADR_str,STATE_str); DimmerDL$ = temp_str; Pulse(PULS_TIME,New_Data ); } } Function KLS_Parse_Message(string message) { // Parsing for string -\x0D\x0AKLS, [01:06:20], 000000000000010000000000\x0D\x0A integer fist_ch; integer len_str; string temp_str[100]; string ADR_str[100]; string STATE_str[100]; //print("Received for parsing: %S\n",message); while(find("KLS",message)) { fist_ch = find("KLS",message); temp_str = RemoveByLength(fist_ch+4,message); ADR_str = RemoveByLength(10,message); temp_str = RemoveByLength(2,message); STATE_str = RemoveByLength(24,message); //print ("ADR KLS is: %s STATE is: %s\n",ADR_str,STATE_str); MakeString(temp_str,"%s%s\r",ADR_str,STATE_str); KeypadKLS$ = temp_str; } } Function KBDT_Parse_Message(string message) { // Parsing for string -KBDT, [01:04:04],01 integer fist_ch; integer len_str; string temp_str[100]; string ADR_str[20]; string BTN_str[5]; //print("Received for parsing: %S\n",message); if (find("KBDT",message)){ while(find("KBDT",message)) { fist_ch = find("KBDT",message); temp_str = RemoveByLength(fist_ch+5,message); ADR_str = RemoveByLength(10,message); temp_str = RemoveByLength(2,message); BTN_str = RemoveByLength(2,message); //print ("ADR KBP is: %s STATE is: %s\n",ADR_str,STATE_str); MakeString(temp_str,"KBDT%s%s\r",ADR_str,BTN_str); KeypadKBDT$ = temp_str; } } } Function KBP_Parse_Message(string message) { // Parsing for string - KBP, [01:04:04], 1 integer fist_ch; integer len_str; string temp_str[100]; string ADR_str[20]; string BTN_str[5]; //print("Received for parsing: %S\n",message); if (find("KBP",message)){ while(find("KBP",message)) { fist_ch = find("KBP",message); temp_str = RemoveByLength(fist_ch+4,message); ADR_str = RemoveByLength(10,message); temp_str = RemoveByLength(2,message); BTN_str = RemoveByLength(2,message); //print ("ADR KBP is: %s STATE is: %s\n",ADR_str,STATE_str); MakeString(temp_str,"KBP%s%s\r",ADR_str,BTN_str); KeypadKBP$ = temp_str; } } if (find("KBR",message)){ while(find("KBR",message)) { fist_ch = find("KBR",message); temp_str = RemoveByLength(fist_ch+4,message); ADR_str = RemoveByLength(10,message); temp_str = RemoveByLength(2,message); BTN_str = RemoveByLength(2,message); //print ("ADR KBR is: %s STATE is: %s\n",ADR_str,STATE_str); MakeString(temp_str,"KBR%s%s\r",ADR_str,BTN_str); KeypadKBP$ = temp_str; } } } /************************************************************ ******************************* Event Handlers (Uncomment and declare additional event handlers as needed) ************************************************************ *******************************/ PUSH Connection { if (Connection = on) { Estab_Connect = ON; } } RELEASE Connection { if (Connection = Off) { print("%s\n","Lutron Disconnect."); call Disconnect_Proces(); Estab_Connect = off; } } CHANGE RX$ { wait(0,RX_WAIT) { //ensure only 1 thread at a time string message[MAX_MESSAGE_LENGTH]; // temporary variable to hold individual message integer first_ch; string FB_string[17]; //print("LUTRON RX: %s \n",Rx$); IF(find("LOGIN:",RX$)) { message = remove("LOGIN:",Rx$); call Initial_Proces(); } IF(find("LNET>",RX$)) { //print("find LNET: %s all length is %d \n",Rx$, len(Rx$)); IF(ThereIsConect = 0){ //print("Call Estab_conect prc \n"); message = remove("LNET>",Rx$); call Estab_Connection(); } } IF(find("KLS",RX$)) { message = Rx$; // \x0D\x0AKLS, [01:06:20], 000000000000010000000000\x0D\x0A call KLS_Parse_Message(message); } IF(find("KBP",RX$)) { message = Rx$; call KBP_Parse_Message(message); //KBP, [01:04:04], 1 } IF(find("KBR",RX$)) { message = Rx$; //KBR, [01:04:04], 1 call KBP_Parse_Message(message); } IF (find("KBDT", RX$)) { message = Rx$; call KBDT_Parse_Message(message); } IF (find("DL", RX$)) { message = Rx$; call DL_Parse_Message(message); } // Clear all buffer message = RemoveByLength(len(Rx$),Rx$); ProcessLogic(); } } /************************************************************ ******************************* Main() Uncomment and place one-time startup code here (This code will get called when the system starts up) ************************************************************ *******************************/ Function Main() { Estab_Connect = 0; ThereIsConect = 0; }

aptech: Так, нашел я этот готовый модуль. то есть получается я могу его использовать чтобы посылать команды Lutron? Или я глубоко ошибаюсь?

Igor: aptech, какой "этот"?

aptech: Igor LifeSize Video Conference IP v3.2 (cm) - Вот этот. Но по сути в этом модуле есть так называемый драйвер. LifeSize Telnet Login Driver v3.2 Вот мне надо как то этот драйвер адаптировать для Lutron Так как мой выше выложенный сбоит ... я же правильно понял :)?

Igor: aptech, не совсем так. Этот модуль предназначен для управления именно оборудованием LifeSize. Он преобразует действия программной среды, окружающей его в проекте (вызов пресетов камер, набор номера и т.п.) в команды, которые он формирует на основании протокола LifeSize и отправляет на TCP/IP-клиент. Я привел этот пример просто в качестве иллюстрации того, как управлять оборудованием по Telnet. Вам нужно освоить протокол управления Lutron, формировать на его основе команды и отсылать их на TCP/IP-клиент, поднятый в программной среде Crestron на порту №23.

aptech: Igor Безусловно я с Вами согласен. у меня есть есть такие команды они выглядят следующим образом: KBP,[1.6.30],23 - это команда вкл\выкл света на кухне. Это команда работает с ПК при поднятой сессии на lutron отправляя данную команды свет либо вкл либо выкл. Они у меня уже вбиты в Crestron У меня проблема с тем что Crestron не поднимает телнет сессию до lutrona Описание драйвера конннекта повторюсь еще раз выложил выше. команда с Crestron уходит только в ошибку так как сессии нет и выдается такая ошибка: Error: Module S-1.1.1.7 : S2_PIF_Lutron_TCP_IP_Engine at line 370: Invalid Number of bytes for string __FN_DST_STR___Wait1. NumBytes = 2048. TimeStamp: 14:16:49 5-06-14 UpTime: 0 days 00:17:09.82 Task: RX_WAIT мне надо поправить так сказать драйвер коннекта в crestron чтобы поднять сессию по 23 порту.

Igor: В коде модуля авторизации есть строка: #HINT "This module works with P5 Lutron processors " Вы упоминаете Lutron HW Illumination. Признаюсь, я не разбираюсь в Lutron т.к. не работаю с данным оборудованием по политическим мотивам. Возможно, это разные серии оборудования, предполагающие разные механизмы авторизации?

aptech: IgorСистема Lutron HW Illumination а P5 это процессор 5 серии он у меня и стоит Этот драйвер работал, потом было отключение света и все больше не работает :( Не может поднять телнет сессию теперь. вот я и думаю модернизировать данный модуль Igor может посмотрите мою программу и поймете что я хочу...

Igor: aptech, в таком случае рекомендуется выложить программный проект в том виде, в котором он Вам достался, в общедоступное место - прочие соучастники тоже посмотрят, и шансы на решение проблемы возрастут. PS: Если драйвер работал корректно, а перестал работать вследствие проблем с электроснабжением объекта, то причина, скорее всего, на аппаратном уровне, причем на стороне управляемого оборудования (Lutron). Мне не известно ни одного случая, когда работоспособность программы, именно программы Crestron была бы нарушена после отключения электропитания.

aptech: Собственно вот ссылка на него: Вот тут лежит

Igor: aptech, прежде всего нужно проверить текущий адрес IP контроллера Lutron - в программе Crestron указан адрес 192.168.0.123. Далее, не совсем понятно, как именно Вы пришли к выводу о том, что Crestron не может поднять Telnet-сессию с Lutron - в программе сигналы модуля IP-ID-08: TCP/IP Client 'Connect-F' и 'status' не определены. Смотрите сигналы модуля S-1.1.1.7: PIF Lutron P5 Engine? А кто его знает, что там внутри модуля происходит? Определите сигналы 'Connect-F' и 'status', скомпилируйте программу, закачайте ее в контроллер и в отладчике проверьте поведение данных сигналов.

aptech: Igor Доброе утро. Адрес контроллера Lutron действителен 192.168.0.123 А можно не скромный вопрос :) где найти отладчик? Все нашел Называется SIMPL Debugger пошел смотреть что там происходит

aptech: Ребят спасибо SIMPL Debugger помог я увидел что я не правильно вбивал последовательность логина и пароля. и что логин брался вообще дефолдный поменял на свой и все заработало...

Igor: aptech, модули, использованные в Вашей программе, я могу использовать в своей работе?

aptech: Igor Я не против.



полная версия страницы