Vodafone 3G dongle example programs not working!

04 Mar 2014

Hi everyone.

Can anyone help with a problem i'm having with the sample programs which can be imported straight from the mbed website. When I import the SMS test program it comes up the an error. I then compile the program and it throws up another error. I click fix and it asks to select a library to be imported (i'm assuming because its out of date?) I cannot select the top one because it says it already exists so I try the one below it and it then compiles. But when running it it gives an error to do with 'cmsis_os.h'. I have no idea how to get it running. Due to the program using many libraries and a lot of code I do not know where to start.

Can someone help please?? I've put some images below of the errors.

Thanks in advance.

Rob

/media/uploads/robert111/mbed_image_0.png /media/uploads/robert111/mbed_image_1.png /media/uploads/robert111/mbed_image_2.png /media/uploads/robert111/mbed_image_the_error_line.png

06 Mar 2014

Hi there Robert,

Can you please try this program instead:

Import programVodafoneSMSBasics

Shows how to send and receive SMS messages using a Vodafone USB dongle.

Please let me know if this works or if you have any problems and I'll be here to help.

Ashley

06 Mar 2014

Hi Ashley

Thanks for the reply, unfortunately I didn't have any joy with that either. It all copied over ok but when compiling it I got a long list of errors. Some of which I've put pictures of below. Any ideas? Do I need to have the dongle plugged in and powered before I compile?

Many Thanks

Rob

/media/uploads/robert111/test_failure_pic_2.png

/media/uploads/robert111/test_failure_pic_1.png

06 Mar 2014

Hi again,

I've just realised I think you answered this a while ago. I've just found another answer to it when you gave me your sample program (I believe the same as the one you put on here today). I've just tried downloading this one and I still get errors when compiling but only 2! Don't know if this helps at all?

Much thanks

Rob /media/uploads/robert111/aaaaaaaaaaaaaa.png

/media/uploads/robert111/bbbbbbbbbbbbbbb.png

06 Mar 2014

Which target are you compiling for?

The errors look like you are trying to compile it for LPC11U24 which won't work.

I just confirmed this by changing the target to LPC11U24 and saw the same errors you get.

The LPC11U24 does not have a USB Host controller so it won't be able to control the dongle as a slave. The LPC11U24 only has USB Device, which means it can be the slave to a host (you can plug it into a PC for example).

You need a microcontroller with USB Host to host a USB device like a USB dongle. The NXP1768 is a good choice.

Ashley

07 Mar 2014

HI,

That's great thankyou. I am using a LPC11U24. I will purchase a 1768 (which was my second choice when getting the 11U24) and see how I get on.

Many Thanks for your help, it's greatly appreciated.

Rob :)

10 Mar 2014

Hi again, I got my 1768 and got it all connected. To start with I got some errors when compiling but they appear to have cleared now. The program seems to load ok and run but nothing happens. I was wondering if there was anything special I had to do with the 3G dongle other than just plug it in? I have connected it to my computer and made sure it is all registered and working, which it is. I have also changed the phone number to mine (putting a +44 and then taking the first zero off my number). I get a single blue flashing light on the dongle, don't know if that helps.

Thanks for your help

Rob

10 Mar 2014

Sorry, I forgot to also say. It states in the program about printing error messages. Where do these come up?

Thanks again.

13 Mar 2014

Robert,

What dongle are you using?

The messages are printed out over the mbed USB serial interface (the same cable that you program with).

Ashley

13 Mar 2014

Ashley,

I am using a Vodafone K3772 USB Internet Dongle. I am assuming this is the correct one?

I have been using Tera Term to view some values I am reading from an analog input. Should the error messages appear in this? I actually had the Tera Term working, showing values fine with the 11U25 mbed. But after swapping to the 1768 it has actually stopped working! Not sure if I need to change anything. Does a program made for the 11U24 not work when changing to the 1768? I have changed the type of mbed i'm using in the compiler (the option in the top right).

Thanks

Rob

14 Mar 2014

The K3772 works yes.

You should see outputs on tera term as long as the baud rate is correct. Which for this program I set it to 115200.

Can you enable debugging in VodafoneUSBModem.cpp? At the top of this file please change

#define __DEBUG__ 0

to

#define __DEBUG__ 4

Also it is worth changing in main.cpp

// construct modem object
VodafoneUSBModem modem;

to

DBG("Constructing VodafoneUSBModem");
// construct modem object
VodafoneUSBModem modem;
DBG("Constructed VodafoneUSBModem");

So you understand when that is finished.

Let me know if this produces output.

You should be able to change from the 11U24 to the 1768 as long as you change the compiler target. I'm not sure how it works behind the scenes, but you might want to force a "build all" just in case any object files are left around.

Ashley

15 Mar 2014

Hi

The DEBUG part was already set to 4 so I've left it like that. I changed the second part as you've shown and it all compiles and I get the message below in the teraterm window. (the baud rate was set wrong so I've changed it)

But when the message comes up in teraterm that's all I get. No message to my phone.

I really appreciate your help, looks like it's getting there a bit at a time :)

Rob

15 Mar 2014

Sorry, forgot to insert the picture! /media/uploads/robert111/screen.png

15 Mar 2014

Hi Sorry again, I've just been through it and realised I was reading the debug number from the main.cpp page. I have changed the 0 to 4 in the VodafoneUSBModem.cpp page. I now get the following in Tera Term when running it:

/media/uploads/robert111/oh_dear.png

21 Mar 2014

Hi

am trying to connect Vodafone 3G modem with mbed, but am using Qatar Vodafone modem is that make any difference ?? also I compile your code ashley. it compiled successfully and when i press rest the modem start blanking but no massage received ? I don't know where is the problem

Thank you

24 Mar 2014

I'm a bit concerned that the character output doesn't look sensible in teraterm. Are you using some kind of special char set?

24 Mar 2014

Hi. Yes I agree, the output does look like something martians would send if they wanted to get in touch! Thankfully I have managed to solve that problem. I made the alterations you suggested for debugging and I now have a readable output. Unfortunately it gets as far as trying to connect which comes up many times and then it times out with the "a dongle was not found, check it is switched on and connected" error.

The only other thing I noticed was the changing of the APN to suit the dongle and type of pay scheme you are on. I have tried changing it in the vodafone file but still cannot get it to connect. Is it only the one place in that Vodafone file I need to change the apn? I notice there are two consecutive bits of code concerning the apn. Didn't know if i change both our one of them?

Many thanks Rob

24 Mar 2014

You don't need to issue a connect to send and receive SMS. connect is only for data sessions.

How have you wired up your dongle to the mbed?

Ashley

24 Mar 2014

Oh right. I didn't realise that. I assumed it would need to connect for anything. I have powered it using a separate supply as shown on the mbed page. Then I just have the D+ and D- connected to the USB D+ and D- on the microcontroller. I know the dongle has power as it lights up. Thanks Rob

24 Mar 2014

What is the color of the light flashing on the dongle?

Also, can you paste the debug output now that you've de-garbled it?

24 Mar 2014

The light flashes green when first powered on but then changes to blue. Its a single intermittent flash. Below is the code I get in tera term. This is after changing the debug value to 4 as you suggested and also the Constructing VodafoneUSBModem part you said to also change in the earlier thread.

I appreciate your help. Rob

/media/uploads/robert111/untitled.png

24 Mar 2014

I'd just like to check I have the D+ and D- connections correct. The pin layout diagram shows the D+ on 31 and the D- on 32. But in the biro hand drawing on the dongle overview page it shows it the other way round? I assume the pin layout diagram is correct? Which is the way I have connected it.

Rob

24 Mar 2014

Should have put this picture in too. This is the tera term display when I reset the mbed and it starts to run.

/media/uploads/robert111/start_of_running.png

24 Mar 2014

Yes D+ should be on 32 and D- on 31.

The green flashing means it is searching for a signal, but the blue intermittent means that it is registered on the network.

The output looks strange, like the dongle isn't recognised.

Can you turn on debugging on in USBHostWANDongle/USB3GModem/WANDongle.cpp to 4?

Ashley

24 Mar 2014

I turned on the debugging in that file and I get the following output in tera term. Still looks like its not picking it up or recognizing it.

/media/uploads/robert111/dongle_1.png

/media/uploads/robert111/dongle_2.png

25 Mar 2014

OK the error messages imply that it can't even enumerate the USB device.

Are you sure it is wired up correctly to the 1768?

You could try switching the lines around just in case.

Also, can you do a continuity test on your lines just to check they are actually wired up?

Does the dongle work in a laptop?

Ashley

25 Mar 2014

I swapped the D+ and D- wires over and it now see's the dongle!! I get different message in tera term (below) but it still fails to connect?

/media/uploads/robert111/dongle_working.png

25 Mar 2014

This tera term picture above is after I changed the APN to "smart". I changed it back to the original one, the Vodafone one, and this is the message I get in tera term. It then times out with no dongle connected error, the same as before.

/media/uploads/robert111/piccccccccc.png

/media/uploads/robert111/last.png

25 Mar 2014

Why are you trying to connect anyway?

I thought you were trying to send SMS?

25 Mar 2014

I thought the program was to send SMS. I have not changed it. I believe this is the one you told me to try.