Keyboard Shortcuts
Likes
- Crestron
- Messages
Search
Re: newtonsoft question
You bet! Glad it worked!
toggle quoted message
Show quoted text
Caleb Radecky | Manager, Online Products & Services Crestron Silver Certified Programmer | DMC-D-4K | DMC-E-4K ControlWorks Consulting, LLC | Crestron Services Provider | 8228 Mayfield Rd. #6B Rear Cleveland OH 44026 Direct: (+1)440.771.4809 | Cleveland: (+1)440.449.1100 | Boston: (+1)508.695.0188 | DC: (+1)202.381.9070 | London: (+44) 20 4520 4600 -----Original Message-----
From: [email protected] <[email protected]> On Behalf Of jbasen via groups.io Sent: Sunday, May 18, 2025 22:07 To: [email protected] Subject: Re: [crestron] newtonsoft question It works great.? Thanks again Jay On 5/18/2025 3:23 PM, jbasen via groups.io wrote: Thanks Caleb! |
Re: newtonsoft question
It works great.? Thanks again
toggle quoted message
Show quoted text
Jay On 5/18/2025 3:23 PM, jbasen via groups.io wrote:
Thanks Caleb! |
Re: newtonsoft question
Thanks Caleb!
toggle quoted message
Show quoted text
I'll give that a try. Jay On 5/18/2025 3:20 PM, Caleb Radecky via groups.io wrote:
JsonSerializerSettings settings = new JsonSerializerSettings |
Re: newtonsoft question
JsonSerializerSettings settings = new JsonSerializerSettings
toggle quoted message
Show quoted text
{ NullValueHandling = NullValueHandling.Ignore }; string json = JsonConvert.SerializeObject(account, settings); Console.WriteLine(json); Caleb Radecky | Manager, Online Products & Services Crestron Silver Certified Programmer | DMC-D-4K | DMC-E-4K ControlWorks Consulting, LLC | Crestron Services Provider | 8228 Mayfield Rd. #6B Rear Cleveland OH 44026 Direct: (+1)440.771.4809 | Cleveland: (+1)440.449.1100 | Boston: (+1)508.695.0188 | DC: (+1)202.381.9070 | London: (+44) 20 4520 4600 -----Original Message-----
From: [email protected] <[email protected]> On Behalf Of jbasen via groups.io Sent: Sunday, May 18, 2025 16:37 To: [email protected] Subject: [crestron] newtonsoft question Is there a way to not serialize a property in an object that is not initialized.? Something like the [JsonIgnore] but I want to include the property if I set a value for it and leave it out of the serialization if it isn't set.? For example, public class Account { ??? public string FullName { get; set; } ??? public string EmailAddress { get; set; } ??? [Something like JsonIgnore] ??? public string PasswordHash { get; set; } } Then Account account = new Account { ??? FullName = "Joe User", ??? EmailAddress = "joe@...", ??? PasswordHash = "VHdlZXQgJ1F1aWNrc2lsdmVyJyB0byBASmFtZXNOSw==" }; string json = JsonConvert.SerializeObject(account); Console.WriteLine(json); // {"FullName":"Joe User","EmailAddress":"joe@...","PasswordHash":"VHdlZXQgJ1F1aWNrc2lsdmVyJyB0byBASmFtZXNOSw=="} However in the case where PsswordHash isn't initialized with a value Account account = new Account { ??? FullName = "Joe User", ??? EmailAddress = "joe@...", }; string json = JsonConvert.SerializeObject(account); Console.WriteLine(json); // {"FullName":"Joe User","EmailAddress":"joe@..."} So again, when PasswordHash isn't initialized it doesn't get included in the JSON at all. Thanks in advance for the help Jay |
newtonsoft question
Is there a way to not serialize a property in an object that is not initialized.? Something like the [JsonIgnore] but I want to include the property if I set a value for it and leave it out of the serialization if it isn't set.? For example,
public class Account { ??? public string FullName { get; set; } ??? public string EmailAddress { get; set; } ??? [Something like JsonIgnore] ??? public string PasswordHash { get; set; } } Then Account account = new Account { ??? FullName = "Joe User", ??? EmailAddress = "joe@...", ??? PasswordHash = "VHdlZXQgJ1F1aWNrc2lsdmVyJyB0byBASmFtZXNOSw==" }; string json = JsonConvert.SerializeObject(account); Console.WriteLine(json); // {"FullName":"Joe User","EmailAddress":"joe@...","PasswordHash":"VHdlZXQgJ1F1aWNrc2lsdmVyJyB0byBASmFtZXNOSw=="} However in the case where PsswordHash isn't initialized with a value Account account = new Account { ??? FullName = "Joe User", ??? EmailAddress = "joe@...", }; string json = JsonConvert.SerializeObject(account); Console.WriteLine(json); // {"FullName":"Joe User","EmailAddress":"joe@..."} So again, when PasswordHash isn't initialized it doesn't get included in the JSON at all. Thanks in advance for the help Jay |
Re: TSR Performance issues
I have had all types of issues with the later versions of TSR310 firmware.? So much so that I now only use v2.001.0134 firmware on all my installations.
?
For sluggish response, I have found the TSR310 cannot handle lots of network chatter.? Too much chatter and the TSR-310 becomes non responsive.? A good test is to ssh in the TSR-310 and try issuing a few simply console commands.? If it takes a long time for the TSR310 to respond (more than several seconds), it is probably because of network chatter.
?
If you use Ubiquiti APs, there is a a setting in Unifi where to you can force any TSR-310 to connect to a particular AP even though there are many other AP around using the same SSID.? Fixes the issue with the TSR-310 trying to connect to a weaker AP. |
Shared Gateway
So I just tried to add a third IP table entry to my CEN-GWEXER thru TBx/System Info and found that It wouldn't let me.
This begs the question:
- How many entries are actually allowed?
- How would a mere mortal find out info like that?
?
I'm also wondering the same about the new CEN-GW1...
?
Any ideas?
?
I'm going to try adding thru console... |
TSR Wifi performance - Ping Test
Hi All,
We have a site where the TSRs are seemingly sluggish and sometimes won't populate SubPages (This is a custom system)
Here's an example of some pings that are consistent with 3-4 TSRs of varying vintage, all with the latest v3.0.10 FW
?
ping 10.32.101.94
Pinging Host 10.32.101.94 Reply from 10.32.101.94: Echo size=32 time=67ms TTL=63 Reply from 10.32.101.94: Echo size=32 time=3ms TTL=63 Reply from 10.32.101.94: Echo size=32 time=108ms TTL=63 Reply from 10.32.101.94: Echo size=32 time=25ms TTL=63 PRO3>ping 10.32.101.94 Pinging Host 10.32.101.94 Reply from 10.32.101.94: Echo size=32 time=99ms TTL=63 Reply from 10.32.101.94: Echo size=32 time=16ms TTL=63 Reply from 10.32.101.94: Echo size=32 time=35ms TTL=63 Reply from 10.32.101.94: Echo size=32 time=3ms TTL=63 ?
Does this seem normal for Wifi TSRs?
Hard-wired devices GW1, TSW, etc. ping out at 1-4ms consistently...
TIA!
|
Re: Quotes are being added around a Serial String
I don't write Simpl+, so I am unsure as to what would be needed for that,? but if I had to take a stab at making a minimum number of changes to fix your serialization issue with the http request this is what I would do.? I am making some assumptions because I have not worked with this specific hardware before. namespace Crestron_WLED { ? ? // Crestron prefixed structs for use in SIMPL+, since no bool available ? ? public struct CrestronWLEDState //I would leave all of this be because I am assuming it has something to do with the Simpl+ and we don't need to necessarily modify all of that. ? ? { ? ? ? ? public ushort on; ? ? ? ? public ushort bri; ? ? ? ? public ushort transition; ? ? ? ? public CrestronWLEDSegment[] seg; ? ? } ? ? public struct CrestronWLEDSegment?//Same as above,? let it come in as it has so we don't break anything. ? ? { ? ? ? ? public string col; ? ? ? ? public ushort bri; ? ? ? ? public ushort fx; ? ? ? ? public ushort sx; ? ? ? ? public ushort ix; ? ? } ? ? public struct WLEDState ? ? { ? ? ? ? public bool on; ? ? ? ? public ushort bri; ? ? ? ? public ushort transition; ? ? ? ? public WLEDSegment[] seg; //Notice that the object that we are serializing below is the WLEDState and the col that we are looking for is the WLEDSegment ? ? ? ? public WLEDState(ref CrestronWLEDState crestronState) ? ? ? ? { ? ? ? ? ? ? on = crestronState.on > 0; ? ? ? ? ? ? bri = crestronState.bri; ? ? ? ? ? ? transition = crestronState.transition; ? ? ? ? ? ? if (crestronState.seg.Length == 0) ? ? ? ? ? ? { ? ? ? ? ? ? ? ? seg = new WLEDSegment[1]; ? ? ? ? ? ? } ? ? ? ? ? ? else ? ? ? ? ? ? { ? ? ? ? ? ? ? ? seg = new WLEDSegment[crestronState.seg.Length]; ? ? ? ? ? ? ? ? for (int i = 0; i < crestronState.seg.Length; i++) ? ? ? ? ? ? ? ? { ? ? ? ? ? ? ? ? ? ? seg[i] = new WLEDSegment(ref crestronState.seg[i]); ? ? ? ? ? ? ? ? } ? ? ? ? ? ? } ? ? ? ? } ? ? ? ? public string ToJson() ? ? ? ? { ? ? ? ? ? ? return JsonConvert.SerializeObject(this); //Notice that this object (WLEDSegment) is being serialized.? This object is what we need to make the change to.? I assume that the endpoint has now changed and instead of accepting a string it wants the object now. ? ? ? ? } ? ? } ? ? public struct WLEDSegment ? ? { ? ? ? ? public List<int[]> col; //Changing this from string to list of int[] give us?[[128,128,128]] instead of "[[128,128,128]]". I? assume this value will never be null,? and contains an array of numbers similar to the example.? This may?need to be nullable depending on the .net version and possible values.? ? ? ? ? public ushort bri; ? ? ? ? public ushort fx; ? ? ? ? public ushort sx; ? ? ? ? public ushort ix; ? ? ? ? public WLEDSegment(ref CrestronWLEDSegment crestronSegment) ? ? ? ? { ? ? ? ? ? ? col = JsonConvert.DeserializeObject<List<int[]>>(crestronSegment.col); //So this is where we make our change.? I am assuming that the string with the proper object is made here as the CrestronWLEDSegment,? we would want to deserialize the string to an object here ? ? ? ? ? ? bri = crestronSegment.bri; ? ? ? ? ? ? fx = crestronSegment.fx; ? ? ? ? ? ? sx = crestronSegment.sx; ? ? ? ? ? ? ix = crestronSegment.ix; ? ? ? ? } ? ? } ? ? public class WLEDStructHelper ? ? { ? ? ? ? public int InitStateStruct(ref CrestronWLEDState state, ushort numberOfSegments) ? ? ? ? { ? ? ? ? ? ? state.seg = new CrestronWLEDSegment[numberOfSegments]; ? ? ? ? ? ? return 0; ? ? ? ? } ? ? } } I can't guarantee that it works,? but that is my best guess based on the description.? Hope it helps. -Jordan On Fri, May 16, 2025 at 8:43?AM jaevans via <jaevans=[email protected]> wrote:
|
Re: Quotes are being added around a Serial String
public WLEDSegment[] seg;?<--This is actually an array of WLEDSegment,? but in json it will look like a list.? so your col may be an array of arrays.? When you serialize the object you will not be able to tell the difference. Sorry for the confusion. -Jordan On Fri, May 16, 2025 at 9:32?PM Jordan Elasky via <elaskyj=[email protected]> wrote:
|
Re: Quotes are being added around a Serial String
? ?? Looking at your serialized object?{"on":true,"bri":0,"transition":0,"seg":[{"col":"[[128,128,128]]","bri":50,"fx":0,"sx":0,"ix":0}]} <-- Notice quotes are only added?to strings and property names. public struct CrestronWLEDSegment ? ? { ? ? ? ? public string col; <--This tells us that the col in your seg is a string.? When serialized it will contain quotes to show that it is a string. ? ? ? ? public ushort bri; ? ? ? ? public ushort fx; ? ? ? ? public ushort sx; ? ? ? ? public ushort ix; ? ? } ? ? public struct WLEDState ? ? { ? ? ? ? public bool on; ? ? ? ? public ushort bri; ? ? ? ? public ushort transition; ? ? ? ? public WLEDSegment[] seg; <--This is a list of object type WLEDSegment,? This will not add quotes because it is a list. To fix your issue you would need "public string col" to be "public list<list<ushort>> col" and you would assign the proper object type to the property rather than a string. (I am guessing that it is ushort because it?is crestron,? but when serialized you won't be able to tell the difference unless it is out of the range.) -Jordan On Fri, May 16, 2025 at 8:43?AM jaevans via <jaevans=[email protected]> wrote:
|
Re: TSR Performance issues
Follow-up.
I spoke with an inside Crestron rep in charge of Support and was told that there is no known issue as described currently.
So this seems to be something that my guy was told, likely by another dealer who was told this from a TS person. It was either wrong or mis-understood.? So it seems that this is not an issue to worry about for now...
? |
Sony K55S30 Displays
Good afternoon.? I am controlling these displays via RS232.? Everything seems to be working as I would think with the exception of the "enter" button.? We are using the built-in tuner for CATV.? I can change the channel using channel up and down but putting in a channel number and hitting enter to change the channel, that is the part is not working. |
Re: TSR Performance issues
?
Support.Crestron.com -> Resources & Tools -> Known Issues
?
There is not a specific known issue for a blanket TSR issue. It could be related to other functions. Please let me know who at Crestron provided the statement that it is a known issue and you need to roll the firmware back. |
Re: TSR Performance issues
I can't tell anymore if the issues are firmware related or just bad, underpowered hardware with a cheap Wi-Fi chip.
?
We've started to just use the HR-310's for video rooms now.? Can't recommend the TSR's anymore and sleep at night.
?
I wholeheartedly agree!
Crestron ... when we are logged into the main website, can we please get a banner or quick link to a list of identified issues?
or ... They already have a community site where we can subscribe to articles to be notified when an update occurs.? So, just create a "sticky topic" for known issues and bugs.? Then we can get a notification when something is identified.
It happens over and over again, where we call tech support, and after 20 minutes, someone responds with "It's a known issue."
For once, let's save some time and money! |
Re: Lutron RadioRA 3 Processor not connecting
¿ªÔÆÌåÓýUnless they¡¯re using broadcast or multicast you kind of have to work to make a device not support cross-subnet/cross-VLAN routing (assuming that the network has been configured to allow that route and not block it ? Lincoln -- Lincoln King-Cliby Commercial Market Director ? ? ? From: [email protected] <[email protected]>
On Behalf Of johnh via groups.io
Sent: Friday, May 16, 2025 8:52 AM To: [email protected] Subject: Re: [crestron] Lutron RadioRA 3 Processor not connecting ? On Thu, May 15, 2025 at 08:54 PM, j5races wrote:
Where are you seeing this in Lutron Designer? I dont have the OP's issue but curious on what youre talking about. I just popped open to my open Designer window and dont see anything related to VLAN. Which would reall surprise me given how difficult Lutron software can be when it comes to networking. I would doubt they'd support that.? |
Re: NewtonSoft Problem
¿ªÔÆÌåÓýThanks Oliver.? The first thing I tried was using a JsonProperty statement but I couldn't get it to work.? Fortunately, just changing the class name did. Thanks Jay On 5/16/2025 2:06 AM, Oliver Hall via
groups.io wrote:
|