LORD-MicroStrain / MSCL

MicroStrain Communication Library
https://www.microstrain.com/software/mscl
MIT License
78 stars 57 forks source link

Node Communication Errors (EEPROM 46, 24, 300) #119

Open stephenagee opened 4 years ago

stephenagee commented 4 years ago

I'm getting an intermittent exception when creating a base station, node, and sync sampling network. The exception can be hard to reproduce, as it only happens sometimes. It usually occurs when calling "network.addNode(node)" where network is a SyncSamplingNetwork and node is a WirelessNode. When making this call, I've gotten the following exceptions: "Failed to read the Model Number (EEPROM 46) from Node 37359," "Failed to read the Sampling Mode (EEPROM 24) from Node 37359," and "Failed to read the Diagnostic Interval (EEPROM 300) from Node 37359." I get EEPROM 46 the most. I've attached my code below. I'm using VB.NET in Visual Studio 2010. I had to convert the .vb file to a .txt file, but all the code is the same.

Thanks in advance! Form1.txt

msclissa commented 4 years ago

Sorry for the delayed response!

Because these are intermittent it sounds like normal communication errors inherent in wireless communication. There are many functions within MSCL that read multiple values from the node behind-the-scenes to try to simplify the interface - MSCL caches as much of this information as possible, but it must be read the first time it is needed after creating the WirelessNode object. This is why the errors vary and don't always seem to align with the actual function called.

Usually increasing the node.readWriteRetries() (where node is a WirelessNode) helps avoid this issue - this makes MSCL automatically retry an EEPROM read/write operation without throwing an error until the last retry fails. In SensorConnect we default this value to 3, but it may make sense to increase this depending on environmental factors that can cause interference.

Let us know if increasing the readWriteRetries does not reduce the occurrence of these errors!