¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

Re: Checking Processor type in S#

 

Since this is not S# Pro, you might consider just checking for control system type in the S+ wrapper and passing it back.?



/*
? Global Variables
*/
?
INTEGER SystemType;
?
/*
? Main()
*/
?
Function Main()
{
? ? WaitForInitializationComplete();
?
? ? //determine 2 or 3 series environment
? ? SWITCH( GetSeries() )
? ? {
? ? ? ? ?CASE (2): { SystemType = 2; }
? ? ? ? ?CASE (3): { SystemType = 3; }
?CASE (4): { SystemType = 4; }
? ? }
PRINT("+Setup: SystemType = %d\n",SystemType);
}
?


File /Switch-Buffer.zip uploaded #file-notice

[email protected] Notification
 

The following files have been uploaded to the Files area of the [email protected] group.

By: mark@...

Description:
Need a bunch of analog buffers? Get sick of CtlC,CtlV,F9,CtlC,CtlV,F9? Switch-Buffer is a package that contains a bunch of abufs. Nothing more, nothing less. You get to package your untidy buffer folder into a single module and don't have to do the tedious copy/paste/modify routine. N-1 takes a number of inputs and passes them to a single variable. 1-N takes a single variable and buffers them to a number of outputs.


File /StringToXMLSorted v4.zip uploaded #file-notice

[email protected] Notification
 

The following files have been uploaded to the Files area of the [email protected] group.

By: mark@...

Description:
Need to read/write to a file, but file ops are a little beyond you? StringtoXMLsorted is a S+/S# module that will read & write industry standard XML format files in your processor NVRAM. * handles any number of records * records can contain from one to five separate data elements. * records can be sorted alphabetically on the first data element. * reports number of records found, for driving dynamic lists. * file scan be ported to/from processor via FTP and edited on a PC using any XML file tool such as microsoft's free XML notepad. A couple of use cases: TV channel presets Configuration values IP addresses Enjoy!


Re: HttpsClient => Content-Length issue

 

I'm not certain what is going wrong with your content length header, however I wanted to share how I was handling the headers in a different way than your code. Perhaps it will be helpful to you. This seems to work consistently for me with any type of header I have tried so far. Hope this helps.

Partial code below:

?????? public void SomeMethod()
??????????????? url = "someURL";

??????????????? var headers = new HttpsHeaders();
??????????????? var authHeader = new HttpsHeader("Authorization", authToken);
??????????????? headers.AddHeader(authHeader);

??????????????? response = SendRequest(url, RequestType.Get, headers, "");
??????????????? // do some response processing here


????? private HttpsClientResponse SendRequest(string url, RequestType type, HttpsHeaders headers, string body)
??????? {
??????????? string myURL;

??????????? // setup the client
??????????? HttpsClient client = new HttpsClient();
??????????? client.HostVerification = false;
??????????? client.PeerVerification = false;
?????????? ?

??????????? // setup request
??????????? HttpsClientRequest request = new HttpsClientRequest();
??????????? myURL = String.Format("https://{0}/{1}/{2}", ServerAddress, APIVersion, url);
??????????? request.Url.Parse(myURL);
??????????? request.RequestType = type;
??????????? if (headers != null)
??????????? {
??????????????? request.Header = headers;
??????????? }
??????????? request.Encoding = Encoding.UTF8;
??????????? request.ContentString = body;
??????????? request.ContentSource = ContentSource.ContentString;

??????????? // dispatch the request below


Re: Using Event Scheduler 2 (v1.2) with 4-series

 

To clarify just a bit...

Event Scheduler v1.2.0 dates back to 2-Series, before 10 program slots were available.
So for 2-Series \\NVRAM\\scheduler.dat in SIMPL simply refers to \NVRAM\Scheduler.dat.

However, 3-Series/4-Series NVRAM folder is separated by Program Slot subfolders.
So \\NVRAM\\scheduler.dat in SIMPL now actually refers to \NVRAM\ProgIDTag\scheduler.dat.
(ProgIDTag is arbitrary, but must match what you set in SIMPL under "Project > Edit Program Header > Program ID Tag")


Re: DM TX 4KZ - Console Commands

 

In this case, yes. Update: I have got that command down now and am able to switch as needed now.


Re: Extracting part of a return string

 

¿ªÔÆÌåÓý

If the OP were trying to process the entire string or if there was more variability in the strings I would agree but it seems for what they want/need it could be done in an SIO, for example:

?

Parameter 1

'recording': {'state': 'idle',

?

Parameter 2

'recording': {'state': 'running',

?

Then take those to a IL (or an INIT/EQU combo) to latch the recording status.

?

Parameter 3

'live': {'available': True, 'linked_to_recording': False, 'state': 'idle',

?

Parameter 4

'live': {'available': True, 'linked_to_recording': False, 'state': 'running',

?

Then take those to an IL (or an INIT/EQU combo) to latch the live status

?

If you need a ¡°recording and not live¡± ¡°live and not recoding¡± ¡°live and recording¡± FB you could either use a collection of gates or a TT to yield that result.

?

Of course this would be real easy and the most robust/error resistant in S# where you can just deserialize the JSON into an object

?

--

Lincoln King-Cliby, CTS, DMC-E-4K/T/D
Commercial Market Director
Sr. Systems Architect | Crestron Certified Master Programmer (Diamond)
ControlWorks Consulting, LLC
Direct: (+1)440.771.4807 | Cleveland: (+1)440.449.1100? | Boston: (+1)508.695.0188 | DC: (+1)202.381.9070? | Fax: (+1)440.449.1106
Crestron Services Provider | Biamp Authorized Independent Programmers | Extron Qualified Independent Programmer

?

From: [email protected] [mailto:[email protected]] On Behalf Of l_codd
Sent: Thursday, February 10, 2022 4:58 AM
To: [email protected]
Subject: Re: [crestron] Extracting part of a return string

?

There are ways to extract and match strings in SIMPL, especially if they are fixed length or if there is a fixed pattern, which your strings appear to have.
However, the string example you present appear to be too long to handle in SIMPL.
Therefore, you will need to use S+, and doing so will make the job a lot easier.

Lindsay


Re: Extracting part of a return string

 

There are ways to extract and match strings in SIMPL, especially if they are fixed length or if there is a fixed pattern, which your strings appear to have.
However, the string example you present appear to be too long to handle in SIMPL.
Therefore, you will need to use S+, and doing so will make the job a lot easier.

Lindsay


Extracting part of a return string

 

Hi,

I was wondering what the best way in SIMPL was to extract part of a return string to enable another digital signal.?


for example:?
my return varies between states like below: I need to extract; say the ¡®recording¡¯: {¡®state¡¯: ¡®running¡¯ part of the string and that enables a Recording message on my touch panel?
?Preview is state running (Recording is state idle also live)


state={'profile': 'signal-test', 'preview': {'state': 'running', 'status_message': 'Preview is running', 'hls_playlist': '/static/hls/7abb/adaptive.m3u8'}, 'recording': {'state': 'idle', 'status_message': 'Ready to record'}, 'live': {'available': True, 'linked_to_recording': False, 'state': 'idle', 'status_message': 'Ready to start'}, 'paused': False, 'video': [{'type': 'vtestsource', 'name': 'vsource-4c68', 'device': 'blue', 'capture': '1920x1080@25', 'signal': 'fake', 'state': 'running'}, {'type': 'vtestsource', 'name': 'vsource-af64', 'device': 'green', 'capture': '1280x720@25', 'signal': 'fake', 'state': 'running'}]}


- Recording is state running and live is state idle

state={'profile': 'signal-test', 'preview': {'state': 'running', 'status_message': 'Preview is running', 'hls_playlist': '/static/hls/7abb/adaptive.m3u8'}, 'recording': {'state': 'running', 'status_message': 'Recording in progress', 'folder': '/home/ubicast/mediacoder/media/20220208-181139-0d80', 'time_in_sec': 8, 'timecode': '0:00:08'}, 'live': {'available': True, 'linked_to_recording': False, 'state': 'idle', 'status_message': 'Ready to start'}, 'paused': False, 'video': [{'type': 'vtestsource', 'name': 'vsource-4c68', 'device': 'blue', 'capture': '1920x1080@25', 'signal': 'fake', 'state': 'running'}, {'type': 'vtestsource', 'name': 'vsource-af64', 'device': 'green', 'capture': '1280x720@25', 'signal': 'fake', 'state': 'running'}]}


- Live is state running and recording is state idle

state={'profile': 'signal-test', 'preview': {'state': 'running', 'status_message': 'Preview is running', 'hls_playlist': '/static/hls/7abb/adaptive.m3u8'}, 'recording': {'state': 'idle', 'status_message': 'Ready to record'}, 'live': {'available': True, 'linked_to_recording': False, 'state': 'running', 'status_message': 'On Air'}, 'paused': False, 'video': [{'type': 'vtestsource', 'name': 'vsource-4c68', 'device': 'blue', 'capture': '1920x1080@25', 'signal': 'fake', 'state': 'running'}, {'type': 'vtestsource', 'name': 'vsource-af64', 'device': 'green', 'capture': '1280x720@25', 'signal': 'fake', 'state': 'running'}]}


Re: Fusion C#

 

Thank you


Re: Stupid Sonos logs #sonos

 

Sonos is only the tip of the iceberg in regards to bloating the logs...It would at least be great if someone actually knew what half the entries meant??


Re: DM TX 4KZ - Console Commands

 

I guess you are using a non-crestron control system?


Re: ZeeVee Zyper 4K Management Platform.

 

Tray,

I didn't write the Crestron module but we did write drivers for other platforms and they way you are sending the strings pretty closely matches our drivers. We are definitely sending the quotes around the command to send, as advised by ZeeVee. If I recall, once the connection for 232 is opened you can send or receive and then it get closed if you switch away, so you can maintain an rs232 connection, but they we have written it is more of a one and done type thing, much like yours.

rich


DM TX 4KZ - Console Commands

 

Does anyone have a list of console commands for this device? All I really need is the command to switch between HDMI input 1 and input 2 as the transmit source, but any commands available would be appreciated.

TIA,

erik


Re: Crestron Shade Custom Option

 

I have found out that it is possible to power the CSM-QMTDC-163-1-EX motor with a battery pack.? This is not supported by Crestron but it can be done.? The motor draws approximately one watt in standby mode at 24v DC and 43.5 watts during motion.? The manufacturer of the CSF-LLT05 fabric is Turnils in Bufurd, GA.??


HttpsClient => Content-Length issue

 

I am here having an issue with the HttpsClient.
The request runs into an "unknown error" whenever I try to add Content-Length to the header. It runs fine otherwise.
About the sample code below: you can directly copy/paste into VS2008 and load it as a test. I added a console command called "getit" to easily trigger the request.
This sample code works fine as is.?I also added my own custom header "Mycustomheader": "foo" and I do see it included on the response from httbin.org. This tells me that the custom headers do work as intended.
?
However, the moment this line gets uncommented:
//request.Header.SetHeaderValue("Content-Length", payload.Length.ToString());
The whole thing breaks down. And I can't figure out why... any help would be greatly appreciated.




using System;
using Crestron.SimplSharp;? ? ? ? ? ? ? ? ? ? ? ? ? // For Basic SIMPL# Classes
using Crestron.SimplSharpPro;? ? ? ? ? ? ? ? ? ? ? ? // For Basic SIMPL#Pro classes
using Crestron.SimplSharpPro.CrestronThread;? ? ? ? // For Threading
using Crestron.SimplSharpPro.Diagnostics; ? ? // For System Monitor Access
using Crestron.SimplSharpPro.DeviceSupport;? ? ? ? ? // For Generic Device Support
using Crestron.SimplSharp.Net.Https;
?
namespace Simplified_Test
{
? ? public class ControlSystem : CrestronControlSystem
? ? {
? ? ? ? #region Private Fields
? ? ? ? private HttpsClient _httpsClient;
? ? ? ? #endregion
?
? ? ? ? public ControlSystem()
? ? ? ? ? ? : base()
? ? ? ? {
? ? ? ? ? ? try
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Thread.MaxNumberOfUserThreads = 20;
?
? ? ? ? ? ? ? ? //Subscribe to the controller events (System, Program, and Ethernet)
? ? ? ? ? ? ? ? CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(ControlSystem_ControllerProgramEventHandler);
?
? ? ? ? ? ? }
? ? ? ? ? ? catch (Exception e)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? ErrorLog.Error("Error in the constructor: {0}", e.Message);
? ? ? ? ? ? }
? ? ? ? }
?
?
? ? ? ? public override void InitializeSystem()
? ? ? ? {
? ? ? ? ? ? try
? ? ? ? ? ? {
? ? ? ? ? ? ? ? CrestronConsole.AddNewConsoleCommand(ConsoleCommandGetIt, "getit", "sends a GET request to httpbin with a small payload", ConsoleAccessLevelEnum.AccessAdministrator); //for tests
?
? ? ? ? ? ? ? ? _httpsClient = new HttpsClient();
? ? ? ? ? ? ? ? _httpsClient.Accept = "application/json";
? ? ? ? ? ? ? ? _httpsClient.KeepAlive = true;
? ? ? ? ? ? ? ? _httpsClient.Timeout = 20;
?
? ? ? ? ? ? ? ? _httpsClient.HostVerification = false;? ?//set to false for now - to keep things simple
? ? ? ? ? ? ? ? _httpsClient.PeerVerification = false;? ?//set to false for now - to keep things simple
?
? ? ? ? ? ? }
? ? ? ? ? ? catch (Exception e)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? ErrorLog.Error("Error in InitializeSystem: {0}", e.Message);
? ? ? ? ? ? }
? ? ? ? }
?
? ? ? ? #region Creates a request and dispatches it Async
? ? ? ? private void ConsoleCommandGetIt(string cmdParameters)
? ? ? ? {
? ? ? ? ? ? string url = "https://httpbin.org/anything";
? ? ? ? ? ? string payload = "{\"memberId\":123,\"resultId\":1,\"timestamp\":\"2022-02-09T18:18:04.000Z\"}";
? ? ?
?
? ? ? ? ? ? var request = new HttpsClientRequest();
? ? ? ? ? ? request.Url.Parse(url);
? ? ? ? ? ? request.RequestType = RequestType.Get;
? ? ? ? ? ? request.Header.ContentType = "application/json";
? ? ? ? ? ? request.Header.SetHeaderValue("myCustomHeader", "foo"); //adding a custom header just to see if it appears on the far end
? ? ? ? ? ??
?
? ? ? ? ? ? //adding the json payload to the body of this request
? ? ? ? ? ? request.ContentString = payload;
?
? ? ? ? ? ? //trying to add a Content-Length to the header
? ? ? ? ? ? //request.Header.SetHeaderValue("Content-Length", payload.Length.ToString());
? ? ? ? ? ? //CrestronConsole.PrintLine("The request header as built is: " + request.Header.ToString());
?
? ? ? ? ? ? CrestronConsole.PrintLine("The request payload is: " + request.ContentString);
? ? ? ? ? ??
? ? ? ? ? ? //trying to dispatch it async
? ? ? ? ? ? var result = _httpsClient.DispatchAsync(request, httpsClientResponseCallback);
? ? ? ? ? ? if (result > 0)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? CrestronConsole.PrintLine("There was an error with the dispatch async. Error code: " + (HttpsClient.DISPATCHASYNC_ERROR)result);
? ? ? ? ? ? }
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? CrestronConsole.PrintLine("The request has been dispatched. Now waiting for a reply.");
? ? ? ? ? ? }
?
? ? ? ? }
? ? ? ? #endregion
?
? ? ? ? #region Here is the reply from the far end
? ? ? ? private void httpsClientResponseCallback(HttpsClientResponse response, HTTPS_CALLBACK_ERROR error)
? ? ? ? {
? ? ? ? ? ? CrestronConsole.PrintLine("The response for the request returned " + (HTTPS_CALLBACK_ERROR)error);
?
? ? ? ? ? ? if (error > 0) //if this is true, the response object will be null!!! Don't try to further process it.
? ? ? ? ? ? {
? ? ? ? ? ? ? ? CrestronConsole.PrintLine("httpsClientResponseCallback -> HTTPS_CALLBACK_ERROR=" + error);
? ? ? ? ? ? ? ? return;
? ? ? ? ? ? }
?
? ? ? ? ? ? CrestronConsole.PrintLine("The response code was " + response.Code);? ? //In the realword, I should make some logic that will look for a 200 OK and properly manage error codes in a log somehow.
?
? ? ? ? ? ? CrestronConsole.PrintLine("The response Encoding was " + response.Encoding);
? ? ? ? ? ? CrestronConsole.PrintLine("The response ContentLength was " + response.ContentLength);
? ? ? ? ? ? CrestronConsole.PrintLine("The URL of whoever provided this response is " + response.ResponseUrl);
? ? ? ? ? ? CrestronConsole.PrintLine("The response.Header.FirstHeader is: " + response.Header.FirstHeader);? ? ? ?//this seems to always return empty.
? ? ? ? ? ? CrestronConsole.PrintLine("The response.Header.RequestVersion is: " + response.Header.RequestVersion); //this seems to always return empty.
?
? ? ? ? ? ? CrestronConsole.PrintLine("The response.Chunked is " + response.Chunked);
?
? ? ? ? ? ? CrestronConsole.PrintLine("The response entire Header was:\n " + response.Header.ToString());
?
? ? ? ? ? ? CrestronConsole.PrintLine("Here is the actual response body:");
? ? ? ? ? ? CrestronConsole.PrintLine(response.ContentString);
?
? ? ? ? }
? ? ? ? #endregion
?
? ? ? ? #region House Cleaning
? ? ? ? void ControlSystem_ControllerProgramEventHandler(eProgramStatusEventType programStatusEventType)
? ? ? ? {
? ? ? ? ? ? switch (programStatusEventType)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? case (eProgramStatusEventType.Stopping):
? ? ? ? ? ? ? ? ? ? _httpsClient.Dispose();
? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? }
?
? ? ? ? }
? ? ? ? #endregion?
?
?
? ? ? ??
? ? }
}


Re: Samsung MDC Module to configure videowall layout #crestron

 

Hi Shawn

Yes do have the protocall commands in PDF. I was hoping someone had a module built up allready. Did not find what I was looking for on the crestron market place except the basic commands like On/Off, volume, source.

Just being lazy as I don't want make a module from scratch with chksums.




?


Re: Crestron Q-SYS[Core] V5.0 - not staying connected

 

Same here.? Been solid for my work.


Re: Samsung MDC Module to configure videowall layout #crestron

 

Have you used MDC before? If not I can get you started as I have all of the basic commands like On/Off, source selection, Volume up down, Brightness up down, mute. Do you have the MDC protocol PDF yet? I can send this to you if you need and you can easily find the commands for video wall modes on the MDC Protocol PDF.
?
Cheers
Shawn


Stupid Sonos logs #sonos

 

Is there any way to stop these stupid messages appearing in the logs from Sonos.
Debug is off.
Really Crestron - just give us error msgs if something is broken. Do I really need my processor SD card degrading because of this crap!

343. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:11? # Sonos - Multicast discovery started.
344. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:11? # Sonos - The system state changed to "Connecting to Primary Device".
345. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:11? # CRPCConnectionHelper - Created CIP Transport for ipaddress: 192.168.10.4, port: 0, adapterID: 0
346. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:41? # Sonos - Discovery state changed to idle.
347. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:41? # Sonos - Multicast discovery result: devices found.
348. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:41? # Sonos - Discovery result: devices found.
349. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:43? # Sonos - The primary device is changed to Sonos-01.
350. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:43? # Sonos - The primary device(Sonos-01) favorites event subscription state changed to "Not Registered".
351. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:43? # Sonos - The primary device(Sonos-01) group configuration event subscription state changed to "Not Registered".
352. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:43? # Sonos - The system state changed to "Connected to Primary Device".
353. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:43? # Sonos - The primary device(Sonos-01) state is changed to "connecting".
354. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:44? # Sonos - The primary device(Sonos-01) state is changed to "connected".
355. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:44? # Sonos - The system state changed to "Subscribing for Group Configuration Event".
356. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:44? # Sonos - The primary Sonos household was changed to Sonos_vkgVNN43BVRzcGhoRbALjdC2ac.
357. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:44? # Sonos - The system state changed to "Subscribed for Group Configuration Event".
358. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:45? # Sonos - The system state changed to "Subscribed for favorites Event".
359. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:45? # Sonos - The primary device(Sonos-01) favorites event subscription state changed to "Registered".
360. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:45? # Sonos - The system state changed to "Subscribed for Group Configuration Event".
361. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:45? # Sonos - The system state changed to "Subscribed for Group Configuration Event".
362. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:45? # Sonos - The primary device(Sonos-01) group configuration event subscription state changed to "Registered".
363. Notice: splusmanagerapp.exe [App 1] # 2022-02-09 17:39:45? # Sonos - The system state changed to "System Ready".