¿ªÔÆÌåÓý

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

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


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

 

I also use?Mathew Klucznyk's modules. They are amazing.


CK iPlayer 3 SD card failure

 

Not crestron directly, but it's controlled by Crestron.
I've got an CK iPlayer 3 by Phillips that the SD card has died and is unrecovreable.??
Does anyone have one of these they can grab the file structure of the SD card so I can rebuild the system.? I can't boot the device to reload a show without a working SD card file system..
Their support has been less than helpful so far


Re: Simpl+ Analog_Input vs Long_Integer

 

Hi Brad,

The point that's being made is... signals is SIMPL **CANNOT** hold a value beyond the range 0 (all 16 bits off) to 65535 (all 16 bits on).? The value isn't being "converted", it's being "truncated".
The full picture is that there is a way of looking at that 0-65535 range as a signed value where any value over 32767 represents the negative values -32768 to -1, but you're still stuck with 16 bits, and I don't think you want signed here anyway.

In your code, you'll NEVER see a value of < 0, because -1 is actually POSITIVE 65535, and you have exactly "1 chance in 65536" of going above 65534.
If you enter the value 65537, you're actually entering a 1.

Crestron software may allow you to enter values outside of the 16 bit range, but they will immediately be truncated.

If you're trying to check for values between 1 and 65534, your test should be < 1, rather than < 0.

Hope that helps,
Oliver


Re: Weather widget on xx52 touch panels

 

I found the issue and it is confirmed with Crestron. You must initialize the panel first before sending the VTZ because the zip gets stuck in the panels bios from the first load the panel gets.


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

 

I no longer use the Crestron version but using Mathew Klucznyk version. He created these modules due to the issue of disconnecting from Core. We have been stable for the last 2 months, whereas using Crestron's version were disconnecting within 30 minutes of bootup and TB wasn't able to figure out the issue.


Re: Simpl+ Analog_Input vs Long_Integer

 

I'm not needing a larger number but 0-65534 but any value outside of that range is entered I am not getting an error but a conversion that still saves that value.

#DEFINE_CONSTANT maxLevels 65534

Change AudioLevel
{
x = GetLastModifiedArrayIndex();
if((AudioLevel[x] < 0) || (AudioLevel[x] > 65534))? ??
{
? ? ? ? ? ?makestring(Error$, "Audio Levels are from 1 to %u", maxLevels);
}? ??
Else
{
? ? Busy = 1;
AudioLevelFb[x] = AudioLevel[x];
AudioLevelFbTemp[x] = AudioLevelFb[x];
Busy = 0;
}
}
?


Re: Weather widget on xx52 touch panels

 

I did go round and round with Tech support but in the end they weren't much help BUT what I did discover was this:
? I created a test project and just loaded that with all defaults (left crestron as default location) and it still came up with the rouge location. No matter what I did (changing DNS, everything) no change. I initilized and restored the panel and tried again, this time it stuck so I believe some how a location gets stuck in the panels bios or something and by restoring it and loading a test page and then your project seems to set the correct location? very odd.