Premise Newbie issues

Motorola Premise
I doubt Damon would have released a drive if it had such a serious bug, so I wouldn't think its an Integra communication problem.
I have Damon's Integra driver from the old forum days; I'll see if I can dig it up and post it.

I doubt it also, maybe the receivers are just a little bit different than the older ones or we are overlooking something.
I am using this driver from the Premise forum (integra_serial_v2.xdo) I did not read any complaints on the old forum
about it not working right after a reboot. There was a older version also (modintegra.xdo)
 
I'm on travel this week and can't play with premise :-( However, the problem is not the integra driver. Create a simple generic serial device under devices by adding a custom device. You will see that two way communication works without any code, only by changing the end of line 1A and the port parameters. However, when you reboot, there is no two way communication?

When I get home I will try making a simple generic serial device using the custom device wizard for my hd-xa2 dvd player. I think by testing and verifying this works on several other devices using three wire serial communication, we will know if it's an Onkyo issue.

PS: I posted the onkyo documentation a few posts back (updated in 2007 I think) and the commands/protocol look the same. It's also on avsforum if you search on there. I'll give Onkyo a call though, maybe there is some nuance that has changed in the new models. Mine was built in Japan in 2007.

This is confusing since I have 3 different devices running 2-way serial comm without issue. I reboot and restart services relatively often.

So if it is a bug, it is not in general rs-232 comms, it seems.

I am sure that Premise can do two-way serial control with no problem, people would have been screaming on the forums if there was a problem.
I also don't believe Damon wrote a bad driver, I am thinking maybe there is some minor difference in how the newer receivers work versus the older models when the driver was written or it is just us not setting it up right. I think my Onkyo is most closely related to an Integra 7.7 receiver and the driver was written for the 5.3 model so something may have changed.
 
So, msense works great now :) The whole time my secondary hard drive was going bad!

Anyways, how does everyone handle the whole input naming issue? What I did was change the "display name" attribute of the input object to change how it is displayed in the gui. For Input1, I label this as HTPC.

I'm also hoping someone could point me in the right direction on how to handle zones with an audio/video receiver in msense? What I want to do is use the integra zone2 commands to control the zone2 output of my receiver. This involves setting up stereo speakers in the other room, but my issue is how do I tell premise that the receiver is multizone so that I can use msense to manage the second zone? I'm completely lost on where to start...

At any rate, thanks for all of your support thus far in getting me started with premise ;-)
I did a pseudo test and may have missed a few things...I have a Pioneer IR Receiver...(until I can win an Integra on eBay)...It doesn't have a 2nd zone, per se, but it has this funky mode where you can listen to audio from one source while watching video/audio on another. So I mSensed it. I had to manually put it into the funky mode, but once I did, I could control it as though it was a second zone. I could join the main zone, and control it from its own zone. The only odd thing I experienced is how you set it up in builder. You need to put the sources from the main zone as available in the 2nd zone. If you use the receiver as the 'source', you'll get a recursive error (the red screen of death!). I then used the media shortcuts (comcast, etc) and was able to change the content in the 2nd zone. Once I get that sweet Integra, I'll give you the full details ;)
 
I have an ELK M1 driver (a Module) ... its design is probably similar to your Onkyo driver. OnChangeOnNewData monitors the RxTextLine buffer for incoming data.
OnChangeOnInit contains only two lines:
Code:
'OnChangeInit is used for any device or COM port initialization code 
this.RxPurgeAll = true	' purges the receive buffers
this.RxNextLine = true	' requests the next line of data from the serial port

I tried controlling my receiver with a remote control to verify Premise was not responding to received commands, I then changed the RXTextBufferLines from 64 to 80 and then tried using the remote control again, Premise updated to reflect the changes I made with the remote control after that. I guess something is causing the Receive buffer to corupt, overload or something but it worked after that.
IntegraDriver.jpg
 
Thanks Wayne,

This is very good news! I'm pretty sure I tried the rxpurgeall before to fix it, but I never tried just modifying the length! Did you implement code similar to 123's in order to modify the rx buffer length automatically? This code would go under "OnChangeOnInit" right? Just change buffer length from 60 to 80 or vice versa every other time you restart premise. I'm thinking an if then else statement would do this. Too bad I'm not at home to try this out. You can bet this weekend, I will be setting up the GC-100 and making a more permanent custom Onkyo driver.

Thanks again everyone for their help on this :)


I have an ELK M1 driver (a Module) ... its design is probably similar to your Onkyo driver. OnChangeOnNewData monitors the RxTextLine buffer for incoming data.
OnChangeOnInit contains only two lines:
Code:
'OnChangeInit is used for any device or COM port initialization code 
this.RxPurgeAll = true	' purges the receive buffers
this.RxNextLine = true	' requests the next line of data from the serial port

I tried controlling my receiver with a remote control to verify Premise was not responding to received commands, I then changed the RXTextBufferLines from 64 to 80 and then tried using the remote control again, Premise updated to reflect the changes I made with the remote control after that. I guess something is causing the Receive buffer to corupt, overload or something but it worked after that.
IntegraDriver.jpg
 
Thanks Wayne,

This is very good news! I'm pretty sure I tried the rxpurgeall before to fix it, but I never tried just modifying the length! Did you implement code similar to 123's in order to modify the rx buffer length automatically? This code would go under "OnChangeOnInit" right? Just change buffer length from 60 to 80 or vice versa every other time you restart premise. I'm thinking an if then else statement would do this. Too bad I'm not at home to try this out. You can bet this weekend, I will be setting up the GC-100 and making a more permanent custom Onkyo driver.

Thanks again everyone for their help on this :)

I believe that I tried setting the RXPurgeAll to true first and it still did not work, I then just changed the value of the RXBufferLines to 80 right at the spot I marked with the red arrow.

I think adding 123's code might fix the problem but I did not try that yet. I am trying to lock down my Premise server with a write filter so if anything screws up, all I have to do is restart the computer and everything will be back to normal. Doing this means all disk writes are to ram so I am watching to see if it runs out of memory, for this reason I am trying not to shut down the server again if I don't have to. I did this on a In-wall touchscreen PC that boots off of a Compact Flash card, it has run flawlessly for over a year now. Once I have sorted out the Server, or it crashes I will try adding the code from 123's post to see if it will fix the problem.
 
Wayne, this sounds like a very useful way to debug the problem, much easier than what I was doing. If you don't mind me asking what's a good program/tool for write protecting?
 
I learned about it from this thread on a the MP3car forum.
http://www.mp3car.com/vbulletin/winnt-base...ular-winxp.html
The Ehanced Write Filter used to be in the shared computer toolkit, I believe it has been
replaced by Steady State. It is also part of XP embedded.

Once I get everything working the way I want it I will clone the Hard drive to an industrial grade Solid State Disk.
I do this to get as close to a Home Automation Controller Appliance as I can.
 
thanks, looks pretty useful to me. I know when I installed a samsung ssd on my laptop (UMPC) it booted a lot faster. I just wish it had better battery life. Is there a windows based web device that has great battery life that would work well with premise? anyone used windows CE with premise? do you get all the same premise client features as with internet explorer on a pc?
 
thanks, looks pretty useful to me. I know when I installed a samsung ssd on my laptop (UMPC) it booted a lot faster. I just wish it had better battery life. Is there a windows based web device that has great battery life that would work well with premise? anyone used windows CE with premise? do you get all the same premise client features as with internet explorer on a pc?

I think you need Windows 98-Vista and Internet Explorer to get all the features, I know my pocket PC does not give me everything that Windows does.
I tried playing around with Linux and wine running Internet Explorer before but I never got it to work with Premise.
 
Thanks Wayne,

This is very good news! I'm pretty sure I tried the rxpurgeall before to fix it, but I never tried just modifying the length! Did you implement code similar to 123's in order to modify the rx buffer length automatically? This code would go under "OnChangeOnInit" right? Just change buffer length from 60 to 80 or vice versa every other time you restart premise. I'm thinking an if then else statement would do this. Too bad I'm not at home to try this out. You can bet this weekend, I will be setting up the GC-100 and making a more permanent custom Onkyo driver.

Thanks again everyone for their help on this :)


I shut down my server and tried this again and it didn't do anything this time, I guess it was a fluke.
I am going to try adding in 123's code to the driver and see if that works.

-------------------------------------------------------------------------------------------------------------------


I added 123's code to the Integra driver but it still stops working two-way after a reboot.
I tried changing the RxTextLineTerminators property from 1A to 1B set the text buffer lines to 80 again and then set the RxTextLineTerminators property back to 1A and I regained two-way again. Maybe I did this last time but forgot that I messed with it.
 
etc6849,

If I understand the serial Configuration properties correctly:
RxTextLineTerminators indicates the "end-of-message" terminator(s) for text-based (ASCII) data. Default values are: 0D 0A 00 (CR LF NULL).
RxTextBufferLines indicates the number of lines of text-based data that will be buffered. Default value is 60.

Based on the default values, Premise will buffer sixty lines ("text strings") of incoming data where each line is terminated by a CR, LF, or NULL character. I don't know why you are losing 2-way comms upon reboot, but I'd be surprised if RxTextBufferLines is the culprit. It doesn't mean it ain't so ... just that I'd be surprised. :)

You indicated "The only way I can get 2 way communication again is to remove the device, then re add it". I believe the clue lies in what happens when the device driver is first installed. What happens initially that may not be happening when Premise is restarted and this is what leads to the comms failure.

I'm going to state the obvious here: Losing the ability to receive data from the Onkyo indicates that Premise may have, after rebooting, re-initialized its serial port configuration parameters to default values that are incompatible with your requirements. Compare all serial configuration properties before and after a reboot and ensure they are identical. Maybe one of them doesn't survive the reboot (i.e. it is not "Persistent") and reverts to an undesired default value.

If all it takes to correct the problem is a 'magic spell' (i.e. twiddling the RxTextBufferLines property causes something internally to be snapped to attention), you can add the spell into OnChangeOnInit so it'll be issued upon driver initialization.
Code:
' Twiddle RxTextBufferLines because it appears to fix a 2-way comms problem
this.RxTextBufferLines=60
this.RxTextBufferLines=80
this.RxTextBufferLines=60

You may also want to have a look at the code in the Home Electronics IRA driver. I paid special attention to ensuring the driver could re-establish communciations if the IRA3 was disconnected/re-connected ... and I've confirmed it continues to work correctly (2-way) after Premise is rebooted. The primary difference is that communcations is binary and not text mode.

The IRA3 driver uses a watchdog timer to periodically 'ping' the IRA3 device (and it expects a response within a few seconds). The 'ping' (send "I", pause, send "R") must also be issued upon driver initialization (OnChangeOnInit) to establish proper communciations with the IRA3.

Here are the relevant lines of code:
ClassConstructor
Code:
' Configure serial communication parameters
this.Baud 	= "9600"
this.Parity = "None"
this.StopBits = 0
this.CTS 	= false
this.DSR 	= false 
this.RxMode = false
' Create a Serial Command object to transmit data to the M1
set oTmp = this.CreateObject("sys://Schema/Device/Serial/Command","OutCommand")
' Hide the Serial Command object
oTmp.SetValue "Flags", 2
' Communications are in binary mode so do not append CR or LF
oTmp.AppendCR = false
oTmp.AppendLF = false
' Pause between transmitted commands (milliseconds)
oTmp.WaitTime = 200

OnChangeOnInit
Code:
this.RxPurgeAll = true	' Purge the receive buffers
this.RxNextLine = true	' May not be necessary for binary communications
this.PollIRA	' Query the IRA device

I also monitor the serial port's state using OnChangePortStatus. A serial port can have four states:
  1. Opening
  2. Opened
  3. Closing
  4. Closed
The IRA3 driver is only interested in the Opened and Closed states (create/delete watchdog timers).
OnChangePortStatus
Code:
if InStr(1, sysevent.newVal, "Opened", 1) then
	this.CreatePollingTimer
elseif InStr(1, sysevent.newVal, "Closed", 1) then
	this.DeleteTimeOutTimer
	this.DeletePollingTimer
end if
 
I found I can regain two-way by changing RxTextLineTerminators property from 1A to 1B and then back again and it starts working again, yesterday when I changed the RxLinebuffers the first time I watched Premise status change on some properties immediately after I did that. Today I changed RxTextLineTerminators property from 1A to 1B and back again multiple times after a reboot and it regained two-way communication everytime. I am sure there is nothing special about the property I changed it to (1B) other than when I set it back it reset the driver.

So I think I will try adding this based upon your sugestions to the OnChangeOnInit.
------------------------------------------------------------------------------------------------------

' Twiddle RxTextLineTerminators because it appears to fix a 2-way comms problem
this.RxTextLineTerminators=1A
this.RxTextLineTerminators=1B
this.RxTextLineTerminators=1A
-----------------------------------------------------------------------------------------------------

Thanks for all the help.
 
Is it cured by the action of changing the RxTextLineTerminator property (i.e. temporarily changing it from 1A to ZZ would be equally valid) or are both 1A and 1B valid terminators just not used consistently during communications?

I can't recall if RxTextLineTerminators lists all valid terminators (i.e. CR or LF or NULL) or the combination of characters that form a single legal terminator (i.e. CR and LF and NULL).

If RxTextLineTerminators does list all valid terminators, then you can try setting it to "1A 1B". Maybe that'll work in lieu of the 'twiddling' solution. But if this modification breaks all communications with the receiver (2-way and 1-way) then it means RxTextLineTerminators defines a single legal terminator (i.e. AND not OR).
 
Back
Top