Trouble setting up Huawei E3531s-2 with "SMS notifications via GSM-modem" Integration

Hey everyone,

First of all:
I’m usind HomeAssistant 2022.9.5 on a Raspi 3B,
Supervisor 2022.08.6
on HomeAssistant OS 9.0

Stick information:
Model: HUAWEI E3531s-2
Hardware: CH1E3531SM
Software: 22.318.27.00.00
WebUI: 15.100.10.00.40

I’m trying to set up SMS transmission via the “SMS notifications via GSM-modem” Integration with a Huawei E3531s-2 surfstifk which should be compatible.
My problem tho: After inserting the stick, rebooting and trying to add the integration, it reports a “DEVICENOTEXIST” error and the stick isn’t listed as a serial device, rather as a storage device.
From other forum posts I’ve gathered, that sometimes setting up usb-modeswitch is necessary ( see here which I’ve done, but still, the stick doensn’t seem to get recognized properly.

LOG:

2022-09-19 09:53:39.284 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-19 09:53:39.295 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration waste_collection_schedule which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-19 09:53:59.896 INFO (SyncWorker_3) [fritzconnection] Unable to retrieve resource 'http://192.168.178.4:49000/igddesc.xml' from the device.
2022-09-19 09:53:59.928 INFO (SyncWorker_6) [fritzconnection] Unable to retrieve resource 'http://192.168.178.5:49000/igddesc.xml' from the device.
2022-09-19 09:54:02.938 ERROR (SyncWorker_5) [fritzconnection] Unable to get a connection: HTTPConnectionPool(host='192.168.178.6', port=49000): Max retries exceeded with url: /igddesc.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f98a6f700>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2022-09-19 09:54:05.686 WARNING (MainThread) [homeassistant.config_entries] Config entry 'MeshAP-Schlafzimmer' for fritz integration could not authenticate: Unable to get a connection: HTTPConnectionPool(host='192.168.178.6', port=49000): Max retries exceeded with url: /igddesc.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f98a6f700>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2022-09-19 09:54:17.896 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of binary_sensor platform fritz is taking over 10 seconds.
2022-09-19 09:54:17.921 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform fritz is taking over 10 seconds.
2022-09-19 09:54:17.942 WARNING (MainThread) [homeassistant.components.update] Setup of update platform fritz is taking over 10 seconds.
2022-09-19 09:54:17.997 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of binary_sensor platform fritz is taking over 10 seconds.
2022-09-19 09:54:18.007 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform fritz is taking over 10 seconds.
2022-09-19 09:54:18.016 WARNING (MainThread) [homeassistant.components.update] Setup of update platform fritz is taking over 10 seconds.
2022-09-19 09:54:18.021 WARNING (MainThread) [homeassistant.components.light] Setup of light platform group is taking over 10 seconds.
2022-09-19 09:54:18.029 WARNING (MainThread) [homeassistant.components.light] Setup of light platform group is taking over 10 seconds.
2022-09-19 09:54:18.034 WARNING (MainThread) [homeassistant.components.light] Setup of light platform group is taking over 10 seconds.
2022-09-19 09:54:18.117 WARNING (MainThread) [homeassistant.components.button] Setup of button platform fritz is taking over 10 seconds.
2022-09-19 09:54:18.137 WARNING (MainThread) [homeassistant.components.button] Setup of button platform fritz is taking over 10 seconds.
2022-09-19 09:54:18.142 WARNING (MainThread) [homeassistant.components.camera] Setup of camera platform generic is taking over 10 seconds.
2022-09-19 09:54:18.892 ERROR (MainThread) [metno] Access to https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/complete returned error 'ClientConnectorError'
2022-09-19 09:54:18.926 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Home' for met integration not ready yet: Update failed: ; Retrying in background
2022-09-19 09:54:25.170 WARNING (MainThread) [homeassistant.components.media_player] Setup of media_player platform dlna_dmr is taking over 10 seconds.
[SHORTENED]
2022-09-19 10:35:45.152 ERROR (MainThread) [homeassistant.components.sms.gateway] Failed to initialize, error ERR_DEVICENOTEXIST

Does anyone hav an Idea why the stick isn’t working?

Maybe it is in HiLink mode (native) and it is not recognized as a serial modem…

Look at this post to convert (maybe try the procedure more than once, I had also some difficulties to convert my E3531 at the time, I have now two sticks E3531 in prod on two separate HA instances with capability to send and receive SMS, so they work with HA last version as well as Hass.OS last version). Look at the post N°3 from Oscar_Calvo… This is maybe the problem…

hey browet,

Funny that you mention this exact post, as I’ve already read it but couldn’t include a link to it in my post (new users apparently can only post 2 links in any post)
After reading your post, I’ve checked again, that the .rules file is correctly present in /etc/udev/rules.d/10-gsm-modem.rules but it isn’t there. (location taken from here)
Maybe I’m doing the whole “USB Config Stick” thing wrong.
Just to clarify: I’ve formatted a 16GB stick with FAT32 (alternatives would be exFAT or NTFS), named it CONFIG and created a folder named udev. I’ve then created a file named 10-gsm-modem.rules into which i placed the following config:

ACTION=="add" \
, ATTRS{idVendor}=="12d1" \
, ATTRS{idProduct}=="14dc" \
, RUN+="/sbin/usb_modeswitch -X -v 12d1 -p 14dc"

(copied from the post you’ve mentioned, but with another productId. Also: The file is with LF line ending (atleast notepad++ says so)
When I plug in the USB Stick and “import from USB” (or reboot the sholw system), nothing seems to happen, and I can’t find any log describing it doing anything.
Maybe I’m doing something wrong here?

Very strange, I do not recognize the content of the file (udev) that I used to convert mine to serial modem…
When you type “lsusb” in a terminal with your modem connected to the raspberry pi what is the response for the device with idvendor 12d1 ?
Is it 12d1:1f01 ?

I had something more like this (but I am unable to find back the file I used):

ACTION=="add" \
, ATTRS{idVendor}=="12d1" \
, ATTRS{idProduct}=="1f01" \
, RUN+="/sbin/usb_modeswitch -v 12d1 -p 1f01 -I -M '55534243123456780000000000000011062000000100000000000000000000' "

after “lsusb”, the productid is 14dc, which after searching for on a usb product lookup page refers to a huawei 3372h (huh?), not a huawei e3531. After researching further, it seems that 14dc is a product id for huawei modems with a hilink firmware, that doesn’t support serialmode, just eth mode. bummer.
I’m now trying to downgrade to an earlier firmware in hope of getting back that precious serial mode which is what i bought the device for.
Wish me luck!
Also: If anyone has some document on how to do that, a pm or something would be very helpful!

Well, before trying to downgrade the firmware, did you try to plug it into a PC and use huawei HiLink on that PC ? It is maybe just that you forced to change the product id… I would try it first

what do you exactly mean by

?
Just plugging it in (represents itself as a network adapter) and using it to connect to the internet?
if so, yes, I did. works fine.

What exactly do you mean with that?

You need to follow this guide to downgrade the firmware:

This guide is linked from the sms documentation. Please post your results.

1 Like

So. After two hours of fiddeling, I finally got it to work by downgrading to a 21.XX Firmware.
Here’s a short writeup of what I’ve donw, maybe it’s helpful to somebody else in the future.
Everything was tested with a Huawei E3531s-2 GSM Stick with Firmware 22.318.27.00.00, other sticks might behave similar.

  1. Open Huawei Unlockcode Generator, enter the IMEI of your stick and press the button below. Then, write down the generated codes. (in some cases, you’ll need the flashcode to update the stick)

  2. Open this website and download the given .zip file. (if, like in my case, the download doesn’t work, you may download the .zip file from here, this download is also linked to in the comments ot the website.

  3. download a Ver. 21.XX firmware package for your stick, a package for the E3531 may be found here.

  4. extract both downloaded files.

  5. Open the [1] Mobile Broadband HL Service folder inside the Huawei_3372h-153_hiLink-to-Stick folder and execute the given mbbServiceSetup.exe.

  6. Open the [2] DataCard driver and execute the DriverSetup.exe.

  7. plug the gsm stick into the computer and wait until it has booted up successfully (this should be indicated by a browser window opening with the stick’s webui). Then, open the [3] Switchmode E3372h folder and execute the given sw_project_mode.cmd. The browser window should become unresponsible and in Devicemanager, a COM Port, named PC UI (or similar) should appear.

  8. Open the downloaded firmware package end execute the given firm update. If you get a ERROR 10: PORT not found, that means the stick hasn’t exposed a PC UI interface.
    If everything went well, the Stick should expose a network adapter called HUAWEI Mobile Connect - Network Card

  9. Congratulations, now your stick should have a firmware Version 21.XX and you may use with the sms integration. (Note: As I’ve read, on some firmware versions, further actions might be required. if so, continue from step 12 on this page. These steps require you to connect to the stick using a serial terminal. These Settings worked for me:

Baudrate: 75600
Data bits: 8
Stop bits: 1
Parity: None
Flow controll: none/off
2 Likes

I have the E3531 on firmware 22.xx and need to downgrade for the SMS integration. At step 8 I get this error with the Updater, and cannot progress. The COM ports are showing as should be. Any ideas?

image

Hey, sorry for my late response. Somehow I didn’t receive the notification e-mail.
About your problem: While I didn’t have this exact problem, I’ve, IIRC, read somewhere that error 16 might appear if:
a) you do not have the correct firmware downloaded
b) your device might have a firmware which doesn’t allow flashing anymore

Hi!

Is there any way you would/could share the needed .zip file, since both links in step 2 are broken?
I would really like to make this work too with my E3531, but without the needed .exe files I am stuck.

Thanks!

1 Like

Files in Zip:
sw_project_mode.xml

<?xml version="1.0" encoding="UTF-8" ?> 
<api version="1.0">
  <header>
    <function>switchMode</function>
  </header>
  <body>
    <request>
      <switchType>0</switchType> 
    </request>
  </body>
</api>

sw_project_mode.cmd

@curl -X POST -d @sw_project_mode.xml http://192.168.8.1/CGI
@pause

found here: sw project mode.cmd - sw_mode_E3372_new - Huawei E3372 - roperper - Chomikuj.pl

Other Method: Flashing a Huawei E3372h 4G LTE stick from Hilink to Stick mode – 0xf8.org

So apparently both .zip files are dead. So the just two years old info for flashing is already useles… awesome…

1 Like

I feel you -.-