Ocelot driver questions

HouseBot Plugin Development Discussions.
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Post by Timoh »

Very similar to how I am testing...
But I just noticed something weird... cmax shows my secu16 as module 2, as does HB for my inputs and relay devices.
But the secu-16 module parameter device seems to think it's module number 3. So param 2 in my secu16 is 85, but I need to set the module number to 3 in order to retrieve this parameter. If I set it to module 2, I don't get any parameters back at all.

I adjust that param to 86 and hit set. I then hit get and it flips back to 85.

For the variables, hitting the get button reverts everything to zero. I have a counter + another variable I use in the Ocelot which both show up as zero in HB. I didn't get how to set the variable since I was looking for the "set" button, but then realized I just need to type it in and it will change it in the Ocelot. This works. I set a couple of variables in HB and checked them in cmax and they were there (along with the others I use).

As soon as I hit "Get Variables", they all flip back to zero in HB. But remain set in the Ocelot.

Tim
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Post by Timoh »

I also did a serial port capture... HB does do stuff with the serial port when I perform the actions that don't work. I was hoping to see the strings sent, but for some reason all I get are periods. Maybe unprintable chars?
Line 1-785 is the HB startup
786-1491 Get Param (works)
1492-1505 Set Param (doesn't work)
1506-2226 Get Param (to verify the set param)
2227-2954 Get Var (resets everything to zero/doesn't work)

Maybe it'll be more use to you than me.

Tim
Attachments
serial.zip
(16.06 KiB) Downloaded 253 times
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Timoh wrote:I also did a serial port capture... HB does do stuff with the serial port when I perform the actions that don't work. I was hoping to see the strings sent, but for some reason all I get are periods. Maybe unprintable chars?
Not ASCII. You have to check the 'Show Hex' option in Portmon to see the data.

You an also run a HouseBot Hardware Interface trace to see the data. That might be helpful.

http://www.cebotics.com/phpbb2/viewtopic.php?t=855962
Scott
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Post by Timoh »

Found the possible problem for the params at least...

When we retrieve the params, the module number in HB is offset by +1. I wondered about this in the post on Dec 5th... My secu16 is module 2 in my Ocelot. I never checked to see which module HB thinks it is, but obviously it is module 2 as well. When I read inputs or set relays, I use module 2.

However, with the param device, I need to set the module number to 3 in order to retrieve the params from module 2. If I set it to module 2, I get nothing.

Now for the fun bit...
If I set module 2, param 2 and then issue a get, I get nothing... flips back to 0. However, if I now get module 3, param 2, I get the value I just entered in module 2, param 2. WIth portmon...

#1
Module 3, param 2 write... (Does not work, module 3 does not exist)
0.00027434 HouseBotServer. IRP_MJ_WRITE Serial0 SUCCESS Length 8: C8 21 03 56 02 00 00 44

#2
Module 2, param 2 write... (Works)
0.00029417 HouseBotServer. IRP_MJ_WRITE Serial0 SUCCESS Length 8: C8 21 02 56 02 00 00 43

#3
Module 2, param 2 read (Does not work goes back to zero)
0.00034110 HouseBotServer. IRP_MJ_WRITE Serial0 SUCCESS Length 8: C8 1F 02 00 00 00 00 E9
0.00016678 HouseBotServer. IRP_MJ_WRITE Serial0 SUCCESS Length 8: 2A 00 00 8B B4 00 A4 78

#4
Module 3, param 2 read (Works, get param entered in #2)
0.00037854 HouseBotServer. IRP_MJ_WRITE Serial0 SUCCESS Length 8: C8 1F 02 00 00 00 00 E9
0.00017684 HouseBotServer. IRP_MJ_WRITE Serial0 SUCCESS Length 8: 2A 00 00 8B B4 00 A4 78

I guess since we have retrieve all parameters from all modules and then need to parse them into the correct module, somewhere down the line the data from module 2, is getting dumped into the module 3 section in HB.

Will tackle the vars next week.

Thanks
Tim
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

I think I found the problem on that one. Try this version.
Scott
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Since I had my hands in it, I went ahead and implemented the get/set timers functionality too. After you copy the plugins into their correct directories, you should see a new Timers Device that works pretty much like the variables device.

Download here.
Scott
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Post by Timoh »

The Module Params is perfect now.

The vars still nothing (for the most part), and the timers return all sorts of numbers, but only one of them increments in blocks of 512. The others are numbers I have never seen in my Ocelot.

But I did find a *big* hint to the issue...
My variable 65 in HB is timer 0 in CMAX!

Appdig mentions that the var and timer retrieval commands are essentially memory dumps and subject to change from when they were added to the protocol.

I suspect we might be running different versions of the Ocelot firmware which has the memory space in slightly different locations for timers and variables. That is why it works for you and not for me? But that also means we need to ask the Appdig folks the locations of the variables and timers.

I am running firmware version v8.31/58 in my ocelot.

Tim
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

I'm running V8.23/15. Older but it seems to conform to the spec.
Scott
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Post by Timoh »

The folks over on the appdig confirmed your idea that the command hasn't changed and should work with an older firmware.

I will post serial captures later to see if it helps.

The only thing odd I noticed in the meantime was that after you issue the get var command, the Ocelot echos part of it back. I'm going to double check the logs just to make sure, but does that make sense to you.


Tim
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Timoh wrote:The only thing odd I noticed in the meantime was that after you issue the get var command, the Ocelot echos part of it back. I'm going to double check the logs just to make sure, but does that make sense to you.
It echos back the first six (or so) characters of the command... but I take that into account.

Since you are seeing the value of one type appear as a value of another type, it sounds more like a buffer issue or something. Try JUST requesting the timer data as soon as HouseBot starts to see if you see any different results.

One thing that's odd is that it the API says to read 256 bytes for the timer data. However, there are only 64 timers (2 bytes per timer). Seems like I'm having to read too much, but it seems to work ok.

If you can send me a HouseBot interface trace instead of the PortMon trace, that would be great.
Scott
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Post by Timoh »

Do we have a checklist for tracing?

I tried turning on tracing for my Ocelot device, but didn't get anything. A while back, I recall I changed settings all over the place a while troubleshooting something else and trying to generate specific data I wanted in the logs.

In the process, is it possible that I changed some global tracing settings?

Thanks
Tim
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

There's just the basic instructions found here: http://www.cebotics.com/phpbb2/viewtopic.php?t=855962 plus anything you might find in in online help. This should override anything you may have configured in the trace UI.

After checking the option in the hardware interface, go to the tracing dialog and click the 'advanced' button. Then scroll down to the name of your hardware interface (with an asterisk in front of it), and make sure 'file' is checked with a file name in the edit field.
Scott
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Post by Timoh »

Strange....

I hit the get variables button and no data was returned.~9:18pm


I exited HB and loaded cmax and did a screen grab of the variables and timers.

I entered data into 4 timers and exited cmax.

I restarted HB and hit get variables. ~9:26:31. My variables where not there, but again my timers where in positions 65+. This was the first I observed this this evening, but it was also the first time I had loaded cmax this evening.

Anything prior to 9:26 was not done by user interaction. So the stuff in 9:25 was logged/performed automatically when HB started.

In looking at the log, it looks like HB captured the some of the activity on the serial port that I did in cmax, but with a delay because the values are incremented by the time it took me to exit cmax and load HB.

I might agree that it is a buffereing issue... Why would HB log the commands I sent in cmax? And something funky in the buffer on the read backs.

Tim
Attachments
Ocevar.zip
(906 Bytes) Downloaded 234 times
ocevar.JPG
ocevar.JPG (29.61 KiB) Viewed 4743 times
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

HouseBot isn't seeing the interaction between CMax and the Ocelot. What you are seeing there is some setup that is being done when the plugin is initialized (sets some parameters (auto X10, auto IR, auto IO) and gets a dump of the real time data buffer).

The trace does seem to show the data returned as you describe.

Is this the same with your C-Max: ?
Version=2.00e
#Variable registers=128 (0-127)
#Timer registers=64 (0-63)

Also, if you go back into C-Max again, is the Timer data you set still in the timer registers there, or did it move into the variables?
Scott
Timoh
Advanced Member
Posts: 260
Joined: Thu Feb 02, 2006 12:56 pm
Location: Montreal - Canada

Post by Timoh »

I'll double check tonight, but I am fairly certain that my timer variable stays put. i.e. it does not move to the variable section.

I think seeing some timers in the variable positions 65+ might also be related getting a dump of the realtime buffer.

If we think it's really some funkiness on the Ocelot side I will keep plugging away over on their board too.

Tim
Post Reply