Altitude-Tech / IOTBit_Install

Install scripts for the IOTBit HAT.
6 stars 7 forks source link

Init Failed when launching wvdial #1

Open manthis opened 7 years ago

manthis commented 7 years ago

Hello,

Just set up the PiAnywhere shield which went without errors. Now when I try to start wvdial, I get the following error: "Init Failed". Here is the output:

--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ERROR
--> Bad init string.
--> Initializing modem.
--> Sending: ATZ
ERROR
--> Bad init string.
--> Initializing modem.
--> Sending: ATZ
ERROR
--> Bad init string.

It seems it doesn't like the ATZ command. Could you help please?

sciosense commented 6 years ago

Hello,

I have the same issue. Just installed a Raspberry 3 with a Jessie Image. Installation didn't work at all for Raspbian Stretch at all.

GPS is working fine as long as the Raspi is outside the house. Inside or close to a window it is not connecting.

I just added a SIM (which is working fine in a phone). But I'm getting the same errors as manthis. It doesn't like ATZ command.

Using minicom -D /dev/ttyUSB2 and AZ works fine.

Any ideas, hints, proposals what to check?

pabb85 commented 6 years ago

Same issue here. 4G IoTBIT, latest Raspian, did not run install script (as per guidance for this version) but getting the following;

---begins--- pi@raspberrypi:~ $ lsusb | grep Qual Bus 001 Device 006: ID 1e0e:9001 Qualcomm / Option pi@raspberrypi:~ $ cat /etc/wvdial.conf [Dialer Defaults] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init3 = AT+CGDCONT=1,"IP","YOUR.SIMCARD_APN.HERE" Modem Type = Analog Modem Baud = 720000000 Stupid Mode = 1 New PPPD = yes Modem = /dev/ttyUSB2 ISDN = 0 Phone = *99# Username = [] Password = [] pi@raspberrypi:~ $ sudo wvdial --> WvDial: Internet dialer version 1.61 --> Initializing modem. --> Sending: ATZ ERROR --> Bad init string. --> Initializing modem. --> Sending: ATZ ERROR --> Bad init string. --> Initializing modem. --> Sending: ATZ ERROR --> Bad init string. ---ends---

...I realise the conf file will need the APN etc but we're not even getting to that stage.

Can you help on this please?

P.

pabb85 commented 6 years ago

Okay chaps - after a late night and a lot of messing around with various patches and approaches... I've solved this problem.

Turn your SIM card the other way around. Seriously. sigh

As per https://cdn.instructables.com/FA6/HW8F/J9SVR0NC/FA6HW8FJ9SVR0NC.LARGE.jpg the corner notch should be towards the OUTSIDE of the device board.

Issue closed?

ghost commented 6 years ago

Hey,

i have the same issues. Sending ATZ to the Modem comes out with ERROR --> Bad init string. (...)

as seen above. Even though the installation failed. First there's a problem running rpi-source, which i have to tun as rpi-source --skip-gcc. Then it works.

Second: there's a mistake in IOTBit_Install.sh line 14. It should be sudo mv /home/pi/iotbit_Install/GobiSerial (...).

When i try dkms build -m GobiSerial -v 2011-07-29-1026 then i get a mistake:


pi@raspberrypi:/usr/src/GobiSerial-2011-07-29-1026 $ sudo dkms build -m GobiSerial -v 2011-07-29-1026

Kernel preparation unnecessary for this kernel. Skipping...

Building module: cleaning build area... make -j4 KERNELRELEASE=4.9.80-v7+ -C /lib/modules/4.9.80-v7+/build M=/var/lib/dkms/GobiSerial/2011-07-29-1026/build...(bad exit status: 2) Error! Bad return status for module build on kernel: 4.9.80-v7+ (armv7l) Consult /var/lib/dkms/GobiSerial/2011-07-29-1026/build/make.log for more information.


Right now the sim card is not in the HAT.

Raspberry running on Stretch.

Anyone?

Edit: took a look to the troubleshooting page. lsmod | grep GobiSerial displays nothing.

when i run minicom -D/dev/ttyUSB2 and send an AT command, the response is "OK".

i really don't know that's the problem there. any ideas?

pabb85 commented 6 years ago

Hi @robwim - please try with the SIM in the modem, it won't let you initialise without. Or as I found out, with the SIM in the device in the wrong direction...

(N.b. - For newer kernels and raspian releases you won't need to run the install script)

ghost commented 6 years ago

Hi @pabb85 - thank you for the very fast reply.

You're telling me, that it doesn't let me install any drivers without the SIM card in the Modem?

Which Raspbian are you running? Can you confirm that it works on Stretch? And, did you also have the mistake in the IOTBit_Install.sh?

pabb85 commented 6 years ago

Hi @robwim - no, rather that the driver installation is not necessary on newer/latest versions of raspbian. I can dig up my notes from the install tonight if you like but this is my experience so feel free to ignore the install script.

Might be worthwhile extracting the apt-get line from the script and running/installing these items manually, I did this.

I was running latest Raspbian - as of last week - again, can get exact version when I return home.

sciosense commented 6 years ago

Hi @robwim,

I’m using Raspbian Stretch for the installation. The script worked for my side (even without the SIM card). I can also connect to network using wvdial. Unfortunately I get random disconnects of ppp0 and I could not figure out the root cause. It’s pretty annoying.

I realized that the serial ports change from time to time. Typically you will get /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3 /dev/ttyUSB4 after startup. But sometimes it changes to /dev/ttyUSB0 /dev/ttyUSB2 /dev/ttyUSB3 /dev/ttyUSB4 /dev/ttyUSB5 or some other numbers. Afterwards the wvdial will not work anymore.

To improve situation (maybe), I used persistent USB port names with the following rules.

IOTBit

IMPORT{builtin}=”usb_id” SUBSYSTEMS==”usb”, ENV{ID_USB_INTERFACENUM}=”$attr{bInterfaceNumber}” SUBSYSTEM==”tty”, ATTRS{idVendor}==”1e0e”, ATTRS{idProduct}==”9001”, SYMLINK+=”ttyUSB-IOTbit$env{ID_USB_INTERFACE_NUM}”, MODE=”0666”, GROUP=”dialout” Now I can refer to ttyUSB-IOTbit_02 in wvdial and don’t care about changes in ttyUSB numbering.

Best regards, Christoph

From: pabb85 [mailto:notifications@github.com] Sent: Dienstag, 12. Juni 2018 14:34 To: Altitude-Tech/IOTBit_Install IOTBit_Install@noreply.github.com Cc: Christoph Friese christoph.friese@ams.com; Comment comment@noreply.github.com Subject: Re: [Altitude-Tech/IOTBit_Install] Init Failed when launching wvdial (#1)

Hi @robwimhttps://github.com/robwim - no, rather that the driver installation is not necessary on newer/latest versions of raspbian. I can dig up my notes from the install tonight if you like but this is my experience so feel free to ignore the install script.

Might be worthwhile extracting the apt-get line from the script and running/installing these items manually, I did this.

I was running latest Raspbian - as of last week - again, can get exact version when I return home.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Altitude-Tech/IOTBit_Install/issues/1#issuecomment-396572762, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AlLchvOpNauEWrCLfzSM1c3PTKjqNY8vks5t77UdgaJpZM4NOOUd.

ghost commented 6 years ago

Hi @pabb85 - would be great if you could post your notes from the install.

I just made a fresh install of Raspbian Strech (not the lite-Version - maybe that's the problem) I connected to a WiFi Network to get all the contents - maybe that's a problem?

Thank you @chrfriese - that's strange. I followed all the instructions as in the instructables. On the SIM card slot, a blue and green light is on. The blue light between both antenna connectors is also on (steady, not flushing, etc.).

When I run pi@raspberrypi:~ $ lsusb | grep Qualcomm i get Bus 001 Device 006: ID 1e0e:9001 Qualcomm / Option, as it's shown in the instructables. Also ls /dev/ttyUSB* displays 5 ttyUSB devices. I'll try again to clone the iotbit_Install and run the IOTBit_Install.sh script. So, that's what you did @chrfriese ?

Post my results asap.

What I've seen right now: My Stretch is 2018-03-13, there's a more recently version online now. That's the next step to try

ghost commented 6 years ago

Hello @pabb85 @chrfriese - as promised: Tried it again with stretch 2018-03-13: failed. Tried it with the more recently version: failed also. When i run the script, there's an error with dkms. so i installed stretch again, downloaded the installation script and ran all the apt-get commands. When installing wvdial, i get the error "Sorry. You can retry the autodetection at any time by running "wvdialconf". When running wvdialconf, i get the error "Sorry, no modem was detected! Is it in use by another program? Did you configure it properly with setserial?" lsusb responds Bus 001 Device 007: ID 1e0e:9001 Qualcomm / Option ls /dev/ttyUSB* responds all five ttyUSB devices. when running minicom -D/dev/ttyUSB2 to send the AT command i get a OK. When running ATZ i get an ERROR.

Any other ideas?


Not i ran the script IOTBit_Install again.

got a few errors: ERROR: gcc version check: mismatch between gcc (6) and /proc/version (4.9.3) Skip this check with --skip-gcc

later, it says: mv: cannot stat '/home/pi/IOTBitInstall/GobiSerial' No such file or directory

I don't know, why there's no such file or directory in this folder; In the beginning it is definitly....

when dkms comes in, it completes the add (DKMS: add completed). But then:

Error! echo Your kernel headers for kernel 4.14.34-v7+ cannot be found at /lib/modules/4.14.34-v7+/build or /lib/modules/4.14.34-v7+/source.

i tried to modify the script to add --skip-gcc to rpi-source, but a lot more errors occur.

So, enough Raspbian for today. Looking forward hearing from you.

Best regards, Robert

sciosense commented 6 years ago

Hello @robwim,

Strange. If you see the five USB devices you should be able to connect. Just to be sure, I think for this part you need the SIM card inside the modem.

This is my wvdial.conf setting that works: [Dialer Defaults] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init3 = AT+CGDCONT=1,"IP","internet.telekom" Init4 = AT+CGPS=0 Init5 = AT+CGPS=0 Init6 = AT+CGPS=0 Init7 = AT+CGPS=0 Init8 = AT+CGPS=0 Init9 = AT+CGPS=1 Modem Type = Analog Modem Baud = 720000000 Stupid Mode = on New PPPD = yes Modem = /dev/ttyUSB-IOTbit_02 ISDN = 0 Phone = *99# Username = "congstar" Password = "cs" Check Def Route = on Auto Reconnect = on Idle Seconds = 0 Abort on Busy = off Abort on No Dialtone = off Dial Attempts = 0 Dial Timeout = 60 It’s a German carrier, that’s why Init3 says “internet.telekom”. You also need to adjust Username and Password.

Init4 to Init8 is used to shutdown the GPS part. Followed by Init9 to initiate it again. I realized that if GPS is already activated you get an error if you try to re-activate. On the other side a single deactivate command might not be sufficient.

From: robwim [mailto:notifications@github.com] Sent: Dienstag, 12. Juni 2018 21:48 To: Altitude-Tech/IOTBit_Install IOTBit_Install@noreply.github.com Cc: Christoph Friese christoph.friese@ams.com; Mention mention@noreply.github.com Subject: Re: [Altitude-Tech/IOTBit_Install] Init Failed when launching wvdial (#1)

Hello @pabb85https://github.com/pabb85 @chrfriesehttps://github.com/chrfriese - as promised: Tried it again with stretch 2018-03-13: failed. Tried it with the more recently version: failed also. When i run the script, there's an error with dkms. so i installed stretch again, downloaded the installation script and ran all the apt-get commands. When installing wvdial, i get the error "Sorry. You can retry the autodetection at any time by running "wvdialconf". When running wvdialconf, i get the error "Sorry, no modem was detected! Is it in use by another program? Did you configure it properly with setserial?" lsusb responds Bus 001 Device 007: ID 1e0e:9001 Qualcomm / Option ls /dev/ttyUSB* responds all five ttyUSB devices. when running minicom -D/dev/ttyUSB2 to send the AT command i get a OK. When running ATZ i get an ERROR.

Any other ideas?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Altitude-Tech/IOTBit_Install/issues/1#issuecomment-396710915, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AlLchviBDJj2SAQv3_S26rRgPSH6L4A6ks5t8BrWgaJpZM4NOOUd.

ghost commented 6 years ago

Hello @chrfriese - thanks for your reply. I don't have a wvdial.conf at the moment, trying with minicom. AT command works, ATZ doesn't. Tried it with usb_modeswitch -v 0x1e0e -p 0x9001 (got this from lsusb | grep Qualcomm). I got:

Look for default devices ... product ID matched Found devices in default mode (1) Access device 005 on bus 001 Error opening the device. Abort

Seems like the RPi can't access the Modem?

Edit: Okay, what i mentioned now: When I'm on my desktop and take a look to the menu bar network icon, i can see ethernet, wlan0 and wwan0. Does that mean, that the RasPI and the IOT HAT both can communicate?

Edit2: Okay, issue solved. I don't know why it started working now, but here's what i did:

1 fresh install of raspbian stretch

2 cloned the IOTBit_Install stuff from github

3 opened the script IOTBit_Install.sh and installed all the packages with apt-get myself.

4 reboot and it worked...

Now, i tried to connect to the internet on startup with editing the wvdial.conf in /etc. I added the lines auto ppp0 and iface ppp0 inet wvdial as supposed in the tutorial. On startup, i can't get a connection with the internet. There's no ppp0 interface in ifconfig. Even though i can't activate the interfaces with sudo ifup ppp0, it says it's busy (wvdial doesn't work also, modem is busy). After a soft reboot sudo reboot, there's a ppp0 interface (with an IP address) in ifconfig, but i don't have a connection. When I try wvdial, it works. Any suggestions?

Edit3: I found out, why it worked before. My SIM Card had a SIM PIN. You have to create a script, which sends the pin to the modem. I put this one in /usr/local/bin/

Here's the script (foobar) #!/bin/sh echo "AT+CPIN=xxxx\n\r" > /dev/ttyUSB2 <-- Insert the SIM PIN here (Thanks to http://www.henrykoch.de/de/raspberry-pi-via-umts-ins-netz)

After this, add the following to the /etc/network/interfaces auto ppp0 iface ppp0 inet wvdial pre-up /usr/local/bin/foobar

After that, it worked for me.

At the first bootup (no power on RasPI and HAT) i don't get any connection. No chance to get this running with sudo ifdown ppp0 and sudo ifup ppp0, device is busy (see above in Edit2). But when i restart, it suddenly works. But then I have some undervoltage problems with my HAT plus the RasPI 3B. When it boots, it is connects to the LTE network (the blue light is flushing). For some seconds, i have a connection. Then I get an error message (under-voltage) and the connection get's lost. But right now i can make sudo ifdown ppp0 and sudo ipup ppp0 and it works... Any suggestions?

alexanderbittner commented 6 years ago

@robwim I am having the same issue here. On initial boot there is no connection. After the reboot it works fine. However, the Pi even randomly restarts. After that, the modem does not work properly without removing the power briefly. Then it's back to rebooting at least once to get the modem to work. Can somebody from Altitude Tech help us out here? @frazer-altitude

Edit: It seems that during a "random restart" the Raspberry Pi does not receive any power for a few seconds. All LEDs on the Pi are turned off, while the LEDs on the IOT Bit never turn off completely. Sometimes the restarts do not occur for more than an hour, some other times they are only a minute apart. However, they always start with a red LED on the IOT Bit. Once it turns red the internet connectivity still works, but a few seconds afterwards the Raspberry Pi gets a power cut-off.