3G usb modem using CDC interface

19 posts / 0 new
Last post
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi Dean thanks...I did indeed look at your PPP stack n all long time ago. Whenever I read someone elses code I find it sucha hibijibi, so I end up writing my own! But it was helpful in understanding a few concepts neverthe less. I now have developed a full blown tcp/ip stack with sockets on UC3A1256. I am just worried about dynamic allocation of memory buffers during socket allocations lol...poor chip only has 64KB memory. I have like 4kb rx and 4kb tx buffer and pretty soon the number of sockets add up when you have HTTP, FTP, DNS etc!

Just now finished DNS code and it works!!! Yeeha!
I am currently using Vodafone SIM with Huawie dongle.. and it seems to give me public IP address, therefore I have managed to get a simple webserver going.

next is NTP!

Kartman, I have wondered about a metal box. Coke can sounds useful... I might give it a go soon.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dean!!! :(

I have purchased some new modems... Huawei E153 and E160.
So far I had developped my code using E220 and E270 and it worked fine with those two. Both are essentially same and have the same VID PID. Even have the same interfaces!

With the E153 and E160 however things are a little different. For instance E153 it requires a modeswitch, which I have successfully done! But after mode switch it comes up with 5 interfaces!

They are:
Interface 0 class 255, subclass 255 protocol 255
--> 0: Endpoint ID 129, Type: 3
--> 1: Endpoint ID 130, Type: 2
--> 2: Endpoint ID 1, Type: 2
Interface 1 class 255, subclass 255 protocol 255
--> 0: Endpoint ID 131, Type: 3
--> 1: Endpoint ID 132, Type: 2
--> 2: Endpoint ID 2, Type: 2
Interface 2 class 255, subclass 255 protocol 255
--> 0: Endpoint ID 133, Type: 2
--> 1: Endpoint ID 3, Type: 2
Interface 3 class 255, subclass 255 protocol 255
--> 0: Endpoint ID 134, Type: 2
--> 1: Endpoint ID 4, Type: 2
Interface 4 class 8, subclass 6 protocol 80
--> 0: Endpoint ID 135, Type: 2
--> 1: Endpoint ID 5, Type: 2
Interface 5 class 8, subclass 6 protocol 80
--> 0: Endpoint ID 6, Type: 2
--> 1: Endpoint ID 136, Type: 2

Interface 0: is Modem Interface
Interface 1: is 3G Network Card (ethernet interface)
Interface 2: Application Interface
Interface 3: PC UI Interface
Interface 4: Mass storage
Interface 5: Mass storage

I have successfully started an AT command session with the E153. However if I start sending LCP packets to start up PPP session, I get no reply back from the usb! What does that mean? Any ideas?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Where is Dean? :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Working during the day :).

Hrm. Are you sure the pipes are binding to the appropriate endpoints in the modem? IIRC even the biggest USB AVR host doesn't have THAT many pipes/endpoints. Are you using some sort of selection criteria to only bind to the interesting endpoints within the device so you don't run out of them?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes yes I only bind to interface 0 and interface 3...and yes I can read the diagnostic pc ui interface RSSI values on interface 3...as well as send the AT commands on interface 0. Its just that once you do ATDT*99# on interface 0, it shows CONNECT and it doesnt accept anything else....

Normally with E220 or 270 after displaying CONNECT it starts to accept LCP packets starting with 0x7E....and similarly responds back with such packets...

but this does not happen with E153 on interface 0. :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have noticed something...with E153...it comes up with endpoint sizes of 512 on my laptop...so that would be the High speed configuration... there is the "other speed configuration" which keeps all endpoint sizes to 64bytes. Should initialize the usb device with that option?

Does it matter if I keep my endpoint sizes to 64 but the usb device has its end set to 512bytes?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok when you connect it to laptop it shows up endpoints with 512 bytes (high speed configuration 1), but when I connect it to my UC3A it automatically knows that the connection is a full speed, hence shows the end point sizes to be 64 (full speed configuration 1). So end point is not an issue here...

I am still banging my head wondering why after "CONNECT" the interface will not respond to my LCP packets....the usb itself is transfering the LCP requests as I am not getting any NACK or STALL. But just not getting anything back in return to my LCP requests... wat could be wrong? :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK!!!!
Finally I have figured out what was wrong!!!
Amazing how things work out.... looks like there was mistakes in my PPP FCS calculation since the beginning. And when I initially developed my code using Huawei E220 and E270, everything worked fine. Proving that those 2 devices do not care if the PPP FCS is not a correct one!!

But when I was trying to work with E153 and lately E173 as well, they both require correct PPP FCS. Otherwise the modems wont respond to any LCP request packets you send. Now I have a working system that is compatible for E220, E270, E153, E173 and E160 (potentially).

I would like to note that E153 requires a mode switch string to be sent, E173 doesnt (just plain set config at 1). Havnt tried E160, but I have a feeling it doesnt require a mode switch string either being a much older device.

:D :D :D

Now a 3G modem expert! Until I find other problems :P

So it seems like the issue I had when I was trying to talk to a ZTE626i modem would have been due to the wrong PPP FCS as well. I just need to add the driver (end point maps) in my code for it to work.... :)

Pages