Vodafone 3G dongle example programs not working!

25 Mar 2014

This is the SMS program and it does not have a call to "connect":

Import programVodafoneSMSBasics

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

Is this the program you are using?

25 Mar 2014

I thought that was the one I was using. I have just imported the one above and compiled it and I get different results in tera term now. Apologies if I ended up with something different during all the messing about. I enabled debugging in the WANDongle.cpp and the VodafoneUSBModem.cpp files. This is what I am getting now. This continues and then just stops with the "found one device reset it" message. /media/uploads/robert111/dongle11.png

Sat watching it for a minute and it comes up with the error sending test sms line. /media/uploads/robert111/dongle_2222.png

26 Mar 2014

This is incredibly strange. The implication is again that you can't even connect to the USB device.

  1. Does the device work in a laptop?
  2. Are you sure it is a K3772?
  3. Are you sure the wiring is correct?

I don't really know what else to suggest, since this is the simplest program.

Can you send a picture of your setup?

Ashley

26 Mar 2014

It does seem a bit strange. The dongle is a k3772 but I've ordered a 3770 which should arrive today/tomorrow. I can try that one when it gets here. I have double checked the wiring and all seems Ok, I will double check the dongle in my laptop after work today and make sure there are no issues there. If I still get no joy I shall let you know and post a picture of the set up.After that I'm a bit lost. Not really sure what to try next! I appreciate all your help and will get back to you after I've tried those few things. Many thanks Rob

26 Mar 2014

Thanks for sticking with it. I'm sure we'll find the solution eventually. There is something strange happening here.

BTW, are you using the resistors that they recommend in the diagram? I never use those, as I believe that the NXP1768 has internal ones.

One thing you could also check for me, can you send SMS from the SIM to itself if you put the SIM in a phone?

Ashley

26 Mar 2014

Yes I'm sure we'll get it going. I am using the resistors from the diagram. I will try disconnecting them to see if that helps. If they are not needed I will probably leave them out anyway. That's a good idea. I shall try the sim in a phone when I get home today and check that works. I'll let you know how I get on. Thanks Rob

26 Mar 2014

I removed the resistors. Still no joy. I checked it in a laptop and it connected and everything but couldn't bring web page up. To make sure I rang up and put 10 pound on it but still get no joy. I've put a picture on of the setup. The D+ and D- are reversed in the picture but I have been trying them both ways. I am completely lost to be honest. The only other thing I can try is the other K3770 dongle when it turns up (hopefully tomorrow).

/media/uploads/robert111/20140326_160600.jpg /media/uploads/robert111/20140326_160606.jpg

26 Mar 2014

Hi Robert,

Just to let you know I tested the program again here just to be sure and it works fine for me, first time.

It looks in your layout that you do not have a common ground for the modem and the mbed, can you please try tying these grounds together?

Ashley

26 Mar 2014

I have just connect a link between the ground on the mbed to the dongle power ground and I get jibberish in tera term again. But the code appears to be different, it looks likeit has worked but has come up with an error sending sms message. /media/uploads/robert111/untitled.png

26 Mar 2014

sorry that's the wrong picture. /media/uploads/robert111/untitled.png

26 Mar 2014

I feel bad for your constantly uploading images. Isn't it possible just to cut and paste the output into a <<code>> block?

26 Mar 2014

Bloody hell, cant even put a picture on here now! ha ha

/media/uploads/robert111/error_message.png

26 Mar 2014

OK well the first thing is to ensure that you can have some sensible output.

It's probably worth powering the mbed from the 5V line on your regulator too, just to ensure that things are sane.

Can you get the tera term to produce something non-gibberish? Perhaps try unplugging the serial cable and back in again?

Ashley

26 Mar 2014

Bit late to the party.

I'm trying to figure out why it keeps on resetting the dongle?

Robert - can you share your code with us so that we can replicate? You don't need to change the APN for SMS. You are doing the right thing by starting with SMS tests first.

Kind regards, Nicholas.

26 Mar 2014

I have put power form the regulated supply to the mbed and I now have a non-jibberish output :) But its still not working :( /media/uploads/robert111/error_1.png

26 Mar 2014

OK well it looks like that everything upto connecting the dongle works now, and you get a correct registration.

This is good. You are now much closer to success. I have faith that we are getting somewhere.

What is troubling in the above output is that it says "Using an Unknown Dongle". This is very suspicious.

26 Mar 2014

I will not give up!!! ha ha I thought i'd start with the SMS program because like you say, it "should" be the simplest. In the end I need to use the dongle to send info to some sort of web page for viewing. That seems a long way off at the moment :)

26 Mar 2014

Yes I thought the unknown dongle bit was strange. It will be interesting when I try the other one when it arrives.

26 Mar 2014

Robert,

can you put the SIM into a normal phone and send an SMS first? Or have you done that already? And can you tell me if it is a Vodafone SIM?

Kind regards, Nicholas.

26 Mar 2014

Well it should all be very straightforward.

At least we identified one problem now, which was that your dongle was not wired up correctly.

Now that it is sorted, things should work, assuming the dongle is the right one.

It might be that you have a K3772 from a different batch or something silly that has a different vendor ID, in which case some small changes would be needed.

If you get the K3770 tomorrow, that would be great to test it.

In the meantime, can you check that you can send SMS using the SIM card in a normal phone (just send an SMS to self)?

Also, can you delete all the SMS from the SIM using the phone, and try again.

Ashley

26 Mar 2014

I am currently trying to find an old Vodafone or unlocked phone I can try it in. It is a Vodafone sim, it came with the dongle. The box says: Vodafone K3772 Pay As You Go USB Internet Dongle FCCID: QISK3772. After that i'm lost i'm afraid.

26 Mar 2014

Can you do one thing for me and show me the output from enabling debugging in WANDongle.cpp ?

I would like to see what VID and PID the dongle proclaims.

26 Mar 2014

This is the output after turning that on. To be honest, I've run it a few times and I seem to get something different each time?? /media/uploads/robert111/error_1.png

26 Mar 2014

Sorry wrong picture again.

26 Mar 2014

/media/uploads/robert111/so_annoying.png

26 Mar 2014

OK so the dongle is being picked up successfully as a K3772. I just realized that the library doesn't have a message to tell you that.

I just added a message to the library so it at least prints that out, if you update the library it should now tell you that it's using a K3772.

So the only problem now is sending the SMS.

This can happen for a couple of reasons.

  1. The SIM does not have an SMS pack
  2. Somehow the SMS memory of the SIM got messed up and needs clearing on a phone (shouldn't really happen and is a bug if it can't recover itself).

You need to test it on a phone to check, or double check that you actually have an SMS pack.

You should also be able to try an IP test now, using the connect() function and the correct APN, to see if that works.

26 Mar 2014

As its an internet dongle I brought its possible it cant send sms. I will try to get hold of a phone to try it in. Hopefully the K3772 will be able to when it comes. Sorry for the lack of knowledge, but how do I do an IP test? Is that a case of running one of the other test programs like the websocket one and setting the APN in the progam?

26 Mar 2014

SUCCESS!!!!!!! I have just set up the websocket program and have a message coming up on my own channel! Clearly the dongle doesn't like SMS! But I couldn't care less now as I was only trying the sms as a starting point. Its the sending of data to a website im concerned with :) Thankyou so much for your help. You have no idea how much I appreciate it. It's incredible how much you learn when having trouble like this. I certainly have some info I will share on the 3G Vodafone page, it may help some other people. Again, thankyou so much. On a side note, would you be able to give advice on displaying information graphicaly, bar charts or the like, on a web page which can be viewed?

Thank you Rob

27 Mar 2014

Great!

I'm so pleased you got this working eventually. So in summary the problems were:

  1. Power sources of mbed and dongle were not tied together
  2. SIM did not have an SMS bundle

I can give some advice on displaying a chart as I've done it before, I'll explain what I did:

  1. nodejs server listening on port 80 to serve the html for the graph
  2. the html served contains javascript which renders the graph using http://dygraphs.com/. I used dygraph after trying many others because it was the only one I tried that supported dynamic updating that didn't glitch out in some way, although it doesn't look the smoothest.
  3. the html retrieves the dataset from the server (from a redis database) via a restful API and renders it
  4. the html also sets up a websocket connection to the server
  5. the mbed records the temperature and sends it to the server in a json message (another listener on the server was used for this)
  6. the server stores the value in a redis key-value store, with a key designed in a way that makes searching easy
  7. the serer pushes an update along the websocket connection to the html client
  8. the html client renders the update

I would say from this, don't bother with dynamic graphs, unless you only show a short window, otherwise, once you get to a large dataset, the dynamic updates are not even visible so it's pointless.

Note that the above solution doesn't have any security.

I've also built something like this in django that receives CoAP messages via a proxy, and has full security.

There are lots of way to build such a system, they are all a little bit involved for a beginner if you want to have dynamic updates, but definitely a good learning experience. Good luck!

Ashley

27 Mar 2014

Yes it seems they were the problems. Probably should have looked closer at the dongle info! But never mind, it's working now. Thanks for all your help.

That all sounds pretty complicated! Thanks for the info though, I'll have a try and see how I get on. Only being a measurement of level of a fuel tank means security isn't really an issue. Definitely a steep learning curve :)

Thanks very much

Rob