Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SNMP Driver
#21
znelbok Wrote:The MIB browser failed when set to V2. SO it would seem that the MAster switch only supports V1.

Ok, this should be fixed in Version 1.4. You can now force SNMP Version 1 requests by using <SNMPVersion>1</SNMPVersion> under either <Global> or in under an individual <SNMPObject>.

I also set it up so that the \CQC\MacroFileRoot\SNMP directory is created automatically (or other dir if log file names were changed). So the driver will have a place to store the debugging files.

And I added a Working With Booleans section to the doc.. :-)
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#22
ABSOLUTELY ROCKIN!

I have successfully read the value of my system name from my ancient MasterSwitch.

Suggestion: it appears that the values of fields are not read until after the first poll interval (for example, the system name isn't read until 300 seconds after the driver loads, if it is set to poll every 300s). It might be worth it to have each value polled on load and then go to the polling interval, so that the little-used fields fill in shortly after the driver loads.

THANKS
Reply
#23
I have been able to access the individual fields, both reading and writing, but can't get tables to work. This is not a huge deal, since I can just copy and paste the outlet control 8 times Smile but you might want to tell me if I'm doing it wrong or if you have an error.

The table shows correctly in the MIB browser, and this is from the PowerNet MIB.

Config:
Code:
<SNMPConfig>
<Global>
  <Device>192.168.2.35</Device>
  <SNMPVersion>1</SNMPVersion>
</Global>

<SNMPObject>
  <Fieldname>Test-%(k)</FieldName>
  <OID>.1.3.6.1.4.1.318.1.1.4.4.2.1.1</OID>
  <OIDType>StaticTable</OIDType>
  <CQCType>String</CQCType>
</SNMPObject>

Log:
Code:
11/28/08 08:51:10.741 - BoolFldChanged: Only OIDType=Trap can send Events, defaulting %(1) to String Field.
11/28/08 08:51:10.741 - SetupFields: Creating Fields.
11/28/08 08:51:10.801 - SNMPV2Eng.ClearGlobals: All Globals Reset.
11/28/08 08:51:10.811 - SNMPV2Eng.ClearOIDs: SNMPDB OIDS Cleared.
11/28/08 08:51:10.811 - SNMPV2Eng.SetGlobal: Global Parm Device Set To 192.168.2.35
11/28/08 08:51:10.811 - SNMPV2Eng.SetGlobal: Global Parm SNMPVersion Set To 1
11/28/08 08:51:10.811 - LoadConfig: 1 SNMP Objects Found.
11/28/08 08:51:10.811 - SNMPV2Eng.Send: Sending GetNext 192.168.2.35:161 (public)
11/28/08 08:51:10.811 - SNMPV2Eng.Send: OID = .1.3.6.1.4.1.318.1.1.4.4.2.1.1
11/28/08 08:51:10.811 - SNMPV2Eng.Send: SNMP Version = 1
11/28/08 08:51:10.841 - GetResp: -----------------------------------------------------------------
11/28/08 08:51:10.891 - SNMPV2Eng.GetResp: From: 192.168.2.35(57 bytes)
11/28/08 08:51:10.891 - SNMPV2Eng.GetResp: Version:SNMPv1(0) Community:public
11/28/08 08:51:10.891 - SNMPV2Eng.GetPDU: PDUType:162(Response) RequestID:1328
11/28/08 08:51:10.891 - SNMPV2Eng.GetPDU: ErrorStatus:0(No Error) ErrorIndex:0
11/28/08 08:51:10.891 - GetResp: -----------------------------------------------------------------
11/28/08 08:51:10.901 - SNMPV2Eng.AddOID: Unhandled Exception (MEng.String #0) - The index 31 is invalid for this string
11/28/08 08:51:11.902 - Poll: -----------------------------------------------------------------
11/28/08 08:51:11.902 - Poll: Count=1237, Global Interval=5 Secs
11/28/08 08:51:11.902 - Poll: No Fields to Poll.
11/28/08 08:51:16.910 - Poll: -----------------------------------------------------------------
11/28/08 08:51:16.910 - Poll: Count=1238, Global Interval=5 Secs
11/28/08 08:51:16.910 - Poll: No Fields to Poll.

"Raw" value of Getnext according to MIB Browser:
Code:
OID: .1.3.6.1.4.1.318.1.1.4.4.2.1.1.1
Value: 1
Type: Integer

OID: .1.3.6.1.4.1.318.1.1.4.4.2.1.1.2
Value: 2
Type: Integer
Reply
#24
well its no surprise that mine does not work.

bph - could you post your xml file for me so I can double check that its not something I have done (I dont think it is).

I cant write a value to the outputs, the driver rejects it (Cant write from the MIB browser either)
Code:
11/29 07:45:36-server.home.net, CQCServer, CQCDrv_SNMP_APCMS_Thread17
{
    CQCKit, MEng.System.CQC.Runtime.CQCLogger.110, Status/App Status
    ProcessResponse: Unhandled Exception (MEng.System.CQC.Runtime.CQCDriverBase #7) - Value '0032 ' exceeds the limits for field $FailedWrite


This is the field
Code:
<!-- MS 8 Outlet Status -->
    <SNMPObject>
        <FieldName>Outlet8_Status</FieldName>
        <CQCType>String</CQCType>
        <Access>ReadWrite</Access>
        <OID>.1.3.6.1.4.1.318.1.1.4.4.2.1.3.8</OID>
        <!-- <Limits>Enum:On,Off</Limits>
        <XLAT>On,1,Off,2</XLAT> -->
        <PollInterval>5</PollInterval>
    </SNMPObject>
Thanks

Mick
Reply
#25
I have made some progress, but it would appear that I don't know what I am doing.

I was just trying to get the basic operation of turning an output on and off and that was failing. I was interrupted and I came back and it worked.

I made a change to another field (start-up time) and now the setting of the on and off does not work.

Actually, scratch that, I just went and tested again and it works. It appears that it wants to wait a couple of minutes before working - any clues as to why?

Every time I try and use limits and XLAT, the field disapears and the logs report The field "xxxx" was not found
Reply
#26
This works.

I was hoping he'd have a chance to tell me what's up with the table question I posted, but these all work for me.

Remember that if you have anything involving a DELAY, like a reboot or a timed startup, that no new commands will process while that one is still executing. One of the OIDs shows if anything is "pending".

As well, if you are logged in on the serial console (and perhaps telnet, too), no SNMP or HTTP commands will take.

Code:
<SNMPConfig>
<Global>
  <Device>192.168.2.35</Device>
  <SNMPVersion>1</SNMPVersion>
</Global>

<!-- System Name -->
<SNMPObject>
  <FieldName>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>

<SNMPObject>
  <FieldName>Outlet-Status-1</FieldName>
  <CQCType>String</CQCType>
  <Limits>Enum:OutletOn,OutletOff,OutletReboot,OutletUnknown</Limits>
  <Access>ReadWrite</Access>
  <OID>.1.3.6.1.4.1.318.1.1.4.4.2.1.3.1</OID>
  <XLAT>OutletOn,1,OutletOff,2,OutletReboot,3,OutletUnknown,4</XLAT>
  <PollInterval>5</PollInterval>
</SNMPObject>

<SNMPObject>
  <FieldName>Outlet-Name-1</FieldName>
  <CQCType>String</CQCType>
  <Access>Read</Access>
  <OID>.1.3.6.1.4.1.318.1.1.4.4.2.1.4.1</OID>
  <PollInterval>5</PollInterval>
</SNMPObject>

<SNMPObject>
  <FieldName>Outlet-On-1</FieldName>
  <CQCType>Boolean</CQCType>
  <Access>Read</Access>
  <OID>.1.3.6.1.4.1.318.1.1.4.4.2.1.3.1</OID>
  <PollInterval>30</PollInterval>
</SNMPObject>

<SNMPObject>
  <FieldName>Master-Control</FieldName>
  <CQCType>String</CQCType>
  <Limits>Enum:TurnAllOnNow,TurnAllOnSequence,TurnAllOffNow,NoCommand</Limits>
  <Access>ReadWrite</Access>
  <OID>.1.3.6.1.4.1.318.1.1.4.4.2.1.3.1</OID>
  <XLAT>TurnAllOnNow,1,TurnAllOnSequence,2,TurnAllOffNow,3,RebootAllNow,4,RebootAllSequence,5,NoCommand,6</XLAT>
  <PollInterval>5</PollInterval>
</SNMPObject>

</SNMPConfig>
Reply
#27
Thank-you very much

buggered if I know why though. I have basically the same as you for the outlet status (minus the reboot and unknown) and it would never work. Now it does when I add the extra two enumerations.

Why are you using a boolean field for outlet on?
Reply
#28
Have you been able to write to the outlet name fields or the power up time fields.

Mick
Reply
#29
znelbok Wrote:Why are you using a boolean field for outlet on?

Because although there really are four states or whatever (just like the ISO defines five possible values for "gender"), in practice I only care about On or not-on ("not-on" commonly called "off"). I like to be able to have the flexibility to work with widgets that attach to booleans, like the image on a command button, for example.

The SNMP structure handily equates any non-1 value to false so that works really well for it.
Reply
#30
znelbok Wrote:Have you been able to write to the outlet name fields or the power up time fields.

No; haven't tried. Going to do them through telnet or HTTP. They don't change.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  LIFX Driver bobskie708 12 2,148 11-26-2018, 05:23 PM
Last Post: Dean Roddey
  Driver for Bigass Fan lleo 7 224 11-25-2018, 08:57 AM
Last Post: Dean Roddey
  Amazon Echo Hue Simulator Driver wuench 115 41,942 11-08-2018, 06:49 AM
Last Post: karenlee
  RunTimer2 driver rbroders 14 4,177 10-15-2018, 11:45 AM
Last Post: rbroders
  Generic Modbus Driver - Serial & IP znelbok 25 12,622 10-09-2018, 08:59 AM
Last Post: Ron Haley
  Issues debugging IP based driver jnolting 5 568 09-24-2018, 11:52 AM
Last Post: Dean Roddey
  Enhance Driver Test Harness Field Monitor rbroders 1 323 09-24-2018, 10:49 AM
Last Post: Dean Roddey
  Koyo Click PLC Driver rbroders 75 29,100 09-23-2018, 01:18 PM
Last Post: rbroders
  Carrier Infinity HVAC Driver beelzerob 34 13,963 09-07-2018, 01:15 PM
Last Post: lleo
  Sony TV IP driver dogman 10 1,361 08-01-2018, 03:53 PM
Last Post: znelbok

Forum Jump:


Users browsing this thread: 2 Guest(s)