Modem Not detected Raspberry Pi

Hi,

I am configuring my Raspberry Pi to connect to the Hologram network through a Huawei E303 device. I have followed the tutorials and it is connecting successfully. I am able to ping websites and the USB stick shows it is connecting. However whenever I try to use the Hologram Cloud through the Python SDK I get the following error.
Exceptions.HologramError.NetworkError: Modem not detected

Am I missing an important setup step? How can I specify the modem it should use? If I am understanding it correctly the usb device is my modem so since it is working what am I missing for the python SDK? Thanks for any help you can give me.

My test script is the following:

from Hologram.HologramCloud import HologramCloud
hologram = HologramCloud(dict(), network=ā€˜cellularā€™)

result = hologram.network.connect()
response_code = hologram.sendMessage(ā€œhello,worldā€)
print hologram.getResultString(response_code)

hologram.network.disconnect()

1 Like

Hi, can you paste the output of the lsusb command?

Are you going through the tutorial with the usb modeswitch steps or are you doing the one where you set everything up in the web browser?

Here is my terminal output.

I have tried both but currently my setup follows the tutorial that installs usb modeswitch but then sets everything up on the website. Is one better than the other?

Thanks

lsusb suggests that it is not in modem mode. Did you run the suggested usb_modeswitch script when you first tried it?

I too tried this lessonā€¦ .there is no mention of lsusb

  • celluar modem not detected- powereed on - yes - red light

ā€¦ I also tried this lesson and was successful - as I left a comment -positive -

I was able to connectā€¦and send basic textsā€¦Im wanting to send photos tooā€¦
ā€¦ Okā€¦ will go on to another lesson:

no modem aware on raspberry pi

sc

I was able to set up the system with "add celluar to a raspberry pi with holgoram novaā€¦
thought I would try Hologram Python SDKā€¦

heres the code:

pi@raspberrypi:~ $ sudo hologram send " test "
RESPONSE MESSAGE: Message sent successfully
pi@raspberrypi:~ $ sudo hologram send ā€œtest no network cableā€
RTNETLINK answers: File exists
RESPONSE MESSAGE: Message sent successfully
pi@raspberrypi:~ $ sudo hologram send ā€œno atcive lights on modem-yet functioningā€
RTNETLINK answers: File exists
RESPONSE MESSAGE: Message sent successfully
pi@raspberrypi:~ $ from Hologram.HologramCloud import HologramCloud
from: canā€™t read /var/mail/Hologram.HologramCloud
pi@raspberrypi:~ $

Looks like itā€™s working. Those RTNETLINK messages are warnings that can be ignored. Weā€™ll remove that in a future release.
The last line is supposed to go inside of a python script so it wonā€™t work on the command line

i have tried to connect raspberry pi to celluar with huawei e303 modem
seems even with lsusb ā€¦
not sure why raspberry pi not seeing the modemā€¦
see codeā€¦
Thanks!

pi@raspberrypi:~ $ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:c6:77:08 txqueuelen 1000 (Ethernet)
RX packets 251 bytes 22051 (21.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 68 bytes 10533 (10.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1 (Local Loopback)
RX packets 9 bytes 524 (524.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 524 (524.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:93:22:5d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

pi@raspberrypi:~ $ sudo dhclient eth1
Cannot find device "eth1"
pi@raspberrypi:~ $ lsusb
Bus 001 Device 006: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 005: ID 1c4f:0016 SiGma Micro
Bus 001 Device 008: ID 1546:1102 U-Blox AG
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~ $

Thanks for the response. Still have issue with modem

Actually, I think the issue is the inability of the raspberry pi to discover the device either as a storage or as a modemā€¦ have tried a few thingsā€¦but the modem only works (for me) if I go with the Hologram Nova installation.

First step is to have the e303 show up in lsusb.

You could also look at:
dmesg or dmesg | tail before and after plugging the e303 in.

Post the results.

I installed the usb_modeswitch like the tutorial stated. In the past I have tried running a long sub_modeswitch command which has not helped. I tried running it again but I get a message that ā€œNo device in target mode or class is found.ā€ This is the command I found:

sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x1001 -M ā€œ55534243000000000000000000000611060000000000000000000000000000ā€

Thanks

Before we go any further verify what lsusb says when you plug the e303 in.

Also confirm that you really have a e303 and not some other variant.

For the e3513 I had to use this usb_modeswitch command:
sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x1001 -M ā€œ55534243123456780000000000000011062000000100000000000000000000ā€

Maybe worth a try, however you want to do another lsusb command after running usb_modeswitch.

davef

Thanks for your help davef.

The box says its an HUAWEI e303 but all the documentation is not in English and the Raspberry seems to think it is an E353/E3131. It looks like an e303 but I canā€™t find anything that verifies that. Is there another way to tell?

I tried your new command and got the same message of No devices in target mode

It is an e303! The inside is labeled

I triedā€¦ using the lsusbā€¦ sudo nano /etc/networks/interfaces

tired hot plugin of modemā€¦
changed the code to allow for hot plug inā€¦

Perhapsā€¦ someone can write up a script or code something to download?
When I did the Hologram Nova ā€¦ i was able to get connectionā€¦
but the modem never had the full lights showing actiivityā€¦

Will get back to this project tomorrow.

I think that 12d1:14db is the HiLink mode. Did you follow the instructions to disable automatic mode switching and then reboot?

jkraft,

Have you got lusub on your RaspberryPi?

1 Like

So I think in a recent reorganization we lost the page in the docs that describes how to do this. Lemme post a few relevant excerpts.

Install the usb-modeswitch utility:

sudo apt-get install usb-modeswitch

Edit the file /etc/usb_modeswitch.conf and change the line that says DisableSwitching=0 to DisableSwitching=1

Save the file and reboot your system.

Plug the modem into a USB port. On the command line, list your connected USB
devices with lsusb. In the output you should see a line for the modem:

Bus 001 Device 006: ID 12d1:1f01 Huawei Technologies Co., Ltd.

The ID ending with 1f01 indicates that the modem is in storage mode. Switch it into PPP
modem mode by running the command:

sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x1001 -M "55534243000000000000000000000611060000000000000000000000000000"

Then run lsusb again, and you should see that the modemā€™s device ID and
description has changed:

Bus 001 Device 008: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem

Once you do this, then you should be able to use the modem with the Hologram Python SDK.

Note that if all you want is an internet connection, then you can just use the default HiLink mode and not deal with this.

Hi Reuben,

Thanks for the response.

I am a little confused. I followed those instructions but it seems to have told the USB stick to just be a memory device. After executing that it does not have a light showing it is connected and I am not able to ping hologram.io. Did it do the opposite or is it supposed to be disconnected from the 3G network in order to be used by the SDK?

Thanks