Announcement

Collapse
No announcement yet.

FYI: Fully working El-Cheapo £5 / $6 GSM USB Modem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FYI: Fully working El-Cheapo £5 / $6 GSM USB Modem

    After many hours messing around trying to get my el-cheapo USB dongle working with SMS Gateway, I finally managed it.
    Sadly, it took me a long time of messing around only to find that it was something very simple stopping it working.
    So as there is no support for this SMS-Gateway even though it's a premium plugin, I thought I'd briefly note down my findings in case it helps anyone else.

    The modem is a Huawei E1752 GSM dongle and I decided to purchase it from eBay. It was cheap because, 1) it was locked to Orange Mobile, 2) there are loads of them on eBay, 3) it's a little old now and doesn't support the latest technology.

    I knew I could unlock it for free, I've done a few before, so buying the locked version cost me only £4.99.

    First up, I needed the latest drivers from Huawei for Windows 10. Get them here; https://huaweidrivers.com/huawei-e1752/

    Once installed, you now need to get the unlock codes and software to unlock the modem.

    I used the following website to produce the unlock codes > https://huaweicodecalculator.com/new-algo/index.php

    and this website to download the Huawei Modem Writer > https://routerunlock.com/download-hu...-by-sagmaster/

    Once the code it generated you can use the writer to unlock the dongle, it took only a few minutes to complete the whole process and now I can use any sim in it.

    The dongle itself does not need any custom initialisation strings entering into the plugin configuration page, it should work just fine. However, there is one more important step before we can use the modem in SMS Gateway! We need to change the mode of the modem to serial mode.
    In normal mode, the dongle has a storage area that is available to windows, just like a memory stick, which hosts the connection software installer. In this mode the modem will not respond to serial commands as we want. In order to address this, open up a terminal such as Putty, connect to the com port for the modem, and issue this command;

    Code:
    AT^U2DIAG=0
    Note; ^ and not the usual +

    If all goes well and the code is accepted, the modem will now be in serial mode. Note that you can return to the previous configuration anytime you want, and while there are quite a few options, I would advise you reset to factory mode using
    Code:
    AT^U2DIAG=276
    .

    At this point I would physically unplug and replug your modem.

    Here are the issues I had while trying to get the modem working, although the first issue was specific to my system and not the modem.

    Issue 1 (Not modem specific)
    Simply put, my security software was blocking the SMS Gateway plugin from working. The software utilises HIPS and various other protections that sandboxed the plugin files.
    This led to errors when trying to activate the plugin. I simply marked them as trusted files within the software.

    Issue 2 (The main issue)
    After the modem was installed and working properly, I had the modem listed in device manager like this:
    Click image for larger version  Name:	img1.jpg Views:	0 Size:	67.9 KB ID:	1316003
    After finding the com port of the modem by clicking on it in device manager, I entered this com port into the SMS Gateway plugin page and clicked enable.
    The plugin activated, the modem was initialised and I thought hell yeah. So I tried creating an event to send off an SMS to my phone when I turned on the outside light, it worked perfectly. Job done... or so I thought!

    The ability to send SMS to my homeseer system and trigger events is more important to me than receiving SMS, so I tried sending an SMS to the GSM Modem and watched in the log for it to be recognised. It never happened, and here lies the problem. I messed around for a few days altering the modem via AT Commands via the Putty terminal. The modem responded as expected to all commands. It should do, the modem is specified as being fully compliant with GSM blah blah. I tried changing SMS notification settings until I was blue in the face, but nothing ever got it working properly. In other words, sending SMS worked fine from Homeseer, receiving did not. The SMS's were never logged as coming in.

    If I should happen to restart the plugin, the SMS memory count in the SIM was recognised i.e. 4/20 and then deleted as they should be, but SMS sent to the modem while the plugin was enabled were never recognised.

    I tried turning on SMS polling in the plugin, this did not work either for some reason, though I eventually got this working by altering some proprietary Huawei modem settings via Putty. I won't go into detail about that, as I didn't want to rely on polling when I knew the modem should work without this option.

    I was ready to give up on this issue, until I happen to come across some hidden device in Windows device manager, specifically, if I went to the 'View' menu in Device Manager, and selected 'View Devices by Container' I happened to find some extra components for the GSM Modem, as below;
    Click image for larger version  Name:	img2.jpg Views:	0 Size:	75.9 KB ID:	1316010

    These hidden components/modes are not usually hidden if you have the modem in normal mode and not serial mode. Further, in either mode, the components each utilise a com port.

    Now, here is where it gets a little interesting. The modem component we had been accessing was technically the correct component that accepts 'all' AT Commands!
    The PC UI Component or 'Mode' accepts AT Commands also, but not all of them, as can be found when using Putty, it just gives errors on some of the commands.

    From what I understand, the component/mode I was originally using to access the modem was the correct one, but for some reason the SMS notifications do not work correctly when using it with SMS Gateway. As soon as I changed the com port in the plugin to use the hidden PC UI component, the modem started working perfectly including the receiving of messages.

    Perhaps someone here knows why, perhaps they can offer a better explanation? Until then, maybe this post will help someone else in a similar position.


    One more thing, make sure that power saving in Windows cannot sleep the USB ports, as in;

    Click image for larger version  Name:	img3.jpg Views:	0 Size:	90.0 KB ID:	1316011

    It's a bit **** that there is zero help on a premium plugin! Perhaps Homeseer should consider having a better Developer > Customer policy, whereby if no support is available, the plugin becomes free!

    #2
    Thanks for the detailed writeup on how to make your el-cheapo modem work with the plugin. Unfortunately most of the issues you describe are not really related to the plugin but to navigating Huawei's complex unlocking procedure and finding the right Windows device to communicate with.

    I'm sorry it took a few days to respond to your requests for help, the plugin is still actively supported. If I recall, there is mention on this forum and in the manual of disabling sleep-mode for USB devices (and that's why the polling was introduced too, to try and keep the device alive). Thats likely the source of the plugins inability to receive notifications when new messages arrive.
    Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

    Comment


      #3
      Hi.

      The disabling of sleep was one of the first things I did, before I even tried the modem. It's part of life with Windows devices and permanently on media servers I run.

      The modem never received a message notification at all, ever, until I changed to the GSM PC UI Interface which as I outlined is hidden away. The main GSM com device would only send messages. I couldn't find much in the way of timeouts, keep alive or sleep references in any Huawei pdf so I could only assume we are dealing with USB states.

      However, like I said in another post, when I tried sending custom init commands via the plugin, the logs showed the command accepted only then to be overwritten by what I assume to be a 'built-in' command a few moments later.

      Example. I set custom init command as AT+CNMI=1,1,0,0,0. The log shows an ok response from the modem, then a few more seconds pass and AT+CNMI=2,1,0,0,0 is sent with an ok acknowledgement. I can't remember the exact values I was using however.

      Glad to hear the plugin is still supported though. A few more weeks testing and I'll definitely be purchasing it.

      Comment

      Working...
      X