Your Linux Data Center Experts

Usually when I insert my Sprint cellular wireless card it shows up on /dev/ttyUSB3, but the other day it showed up on ttyUSB6. When you insert the card it creates 10 ttyUSB files, and I just want my card to work. So, I wrote a small python program (based off code I have previously written for talking to serial devices). Read on for how I solved it.

The correct device will respond to “AT” with “OK”, just like an ancient Hayes modem. So, I took some code I had that talks to serial devices fairly conservatively but without getting hung up waiting for a response that will never come, and just walk through the likely devices looking for one that responds to AT with OK.

I've made this code available at including an example of it's use in my connection script.

comments powered by Disqus

Join our other satisfied clients. Contact us today.