This is a long post for two short questions, but I need to give a little background
or you’ll be asking, “Why are you doing this?”.
We use SNAP-PAC-R1 controllers in our products, which are very large
computer systems. We use the R1s to control water valves and blowers
that keep the computer systems cool. The controllers connect to
a control network of 100% Linux-based systems.
In my OptoScript strategy, I write the following SNMP parameters
which allow the Linux computers to send “commands” to the R1s
using SNMP. By sending a command, I mean the Linux computers
write a value to the SNMP-accessible scratch-pad registers in the R1s.
For example, if a Linux computer writes a value of 1 to a specific
scratch-pad integer register, the R1 will reset the stored maximum
values for a specific range of I/O points.
// SNMP Trap Version
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c030c, 0);
// SNMP Trap Destination Port
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c0308, 22162);
// SNMP Authentication Trap 0=disabled 1=enabled
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c0060, 0);
// SNMP Cold Start Trap 0=disabled 1=enabled
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c0064, 0);
// SNMP public community name, read, write, and trap enables
Manager_OptoMPPStatus = WriteStrToIoUnitMemMap(LOCAL, 0xFFFFF03c0068, “public”);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c007c, 1);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c0080, 0);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c0084, 0);
// SNMP xxx community name, read, write, and trap enables
Manager_OptoMPPStatus = WriteStrToIoUnitMemMap(LOCAL, 0xFFFFF03c0088, “xxx”);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c009c, 1);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c00a0, 1);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c00a4, 1);
// SNMP Host settings
Manager_OptoMPPStatus = WriteStrToIoUnitMemMap(LOCAL, 0xFFFFF03c0168, “xxx”);
Manager_IPAddressAsInt = IpAddressStringToInt32(“172.26.0.1”);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c017c, Manager_IPAddressAsInt);
Manager_OptoMPPStatus = WriteStrToIoUnitMemMap(LOCAL, 0xFFFFF03c0180, “xxx”);
Manager_IPAddressAsInt = IpAddressStringToInt32(“172.26.0.10”);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c0194, Manager_IPAddressAsInt);
Manager_OptoMPPStatus = WriteStrToIoUnitMemMap(LOCAL, 0xFFFFF03c0198, “xxx”);
Manager_IPAddressAsInt = IpAddressStringToInt32(“172.26.0.17”);
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF03c01ac, Manager_IPAddressAsInt);
This is how I understand things to work. Let me know if I’m not correct:
In manufacturing, we place my strategy on a microSD card, place that in the R1 and
then power the R1 on. The R1 runs the strategy which sets the SNMP
parameters and writes them to memory (flash memory?). Access does not
work at this point, so we wait 3 minutes, and then power-reset the controller.
This second time, the R1 firmware reads the SNMP parameters that were stored to
memory, and then access works correctly. Then the system ships to the field
with the strategy installed and SNMP access working.
This has been worknig fine, but we just ran into a problem where
in the field, the SNMP access isn’t working. I remotely read the controller’s
memory locations and everything is set the way they are supposed to be.
My only guess as to what happened is that during shipping, the SNMP settings
were somehow cleared from memory. Then, in the field, the R1 has only
been turned on once so the strategy wrote the SNMP settings to memory,
but since the controller has not restarted since then, the settings have
not been read by the firmware.
So, my first question is, where are the SNMP permission settings stored and is it
possible to loose them if the controller is powered off for an
extended period of time?
My second question is, I also use the following OptoScript code in
my strategy to back up the IP address and configuration information.
I thought the SNMP permissions would be backed up in the
/sdcard0/opto22/config/config.cfg file also, are they?
// Write configuration file to microSD card
Manager_OptoMPPStatus = WriteNumToIoUnitMemMap(LOCAL, 0xFFFFF0380000, 0xd);
CND_STR_Active[CND_STR_ipAddressBackup] = Strategy_ConditionOn;
(As a side note, I’m in the proces of changing my Linux-computer to R1
communication to use MODBUS instead of SNMP. So far, it is much
faster and more reliable. But, there is code written by other people that
still requires the SNMP communication.)