Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SNMP Driver
#31
Wow, you guys have been busy...

The Statictable thing looks like a bug, I duplicated it with another table on one of my devices. I think it has something to do with you using a 1 digit index. I don't usually use the actual table index and instead use something more meaningful, like the description out of the table. So i'll see what I can do there.

The not doing an initial poll on startup, I have seen before, and I tried to squash it the 1.4 version, but I couldn't duplicate it. It doesn't happen in the test harness for some reason. I did put in some extra logging to try to catch it in 1.4. I'll work on that one too.

CQC doesn't throw any errors when it can't create a field due to bad Limits, so if you find you have no fields, that means that something is invalid with your Limit syntax on one of your fields. I pass that string straight to CQC with no changes and no validation. Since no exception occurs the driver will go along fat dumb and happy with no fields to poll.

Also, it is probably not a good idea to leave valid options out of your limits as you have no control over what the device will put there. So if it returns a response and your limits can't handle it, you'll get an error. It's ok to leave out stuff in the XLAT though, as that just replaces a value if it sees it and doesn't do anything to values that aren't in the list.

So Mick, what is probably happening in your case is the switch is returning something besides a 1, or 2, and it passes through the XLAT then CQC coughs up an exception because it doesn't fit within the limits you have set. If you just leave the limits off you should see what that value is.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#32
wuench Wrote:The Statictable thing looks like a bug, I duplicated it with another table on one of my devices. I think it has something to do with you using a 1 digit index. I don't usually use the actual table index and instead use something more meaningful, like the description out of the table. So i'll see what I can do there.

The not doing an initial poll on startup, I have seen before, and I tried to squash it the 1.4 version, but I couldn't duplicate it. It doesn't happen in the test harness for some reason. I did put in some extra logging to try to catch it in 1.4. I'll work on that one too.
Waiting with minnows under my tongue ("bated breath", get it, huh, huh?)

Quote:Also, it is probably not a good idea to leave valid options out of your limits as you have no control over what the device will put there. So if it returns a response and your limits can't handle it, you'll get an error. It's ok to leave out stuff in the XLAT though, as that just replaces a value if it sees it and doesn't do anything to values that aren't in the list.

Knowing your device may come into play here. For example, the MIB supports a 5 and 6 on Outlet control, which is something like a delayed off. This requires a 2.x firmware in a 9211 or 9216 or what have you, and is not supported in 1.x in the 9210 (which AFAIK is not upgradable). So, to avoid having an unspecting user (that would be me when I've forgotten in six months) issue a command that will error, I've left it out.

I know that this device cannot ever return it, so it's not a problem for me.

In some cases it would be handy if CQC supported the concept of "i can see these values when reading/polling, but can only send this subset when writing"... but its so infrequent as not to worry about it.
Reply
#33
Ok, Version 1.5 is posted with the fixes to the StaticTables and the Initial Polling.

With the StaticTable it turns out it was the leading "." in your OID. I strip that later on down the line, but not for StaticTables since the OIDs get parsed right away, to find all the table entries. So I had to strip it ahead of time for StaticTables.

The initial polling issue only seems to occur after a manual reload. I don't think it happens on a real driver load, at least I couldn't get it to happen for me on a regular load. So that should be fixed also.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#34
And to think, last night I manually created all 8 fields. Sad

Oh well, this will be faster/cleaner/shorter XMl.

Then I have a sample XML and Interface for the 9210 I can post, probably tonight.
Reply
#35
Here is my example file for an APC Masterswitch 9210. Wuench, you can link to this post from the first, if you like.


.zip   APC_Test_Template.zip (Size: 20.45 KB / Downloads: 9)

.zip   SNMPConfig.zip (Size: 808 bytes / Downloads: 18)

[Image: apcsnmpgt0.png]

Code:
<SNMPConfig>
<Global>
  <Device>192.168.2.35</Device>
  <SNMPVersion>1</SNMPVersion>
</Global>
<!-- System Name -->
<SNMPObject>
  <FieldName>APC-Master-SystemName</FieldName>
  <CQCType>String</CQCType>
  <Access>Read</Access>
  <OID>.1.3.6.1.4.1.318.1.1.4.3.3.0</OID>
  <PollInterval>300</PollInterval>
</SNMPObject>
<!-- Full Status of each outlet, from table -->
<SNMPObject>
  <Fieldname>APC-Outlet-Status-%(k)</FieldName>
  <OID>.1.3.6.1.4.1.318.1.1.4.4.2.1.3</OID>
  <OIDType>StaticTable</OIDType>
  <CQCType>String</CQCType>
  <Limits>Enum:OutletOn,OutletOff,OutletReboot,OutletUnknown</Limits>
  <Access>ReadWrite</Access>
  <XLAT>OutletOn,1,OutletOff,2,OutletReboot,3,OutletUnknown,4</XLAT>
  <PollInterval>1</PollInterval>
  <!-- AP 9210 does not support 5/6 (On/Off with delay), 4 indicates trouble, and needs HW reset -->
</SNMPObject>
<!-- Name of each outlet, from table -->
<SNMPObject>
  <FieldName>APC-Outlet-Name-%(k)</FieldName>
  <CQCType>String</CQCType>
  <OIDType>StaticTable</OIDType>
  <Access>Read</Access>
  <OID>.1.3.6.1.4.1.318.1.1.4.4.2.1.4</OID>
  <PollInterval>60</PollInterval>
</SNMPObject>
<!-- Control All Outlets -->
<SNMPObject>
  <FieldName>APC-Master-Control</FieldName>
  <CQCType>String</CQCType>
  <Limits>Enum:TurnAllOnNow,TurnAllOnSequence,TurnAllOffNow,RebootAllNow,RebootAllSequence,NoCommand</Limits>
  <Access>ReadWrite</Access>
  <OID>.1.3.6.1.4.1.318.1.1.4.2.1.0</OID>
  <XLAT>TurnAllOnNow,1,TurnAllOnSequence,2,TurnAllOffNow,3,RebootAllNow,4,RebootAllSequence,5,NoCommand,6,TurnOffAllSequence,7</XLAT>
  <!-- TurnOffAllSequenced not supported on 9210 -->
  <PollInterval>5</PollInterval>
  <!-- AP 9210 does not support 7, writing 6 causes no action -->
</SNMPObject>
<!-- Query this, if you want, to find out if changes are pending (during reboot) -->
<SNMPObject>
  <FieldName>APC-Master-Changes-Pending</FieldName>
  <CQCType>String</CQCType>
  <Access>Read</Access>
  <OID> .1.3.6.1.4.1.318.1.1.4.2.3.0</OID>
  <PollInterval>2</PollInterval>
</SNMPObject>

</SNMPConfig>


Edit: fixed typo in Wuench's name.
Reply
#36
bph Wrote:Here is my example file for an APC Masterswitch 9210. Wuench, you can link to this post from the first, if you like.

I attached the link to the first post. It looks awesome, I guess that means the StaticTables are working for you.

I had a little performance problem on my Master Server yesterday, I think it was the driver polling UPS. I was seeing CPU spikes and lockups periodically. I also had mistakenly left debug mode on. So it had created a 100MB file by the time I figured it out.

Anyway, keep an eye on your performance and let me know if you see any issues. You may not see any, my UPS file generated a lot of fields, but I may need to tune the driver a little bit or at least document how to deal with performance issues, like altering the polling interval.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#37
wuench Wrote:Anyway, keep an eye on your performance and let me know if you see any issues. You may not see any, my UPS file generated a lot of fields, but I may need to tune the driver a little bit or at least document how to deal with performance issues, like altering the polling interval.

If I write a field (do a set) is that field updated immediately? Realistically, nothing is going to change on mine except through this driver, so I could turn the polling way down if the fields update when the driver changes one.
Reply
#38
Yeah, if the device sends back a valid response the field is updated.

If it gets an invalid response or timeout it will log an error, increment the failed writes and throw a field rejected.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#39
Can two OID's be appended together?

as an example I have a print server that has two OID's for the connected printers manufacture (Canon) and name (S9000).

Can these two OID's be read into one CQC field so the field value will be Canon S9000.

Mick
Reply
#40
I don't think there is a way to do it with the driver itself.
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Koyo Click PLC Driver rbroders 71 26,490 Yesterday, 10:57 AM
Last Post: rbroders
  Carrier Infinity HVAC Driver beelzerob 34 12,192 09-07-2018, 01:15 PM
Last Post: lleo
  Amazon Echo Hue Simulator Driver wuench 113 35,379 09-02-2018, 07:24 AM
Last Post: TurboSam
  Sony TV IP driver dogman 10 620 08-01-2018, 03:53 PM
Last Post: znelbok
  Generic Modbus Driver - Serial & IP znelbok 24 10,829 07-20-2018, 01:21 PM
Last Post: znelbok
  Sony Bravia TV Driver znelbok 12 1,592 06-11-2018, 09:19 AM
Last Post: Dean Roddey
  XBMC Driver wuench 427 153,065 05-29-2018, 03:02 AM
Last Post: znelbok
  OpenHAB Driver whozeawhat 5 678 05-28-2018, 08:50 AM
Last Post: whozeawhat
  Pushbullet Driver whozeawhat 1 405 05-13-2018, 07:27 AM
Last Post: whozeawhat
  Monoprice Blackbird 4x4 HDMI Switcher - Driver request batwater 14 7,875 02-10-2018, 02:29 PM
Last Post: batwater

Forum Jump:


Users browsing this thread: 1 Guest(s)