I'm trying to troubleshoot discovery of my T7 device. This part from the troubleshooting app not perfectly describes my situation:
4. Connection is fine, and a direct TCP open works, but a Kipling or LJCP search does not find the device:
Kipling and LJControlPanel use a UDP broadcast to attempt to find all T7s or UE9s on the network but with certain networks this does not work. For LJControlPanel you will have to use a direct TCP open. For Kipling you will have to use LJM Special Address configuration together with devices addressed by static IP
I'd like to know what network configurations cause this error. I've tried on two different networks (work and i tried at home as well), but neither could discover the T7. Most of the time I just get nothing, and then can connect fine. Other times I get 1298 LJME_ATTR_LOAD_COMM_FAILURE. I'm trying to figure out whether my issue is with my laptop, the networks, or the T7 (as that error message description seems to indicate).
python snip (combo of two different examples
def displayDeviceInfo(functionName, info):
print("\n%s found %i LabJacks:\n" % (functionName, info[0]))
fmt = ''.join(["{%i:<18}" % i for i in range(0, 4)])
print(fmt.format("Device Type", "Connection Type", "Serial Number", \
"IP Address"))
for i in range(info[0]):
print(fmt.format(DEVICE_TYPES.setdefault(info[1][i], str(info[1][i])), \
CONN_TYPES.setdefault(info[2][i], str(info[2][i])), \
str(info[3][i]), \
ljm.numberToIP(info[4][i])))
print("")
print("***End***")
print("")
if __name__ == "__main__":
#listAll and listAllS returns the tuple (numFound, aDeviceTypes,
#aConnectionTypes, aSerialNumbers, aIPAddresses)
#Find and display LabJack devices with listAllS.
info = ljm.listAllS("ANY", "ANY")
displayDeviceInfo("listAllS", info)
#Find and display LabJack devices with listAll.
info = ljm.listAll(ljm.constants.ctANY, ljm.constants.ctANY)
displayDeviceInfo("listAll", info)
#Connect to a specific device, get info and disconnect
handle = ljm.open(ljm.constants.dtT7, ljm.constants.ctWIFI,"192.168.2.123")
info = ljm.getHandleInfo(handle)
print("Opened a LabJack with Device type: %i, Connection type: %i,\n" \
"Serial number: %i, IP address: %s, Port: %i,\nMax bytes per MB: %i" % \
(info[0], info[1], info[2], ljm.numberToIP(info[3]), info[4], info[5]))
listAllS found 0 LabJacks:
Device Type Connection Type Serial Number IP Address
***End***
listAll found 0 LabJacks:
Device Type Connection Type Serial Number IP Address
***End***
Opened a LabJack with Device type: 7, Connection type: 4,
Serial number: 470012349, IP address: 192.168.2.123, Port: 502,
Max bytes per MB: 500
Press any key to continue . . .
I would like to add that I have also tried this with windows firewall disabled in order to eliminate that possibility.
The error is very likely your T7-Pro and the WiFi connection. The WiFi chip doesn't always provide a 100% reliable communication medium, packets get dropped and the device connection fails. When using the T7 via WiFi you will encounter errors and you need to properly handle them. If you are scanning you will sometimes need to scan multiple times. If you are connecting to a device you will sometimes need to try connecting to it multiple times. If you are trying to read or write data you will sometimes need to try multiple times and you will need to be able to handle device-reconnecting errors.
I have a few questions for you:
1. If you are having networking issues make sure that you can ping your device's IP address.
2. Is your computer connected to multiple networks?
3. Make sure that your WiFi network allows you to send UDP broadcast messages, some WiFi networks will disable this.
To answer your questions:
1. I can ping the device
2. The windows laptop that is in question is only connected to a single network
3. The virtual machine (linux) is able to discover the device over the wireless network as it's also on the same laptop
Some additional information:
1. I dug out another machine, installed windows 7 on it and was able to successfully discover the device.
2. The windows version is 8.1 Pro
3. The discovery fails 100% of the time. The other tested setups (windows 7 & linux) work 100% of the time. It's not intermittant, or doesn't work sometimes, it never works, and always works on others. Even kipling doesn't work from the laptop.
4. The laptop cannot discover when the T7 is wired either (I can't wire the laptop, it's wi-fi only. Same issue, 100% failure rate.
More Information:
I think this is the problem: https://social.msdn.microsoft.com/Forums/en-US/908c6c55-fb1d-48ed-8275-8...
Near the bottom, after the fix is discussed, someone finds a workaround. If i disable other network adapters, the discovery works. While this is not a viable solution for production, it will allow me to continue development. The proposed code fix in that post would need to be implemented in the ljm library. Where can i find the source code for the library so that I can test?
Thank you for this information. LJM is not open sourced at this time, and LabJack would prefer to keep it closed source unless we have a compelling reason to do otherwise. I'm reading the thread now for the solution, and I hope to implement it in LJM once I do.
Hello, I will try using the above approved answer to fix LJM"s device discovery for Windows 8.1. Thanks again for contacting us with this information.