How to use Digi CpX4 to 3G or GPRS connecting?

I know usually we use python to connect in Digi like this:
tcpCliSock = socket(AF_INET, SOCK_STREAM)
tcpCliSock.connect(ADDR)

But,now I want to 3G connect in Digi CpX4,how to program
.can give me a sample ?should I do something else more?
thanks very much!

What you suggest is fine.

If both your X4 and your cell plan have 3G capability, then it will ALWAYS try to connect in 3G mode because it makes better use of the air-waves. Therefore it is in the best interests of AT&T (or whoever your carrier is) to get you into 3G mode.

If the local cell tower doesn’t support 3G, or your cell plan is GPRS only, then you’ll connect in a slower mode because the cell tower was ‘instructed’ by yoru carrier to only support slower modes. There is nothing the X4 can do to overcome this.

As a second comment, some carriers have special APN names for use when you want to ONLY connect with 3G.

I hear rumor AT&T has such a magic name (perhaps ‘broadband’ instead of ‘isp.cingular’?)

The ‘good’ is it prevents AT&T from pushing you off onto slower infrastructure based on who-knows business logic.

The ‘bad’ of this is you’ll more likely find situatiosn with no signal at all, since for example even a Sprint/verizon/CDMA cell-tower partner will have low-bandwidth GPRS resources you could roam to, but won’t likely have an GSM-3G since such high-bandwidth things would be dedicated to CDMA only.