Vodafone K3770

22 Nov 2012

Hi Andrew,

Thanks for reporting this! I have just updated the VodafoneUSBModem libraries which should now be compatible with the rev. 44 library.

Cheers,

Donatien

22 Nov 2012

Donatien Garnier wrote:

Hi Andrew,

Thanks for reporting this! I have just updated the VodafoneUSBModem libraries which should now be compatible with the rev. 44 library.

Cheers,

Donatien

Thanks, it compiles now but dont have mbed with me to try it.

Cheers

Andy

30 Nov 2012

Hi Guys,

Seem to be having more issues with the dongle and library. Is there a limit to how many SMS can be retrieved? My dongle has about 18 in the inbox waiting to be retrieved. I'm using Ashleys SMS test program from http://mbed.org/users/ashleymills/code/VodafoneSMSBasics/. Initially this was tried as is, then the mbed, mbed-rtos and vodafone libraries were updated to the latest versions with no improvement.

The errors I am seeing from the output is below. This is using the latest version of everything. The only change I made to main.cpp was to comment out the SMS send call as the sim I'm using doesnt allow sending of sms.

[WARN] Module ATCommandsInterface.cpp - Line 574: Previous command not processed!
[INFO] Module VodafoneUSBModem.cpp - Line 544: Using a Vodafone K3770 Dongle
[WARN] Module ATCommandsInterface.cpp - Line 377: End of unprocessed line
[WARN] Module ATCommandsInterface.cpp - Line 269: Command returned no message
[WARN] Module SMSInterface.cpp - Line 155: AT+CMGR returned 6
[DBG] Module main.cpp - Line 47: Error retrieving SMS from mailbox!

It looks like the ATCommandsInterface is failing to parse responses that it receives.

Any ideas?

Update I put the dongle into my laptop and used the vodafone software to download all the sms, then put dongle back into mbed with the same software running. If I then send one or 2 sms at a time it retrieves them ok.

Cheers

Andy

30 Nov 2012

You should be able to store 25 SMS in the K3770. Subsequent SMS should be queued by the network for multiple re-delivery attempts. One of the test cases sends 50 messages to itself, and waits for 25 to be received before dumping them. It's quite interesting to see what the network does when the mailbox is full, as the subsequent 25 rejected messages trickle in about one every 5-15 seconds. So according to the tests, that all works.

We had a bug before, which required cleaning of the mailbox to rectify, so alarm bells are ringing. I was under the impression it had been fixed. Evidently not entirely. I'm sure Donatien will notice this thread, but I'll send an email to him anyway.

Thanks for your incidental testing of the library, this is going to help everyone. BTW, saw your weather scroller on twitter, looks good! :)

Ashley

30 Nov 2012

Hi Ashley,

thanks for the update, though it seemed odd that it couldnt handle that number of sms.

I'll get round to doing a blog writeup on the message scroller sometime soon. I've still got issues with using the printer with it, in that it is still restarting the mbed after a sms has been received and printed out. Using the LED displays on their own doesnt show this. More investigations later.

Cheers

Andy

30 Nov 2012

Hi Andy,

Could you tell me a bit about how you did proceed so that I can try to reproduce your problem? Did you send any special characters within your text messages? Did you send 18 texts, then started the program, or did you send them really fast?

Also, are you using a K3770 or a K3772-Z dongle?

Thanks for the feedback, it helps a lot.

Cheers,

Donatien

30 Nov 2012

Hi Donatien,

Its a K3770 dongle. The sms had no special characters in them as far as I am aware. They have been coming from an automated system called ifttt.com where you can send sms based on triggers, e.g. forusquare checkins, weather tomorrow is cold/rainy, someone tags you in a photo in facebook etc. Plus a number of test messages.

It stopped working the other day and tests were showing 6 sms, but then I'd forgotten to turn off the ifttt tasks so they built up over the next day. I dont think they were being sent rapidly.

The mbed had been powered off and on a few times to see if it was just a dongle lockup but the only way to clear them down was to plug the dongle into my laptop and use the software to read them.

I can try sending a lot of sms while its switched off to see if its able to receive them all when its switched back on if that would help.

Thanks

Andy

30 Nov 2012

Hi Guys,

doing a bit of debugging, got some extended debug messages that might help:

[DBG] Module ATCommandsInterface.cpp - Line 886: Trying to send a pending command
[DBG] Module ATCommandsInterface.cpp - Line 242: Trying to enter abortRead()
[DBG] Module ATCommandsInterface.cpp - Line 566: status = 32, msg = 268453772
[DBG] Module ATCommandsInterface.cpp - Line 576: Sending pending command
[DBG] Module ATCommandsInterface.cpp - Line 888: Trying to read a new line
[DBG] Module ATCommandsInterface.cpp - Line 297: Trying to read a new line from stream
[DBG] Module ATCommandsInterface.cpp - Line 308: In buffer: [AT+CMGL="REC READ"
+CMGL: 1,"REC READ","14152372122",,"12/11/30,16:20:45+00"
Sunset for November 30, 2012 at 05:58AM! The da]
[DBG] Module ATCommandsInterface.cpp - Line 322: Trying to process incoming line
[DBG] Module ATCommandsInterface.cpp - Line 329: New iteration
[DBG] Module ATCommandsInterface.cpp - Line 334: No line detected yet
[DBG] Module ATCommandsInterface.cpp - Line 350: CR char found
[DBG] Module ATCommandsInterface.cpp - Line 398: New line found (possible echo of command)
[DBG] Module ATCommandsInterface.cpp - Line 597: Processing read line [AT+CMGL="REC READ"]
[DBG] Module ATCommandsInterface.cpp - Line 604: Command echo received
[DBG] Module ATCommandsInterface.cpp - Line 426: One line was successfully processed
[DBG] Module ATCommandsInterface.cpp - Line 329: New iteration
[DBG] Module ATCommandsInterface.cpp - Line 334: No line detected yet
[DBG] Module ATCommandsInterface.cpp - Line 350: CR char found
[DBG] Module ATCommandsInterface.cpp - Line 370: Beginning of new line found
[DBG] Module ATCommandsInterface.cpp - Line 380: Discarding CRLF
[DBG] Module ATCommandsInterface.cpp - Line 442: Looking for end of line
[DBG] Module ATCommandsInterface.cpp - Line 460: CR char found
[DBG] Module ATCommandsInterface.cpp - Line 468: End of new line found
[DBG] Module ATCommandsInterface.cpp - Line 597: Processing read line [+CMGL: 1,"REC READ","14152372122",,"12/11/30,16:20:45+00"]
[DBG] Module ATCommandsInterface.cpp - Line 715: Unprocessed result received: '+CMGL: 1,"REC READ","14152372122",,"12/11/30,16:20:45+00"'
[DBG] Module ATCommandsInterface.cpp - Line 490: One line was successfully processed
[DBG] Module ATCommandsInterface.cpp - Line 329: New iteration
[DBG] Module ATCommandsInterface.cpp - Line 334: No line detected yet
[DBG] Module ATCommandsInterface.cpp - Line 558: Processed every full incoming lines
[DBG] Module ATCommandsInterface.cpp - Line 886: Trying to send a pending command
[DBG] Module ATCommandsInterface.cpp - Line 566: status = 0, msg = 0
[DBG] Module ATCommandsInterface.cpp - Line 888: Trying to read a new line
[DBG] Module ATCommandsInterface.cpp - Line 297: Trying to read a new line from stream
[DBG] Module ATCommandsInterface.cpp - Line 308: In buffer: [Sunset for November 30, 2012 at 05:58AM! The day's High was 3C with a Low of -2C. Current conditions are Mostly Cloudy.
+CMGL: 2,"REC READ","+14152372122",,"12/11/30,17:48:]
[DBG] Module ATCommandsInterface.cpp - Line 322: Trying to process incoming line
[DBG] Module ATCommandsInterface.cpp - Line 329: New iteration
[DBG] Module ATCommandsInterface.cpp - Line 334: No line detected yet
[DBG] Module ATCommandsInterface.cpp - Line 350: CR char found
[DBG] Module ATCommandsInterface.cpp - Line 398: New line found (possible echo of command)
[DBG] Module ATCommandsInterface.cpp - Line 597: Processing read line [Sunset for November 30, 2012 at 05:58AM! The day's High was 3C with a Low of -2C. Current conditions are Mostly Cloudy.]
[DBG] Module ATCommandsInterface.cpp - Line 715: Unprocessed result received: 'Sunset for November 30, 2012 at 05:58AM! The day's High was 3C with a Low of -2C. Current conditions are Mostly Cloudy.'
[DBG] Module ATCommandsInterface.cpp - Line 426: One line was successfully processed
[DBG] Module ATCommandsInterface.cpp - Line 329: New iteration
[DBG] Module ATCommandsInterface.cpp - Line 334: No line detected yet
[DBG] Module ATCommandsInterface.cpp - Line 350: CR char found
[DBG] Module ATCommandsInterface.cpp - Line 370: Beginning of new line found
[DBG] Module ATCommandsInterface.cpp - Line 380: Discarding CRLF
[DBG] Module ATCommandsInterface.cpp - Line 442: Looking for end of line
[DBG] Module ATCommandsInterface.cpp - Line 558: Processed every full incoming lines

and for the SMS part only:

[START]
[WARN] Module ATCommandsInterface.cpp - Line 574: Previous command not processed!
[INFO] Module VodafoneUSBModem.cpp - Line 544: Using a Vodafone K3770 Dongle
[DBG] Module SMSInterface.cpp - Line 45: Set format
[DBG] Module SMSInterface.cpp - Line 53: Setup new messages indication
[DBG] Module SMSInterface.cpp - Line 61: Try to fetch inbox
[DBG] Module SMSInterface.cpp - Line 387: Updating inbox
[DBG] Module SMSInterface.cpp - Line 250: Header: +CMGL: 1,"REC READ","14152372122",,"12/11/30,16:20:45+00"
[DBG] Module SMSInterface.cpp - Line 261: m_msgRefListCount=1
[DBG] Module SMSInterface.cpp - Line 266: Message (debug only): Sunset for November 30, 2012 at 05:58AM! The day's High was 3C with a Low of -2C. Current conditions are Mostly Cloudy.
[DBG] Module SMSInterface.cpp - Line 250: Header: +CMGL: 2,"REC READ","+14152372122",,"12/11/30,17:48:46+00"
[DBG] Module SMSInterface.cpp - Line 261: m_msgRefListCount=2
[DBG] Module SMSInterface.cpp - Line 266: Message (debug only): Andrew is at Slough Railway Station (SLO) on November 30, 2012 at 07:15AM +10hrs!
[DBG] Module SMSInterface.cpp - Line 415: 2 incoming messages in inbox
[DBG] Module SMSInterface.cpp - Line 74: Initialization done
2 SMS to read
[DBG] Module SMSInterface.cpp - Line 119: Get next message
[DBG] Module SMSInterface.cpp - Line 133: 2 messages to read
[DBG] Module SMSInterface.cpp - Line 148: Get SMS
[DBG] Module SMSInterface.cpp - Line 234: Header: +CMGR: "REC READ","14152372122",,"12/11/30,16:20:45+00"
[DBG] Module SMSInterface.cpp - Line 242: Message: Sunset for November 30, 2012 at 05:58AM! The day's High was 3C with a Low of -2C. Current conditions are Mostly Cloudy.
[WARN] Module ATCommandsInterface.cpp - Line 377: End of unprocessed line
[WARN] Module ATCommandsInterface.cpp - Line 269: Command returned no message
[DBG] Module SMSInterface.cpp - Line 321: AT code is OK
[DBG] Module SMSInterface.cpp - Line 327: Not handled
[WARN] Module SMSInterface.cpp - Line 155: AT+CMGR returned 6
2 SMS to read
[DBG] Module SMSInterface.cpp - Line 119: Get next message
[DBG] Module SMSInterface.cpp - Line 133: 2 messages to read
[DBG] Module SMSInterface.cpp - Line 148: Get SMS

It looks like its receiving the SMS but not able to process it. There are currently 2 sms like this and its repeating the above debug messages for one after the other.

Cheers

Andy

10 Dec 2012

Hi, I am from Netherlands. I got k3770 modem from vodafone. I am using example http client program, but I get an error [DBG] Module VodafoneUSBModem.cpp - Line 271: Result of connect: Err code=15

Could you point me what could be wrong? Here is the log of connection:

[START]
[DBG] Module PPPIPInterface.cpp - Line 64: Initializing LwIP
[DBG] Module PPPIPInterface.cpp - Line 66: Initializing PPP
[DBG] Module PPPIPInterface.cpp - Line 68: Done
[DBG] Module PPPIPInterface.cpp - Line 74: Configuring PPP authentication method
[DBG] Module PPPIPInterface.cpp - Line 76: Done
[DBG] Module VodafoneUSBModem.cpp - Line 528: Starting AT thread if needed
[DBG] Module VodafoneUSBModem.cpp - Line 535: Sending initialisation commands
[INFO] Module VodafoneUSBModem.cpp - Line 544: Using a Vodafone K3770 Dongle
[DBG] Module VodafoneUSBModem.cpp - Line 586: Waiting for network registration
[DBG] Module VodafoneUSBModem.cpp - Line 588: Result of command: Err code=0

[DBG] Module VodafoneUSBModem.cpp - Line 589: ATResult: AT return=0 (code 0)

[DBG] Module VodafoneUSBModem.cpp - Line 236: Result of command: Err code=0
[DBG] Module VodafoneUSBModem.cpp - Line 242: ATResult: AT return=0 (code 0)
[DBG] Module VodafoneUSBModem.cpp - Line 243: APN set to live.vodafone.com
[DBG] Module VodafoneUSBModem.cpp - Line 249: Connecting
[DBG] Module VodafoneUSBModem.cpp - Line 268: Connecting PPP
[DBG] Module PPPIPInterface.cpp - Line 85: Trying to connect with PPP
[DBG] Module PPPIPInterface.cpp - Line 236: Sending ATH
[DBG] Module PPPIPInterface.cpp - Line 247: Expect ATH
[DBG] Module PPPIPInterface.cpp - Line 260: Got ATH
[len 4]odule PPPIPInterface.cpp - Line 265: Got ATH
[DBG] Module PPPIPInterface.cpp - Line 268: Expect
OK

[DBG] Module PPPIPInterface.cpp - Line 281: Got
OK

[DBG] Module PPPIPInterface.cpp - Line 286: Got
OK
[len 6]
[DBG] Module PPPIPInterface.cpp - Line 289: Expect
NO CARRIER

[DBG] Module PPPIPInterface.cpp - Line 307: Got [len 0]
[DBG] Module PPPIPInterface.cpp - Line 89: Sending ATD *99#
[DBG] Module PPPIPInterface.cpp - Line 97: Expect ATD *99#
CONNECT

[DBG] Module PPPIPInterface.cpp - Line 119: Got ATD *99#
CONNECT
[len 20]
[DBG] Module PPPIPInterface.cpp - Line 132: Transport link open
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 421: sio_read
[DBG] Module PPPIPInterface.cpp - Line 435: ret
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 421: sio_read
[DBG] Module PPPIPInterface.cpp - Line 435: ret
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 421: sio_read
[DBG] Module PPPIPInterface.cpp - Line 435: ret
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 421: sio_read
[DBG] Module PPPIPInterface.cpp - Line 435: ret
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 421: sio_read
[DBG] Module PPPIPInterface.cpp - Line 435: ret
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 421: sio_read
[DBG] Module PPPIPInterface.cpp - Line 435: ret
[DBG] Module PPPIPInterface.cpp - Line 421: sio_read
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 446: sio_read_abort
[DBG] Module PPPIPInterface.cpp - Line 453: ret
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 421: sio_read
[DBG] Module PPPIPInterface.cpp - Line 393: sio_write
[DBG] Module PPPIPInterface.cpp - Line 446: sio_read_abort
[DBG] Module PPPIPInterface.cpp - Line 453: ret
[WARN] Module PPPIPInterface.cpp - Line 359: Protocol error
[DBG] Module VodafoneUSBModem.cpp - Line 271: Result of connect: Err code=15

It seems in the end it gets looped and tries to write something over and over but fails. What is this error 15 means?

11 Dec 2012

Hi,

If you are using the HTTP client example, did you specify the correct APN in the modem.connect() for your sim? Just checking the page http://mbed.org/cookbook/VodafoneUSBModem only lists values for various contract and PAYG sims in the UK.

Cheers

Andy

11 Dec 2012

yes, I am using live.vodafone.com which is the one for prepaid cards in the Netherlands.

11 Dec 2012

Actually these are the settings
username: vodafone
password: vodafone
APN name: live.vodafone.com

11 Dec 2012

Hanze HDC wrote:

yes, I am using live.vodafone.com which is the one for prepaid cards in the Netherlands.

Hi Honours Design Challence,

the settings you require for the Netherlands Vodafone operator are:

For Contract

netid=[20404] name = "Vodafone NL" country = "Netherlands" type = "Contract" smsc = "+316540881000" apn = "office.vodafone.nl" auth = "CHAP" username = "vodafone" password = "vodafone"

For Prepay

netid=[20404] name = "Vodafone NL" country = "Netherlands" type = "Prepaid" smsc = "+316540881000" apn = "office.vodafone.nl" auth = "CHAP" username = "vodafone" password = "vodafone"

Let me know if those APN's work for you.

Kind regards, Nicholas.

11 Dec 2012

Sorry didn't fix the name on account that was created for the school project. Thanks Nicholas I will try these settings.

31 Jan 2013

Hi,

Is it possible to compile this code offline, I use the Keil MDK/ARMCC compiler? Has anybody done this yet?

Thanks, Ian

31 Jan 2013

Hi Ian,

You can use the export feature of the IDE (right-click on your program's name, select export and choose the Keil toolchain).

Donatien

31 Jan 2013

Donatien Garnier wrote:

Hi Ian,

You can use the export feature of the IDE (right-click on your program's name, select export and choose the Keil toolchain).

Donatien

Hi Donatien,

That worked great thanks. Is see that the MBED processor programs the target LPC1768 through the JTAG. I want to emulate/debug, is there any easy way to attach a uLink to the MBED or should I use another LPC1768 demo PCB (any recommendations)? Is this the correct forum for these questions?

Thanks, Ian

31 Jan 2013

Hi Ian,

If you want to do full compile/download/run/debug from MDK, then you want to use "CMSIS-DAP" - the new debug protocol.

We have an implementation of this for mbed, and you can upgrade your mbed to support this. You will need MDK v4.60 onwards for CMSIS-DAP support.

For more information, please see :

http://mbed.org/handbook/CMSIS-DAP

22 Feb 2013

Hi,

Any updates to the library to fix the issue with some sms causing it to not read properly as reported in my post of 30th November 2012?

I hadnt seen the problem for a while but it looks like its started again so in the next day or two I'll re-enable all the debug messages and have a look to see what is going on.

regards

Andrew

22 Feb 2013

Hi Andrew,

Sorry to hear about this issue. I have a small hunch about this, that I'd like to examine. I would like to try and ascertain whether or not this has something to do with the behaviour of the modem itself.

Can you tryout this program please:

Import programATConsole

This is a console for interacting with Vodafone dongles.

There are instructions on how to setup a console properly to enable backspace etc, as I didn't make it very general.

Once you have that working can you try the following and post the output (so long as it isn't sensitive, in which case, just describe if you saw anything unusual).

List all messages:

at+cmgl="all"

Note that you should type this in at the console (just to be absolutely clear as it looks like a code listing in this forum).

It shouldn't happen on the K3770 or K3772-Z, but I've noticed on others that sometimes things like read-receipts are stored.

Try reading each of the messages and see if the modem reports any errors:

at+cmgr=0

then

at+cmgr=1

and so on.

If the modem produces an error in any of those instances, then something odd is going on.

I also noticed odd errors with SMS on rare occasions, but I started to suspect it was due to the modem being powered on and off so frequently, potentially in the middle of operations. This would be a badly programmed modem, but it's not infeasible.

This could be a total red herring, but it would be interesting to see what happens.

Otherwise we need to find a way to repeat the situation in order to debug it. How often do you send messages to the device?

Ashley

P.S. I'm at MWC, Barcelona today (just landed), and next week so I won't be able to respond as much as normally.

25 Feb 2013

Hi Ash,

Just seen your response. I'll give it a try as I'm in the process of updating code on my application using the dongle so would be a good time to get to the bottom of it.

Have fun in Barcelona.

Thanks

Andy

25 Feb 2013

Tried the console application and all seems fine, no errors, a few debugs though. Sent 10 SMS and they were all handled fine.

So wondering if there are any odd characters getting into the messages that are causing problems.

Cheers

Andy

27 Feb 2013

Anyone tried this library on the FRDM KL25Z boards yet? I saw it had host USB so was wondering if it was possible, obviously with suitable usb adaptor. Guess I'll just have to try it when my boards arrive.

Could be interesting.

Thanks

Andy

28 Feb 2013

Would be great to see this on the FRDM KL25Z.

OK, as you couldn't see any issues when reading the SMS manually, that is still useful information.

I wonder, is it possible you can explain the formatting and length of the messages you send? That way, I can write a test program and I'll send several hundred to another mbed in that format and see if I get any problems.

Ashley

13 Mar 2013

QUESTION....

The Vodafone USB devices spec details a Wifi connection in additon to the 3g.. does this mean that we can use these dongles in Wifi mode using the library?

OR

Is there a way the library could be reworked to operate somethign like an edimax wifi usb dongle or dlink usb dongle?

?

MArk

13 Mar 2013

Not aware of any WiFi on the VF K3770 dongle and there is no mention of it in the code.

Andy

18 Mar 2013

Hi Andy, I found your library and I would understand if it can work only on K3770 / K3772 Huawei USB keys because they aren't so simple to find in Italy. Do you know if are there more new keys compatible to those? Or do you know if and where I could find useful informations to interface different USB keys to mbed USB Host?

Regards, Massimo

18 Mar 2013

Would be very interesting to add support for other dongles. A tutorial for trying/modifying library for adopting other modems would be fantastic.

18 Mar 2013

Massimo Manca wrote:

Hi Andy, I found your library and I would understand if it can work only on K3770 / K3772 Huawei USB keys because they aren't so simple to find in Italy. Do you know if are there more new keys compatible to those? Or do you know if and where I could find useful informations to interface different USB keys to mbed USB Host?

Regards, Massimo

Hi Massimo,

In Italy, Vodafone sells the following modems (keys) : K3806-H (Huawei) and K3706-Z (ZTE).

We are in the process of sourcing some of these to test.

Regards

Ashley

21 Mar 2013

I'd just like to share this little project that I've done using the VF K3770 dongle, including designing my own PCB to take the mbed, dongle, power supply and conenctors for a simple serial printer and a number of 8x32 LED matrix displays. It was inspired by a demo of the dongle given by the guys from Vodafone at an IoT London Meetup last year.

http://blog.thiseldo.co.uk/?p=703

Its not perfect but then how many first time PCBs are!

Enjoy!

Andy