Home repair tips forum

PM Notification

You are not logged in.

Welcome, Guest
Username Password: Remember me

Search Forum

Keyword

3g fix for testing - V1.5 - Updated 28.02.2013
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: 3g fix for testing - V1.5 - Updated 28.02.2013

3g fix for testing - V1.5 - Updated 28.02.2013 8 years, 8 months ago #1895

Hi guys,

finally we found the 3g problem.
We spend a lot of time to find the answer (Yves even disassembled his tab to put the modem into a normal PC).
We found out, that the modem is reported as usb device 12d1:1404 in normal mode and as 12d1:1003 when it is "crashed".
But the modem hasn't really crashed, it has somehow entered the "DM-mode", that can be forced using "AT$QCDMG" command.

This problem seems to be a "well known" problem. (some people name such thing a feature )
It looks like there is no ultimate fix for this, there is only a workaround.
In stock ICS (Medion P9516) you can find the workaround in /init.rc
If the modem has crashed and the crash is detected, a service named "wwanloader" is started.
This wwanloader completely removes the modem from the bus, reenables the modem and restarts the ril-daemon.

Unfortunately we cannot simply copy wwanloader, because in JB, we need to detect the "3g crash" ourselves.
In ICS there was some kind of service for that.
So for JB I've choosen a different way:
When the modem has crashed, the devices /dev/ttyUSB[0-5] disappear and 2 new devices (/dev/ttyUSB[0-1]) appear.
I programmed a daemon that is triggered by the kernel if /dev/ttyUSB1 disappears.
Since the daemon does a blocking read (I used inotify), it should not use any cpu until it is triggered.

In the link you'll find a CWM installable zip.
It will install the binary
/system/xbin/em820w_tool
and the script
/system/etc/init.d/50em820w

The script starts the daemon on boot.
The binary can be called as user root and can report the current mode (1404 or 1003 = usb-pid) and can be used to force the modem into one of this modes manually.

Please report your experience and any problems or suggestions.


To ensure that everything is running correctly, you can do the following:
- enter "ps | grep em820w" in a terminal window to see, if em820w_tool is started
- enter "em820w_tool" (must be root!) in a terminal window and check you've installed the lasted version
- enter "em820w_tool -vd" (must be root!) in a terminal window to force a 3g crash
- use logcat (on radio-log) and look for the word em820w_tool



Micky

[UPDATE]
28.02.2013 V1.5

Download:
dl.dropbox.com/u/99376551/Android/em820w_tool-V1.5.zip
MD5: 6e27aa2f3ced54d085575896a84e8adf

Archive:
dl.dropbox.com/u/99376551/Android/em820w_tool-V1.4.zip
dl.dropbox.com/u/99376551/Android/em820w_tool-V1.3.zip
dl.dropbox.com/u/99376551/Android/em820w_tool-V1.2.zip
dl.dropbox.com/u/99376551/Android/em820w_tool-V1.1.zip

Changes:
V1.5 Improvement on modem reset
V1.4 timing improvement; show version in logcat
V1.3 keep autosuspend value
(safe current value in /sys/bus/usb/devices/1-1/power/autosuspend at startup and reuse it when 3g has crashed)
V1.2 logging to radio-log instead of main-log


Features:
- keep autosuspend
- logging
- use either service or kill to stop rild
- better parameter handling
Like my work?
Last Edit: 8 years, 7 months ago by Ameisentaetowierer.
The following user(s) said Thank You: YLG80, Andri Od, hhuber2001, -MaD-, 00feichti, tliesche

Re: 3g fix for testing 8 years, 8 months ago #1897

  • Andri Od
  • OFFLINE
  • Junior Boarder
  • Posts: 31
  • Karma: 1
Hey Micky an Yves,

thank you so much for your efforts to get rid of that annoying 3g issue!
I wished I have had some more time for supporting your investigations, but job and family just take their toll.

Nevertheless, I installed Mickeys script and binary. I'll report anything conspicuous!
Q: Does the watchdog mechanism write anything in any logs, so maybe one can see later, if and at what time the modem was "reanimated"?

Thanx an greetz
A.O.

Re: 3g fix for testing 8 years, 8 months ago #1899

  • YLG80
  • OFFLINE
  • Moderator
  • Posts: 776
  • Karma: 28
Thanks a lot to Mickey for this script.

On top of Mickey's script you could also test this workaround.
The workaround will prevent the modem to go in USB suspend mode when the tablet is switched off in sleep mode.
With a text editor, open the file /system//etc/init.d/90userinit

Add that line in the script 90userinit:

#!/system/bin/sh
#call userinit.sh and/or userinit d/* scripts if present in data/local

echo -1 > /sys/bus/usb/devices/1-1/power/autosuspend


Save the modified file and reboot your tablet.

After rebooting, you can verify that autosuspend is disabled .
Open the terminal.
 
cat /sys/bus/usb/devices/1-1/power/autosuspend
 

It should return -1 instead of the default 2

The autosuspend mode, normally set to 2, can be disabled as the modem is the only device with suspend mode on the USB hub.
The effect of the autosuspend mode can be clearly observed under Windows.
When the modem is not used and the Hardware Manager is opened in a window, we can see after a while that Windows .
unloads the drivers when the modem is suspended, but it immediately reloads the correct drivers.
Unfortunately the Linux driver cannot handle that mode, leaving the modem in DM mode as described by Mickey.(pid 1003)

There is no need to use that workaround if you install Mickey tool.

About the WiFi annoying SOD.

To reduce the annoying SOD's you could disable the sync parameters in programs (usually Google) that are automatically trying to sync
even when the tablet is in sleep mode, causing wakelocks.
The best example is gmail.
Go to Parameters, E-mail, Account settings .
In the left columns, touch your email address and in the right columns, touch Inbox check frequency.
I've switched that parameter to "never", as I can refresh the inbox manually in the gmail application.

This will drastically reduce the occurrence of wakelocks that seems to cause the SOD.
You can do this for each app that tries to sync from the background.

If you test these solutions, could you post your results, please?
It takes a while to test it on a single tablet, so Mickey and myself would be glad if you share your experience.

Thanks
Yves

Key words for this thread : 3G modem fix - Huawei EM820W - Jelly Bean 3G fix - CM10 - Lenovo K1 - Medion Lifetab P9516 - crash
Last Edit: 8 years, 8 months ago by YLG80. Reason: key words
The following user(s) said Thank You: tliesche

Re: 3g fix for testing 8 years, 8 months ago #1901

  • YLG80
  • OFFLINE
  • Moderator
  • Posts: 776
  • Karma: 28
Hi Mickey,
I've installed your utility.
Two crashes within about 2 hours.
Modem still alive.
That looks good !
Yves
Last Edit: 8 years, 8 months ago by YLG80.

Re: 3g fix for testing - V1.2 - Updated 20.02.2013 8 years, 8 months ago #1902

updated to V1.2
Like my work?
Last Edit: 8 years, 8 months ago by Ameisentaetowierer.

Re: 3g fix for testing - V1.2 - Updated 20.02.2013 8 years, 8 months ago #1903

  • tliesche
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
First of all: Have been looking into this topic from time to time and exitedly watching your progress.
Really great work from both of you! [german]Wirklich tolle Arbeit habt ihr da geleistet![/german]

One question comes to my mind: What's the advantage of using either Micky's or Yves's method?

If I'm not mistaking anything: The no sleep method is likely causing some more battery drain due to not suspending the modem anytime?
Last Edit: 8 years, 8 months ago by tliesche.

Re: 3g fix for testing - V1.2 - Updated 20.02.2013 8 years, 8 months ago #1904

  • YLG80
  • OFFLINE
  • Moderator
  • Posts: 776
  • Karma: 28
@tliesche

Hello
Thanks for your encouragement.
Use first Mickey solution.

As long as autosuspend remains disabled (-1), I've seen that the modem was automatically reconnected.
But 2 days' ago I was surprised to find that the autosuspend parameter returned to its original value (2) after 2 or 3 modem recoveries.
Still trying to find which process is resetting the autosuspend.
I suspect it happens after certain wake-locks.(WiFi ?)

Disabling the modem autosuspend mode does not increase the battery drain because the 3G modem itself falls
in its own low power mode when the tablet is in sleep mode.
The radio modem is still disabled (low power mode) when both hardware and software W_DISABLE# signals are enabled.
It just remains connected to the USB hub.

That parameter should certainly not be used if there was something else connected to the USB Hub (1-1)

Since I'm testing that solution, I've not observed any difference in battery drain.
The battery discharge graph remains flat even if I observe modem crashes (thin red bars in the mobile networks line under the graph)

I still have to experiment with this parameter.
But in order to help Mickey in the validation process I'm now using his tool (v 1.2) first.
Eagerly waiting for a modem crash followed by a recovery

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 8 months ago #1905

  • YLG80
  • OFFLINE
  • Moderator
  • Posts: 776
  • Karma: 28
Well, I see that Mickey has uploaded v 1.3 (see 1st post in this thread)
Going to 1.3 ....

Re: 3g fix for testing - V1.2 - Updated 20.02.2013 8 years, 8 months ago #1906

tliesche wrote:
One question comes to my mind: What's the advantage of using either Micky's or Yves's method?


Thanks tliesche,

I think we have not tested the two methods enough to fully know this.
We would be happy if you share your experience here.

I just updated my tool, now you can mix both modes by doing the following:
Add the line
echo -1 > /sys/bus/usb/devices/1-1/power/autosuspend

at the beginning (line #3) of /system/etc/init.d/50em820w.

Or even better, to prevent the next version of em820w_tool from overwriting your changes:
Create your own script and name it 40xxx, so it is started before 50em820w.

Version 1.3 of my tool then reads the -1 from autosuspend at startup and will write it back to autosuspend if the modem crashs.
"If" the modem crashs...but who knows?
I will give it a try and tell you about my experience.

Micky
Like my work?
The following user(s) said Thank You: YLG80

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 8 months ago #1907

  • tliesche
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
i tried running Micky's version 1.2 last night.

now when resuming from tablet sleep i had to re-enter my SIM's pin. no chance - always telling me it was wrong.

after reboot everything's fine again. where are the logs stored by default?

Toni
Last Edit: 8 years, 8 months ago by tliesche.

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 8 months ago #1908

You have to use logcat

- from your PC "adb logcat -b radio -v time"
- use an app for logcat (choose radio from the option menu)
- use it from the cmdline on your tablet
Like my work?

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 8 months ago #1909

  • tliesche
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
currently charging my tab to 100% of battery. will give version 1.3 + autosuspend = -1 a try then.

just one more note: still got huge jumps downwards in concerns of battery during the night. lost about 30% within less than ten hours using version 1.2.

adding one screenshot showing the battery consumption.

notice: i ran the tablet without sim for months ... so mobile connection just starts in the last third of the graph
Attachments:
Last Edit: 8 years, 8 months ago by tliesche.

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 8 months ago #1910

Hello Toni,

I got a feeling that the tool isn't running at all on your tab.
I've updated my first post with some tips on how to ensure the tool is running.

In the morning I reset battery stats and set autosuspend to -1.
After 10 hours autosuspend was still set to -1 and the modem crashed 3 times.
One time the tool wasn't able to bring the modem back to normal state.
But the tool was still functional, because after the next crash everything was up again.
There's room for improvement!


Screenshot_2013-02-21-18-06-27.png
Like my work?

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 8 months ago #1911

  • YLG80
  • OFFLINE
  • Moderator
  • Posts: 776
  • Karma: 28
Got a modem drop out just a few minutes ago. (v 1.3)
I was required to enter the pin code as expected. No problem at all.
PIN accepted as usual.

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 8 months ago #1912

  • tliesche
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
hey micky,

you were right ... the init.d got no +x flag from cwm flash. had to set it manually + there was a typo in the manually added line
got a modem crash at 98%, first time it happend with a nearly fully charged battery.

now charging to 100% again and then watching the restart daemon work.

thanks again for your good work so far

Toni

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 7 months ago #1913

  • hhuber2001
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
Thanks for your great work. Resetting the modem manually works great. Detection of the 3g crash works flawlessly, but resetting the modem automatically doesn't seem to work on my tablet.

 
37@android:/ $ su
u0_a37@android:/ # logcat -b radio -v time -d|grep em8
02-24 03:15:59.539 D/em820w_tool( 108): 3G crash detected!
02-24 03:16:14.139 W/em820w_tool( 108): setting modem to USB-PID 1404 ...
02-24 03:16:14.139 D/em820w_tool( 108): stopping service ril-daemon ...
02-24 03:16:14.279 D/em820w_tool( 108): 2 out of 2 bytes written to /sys/EcControl/ThreeGPower
02-24 03:16:18.519 D/em820w_tool( 108): 2 out of 2 bytes written to /sys/EcControl/ThreeGPower
02-24 03:16:39.429 D/em820w_tool( 108): 3 out of 3 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 03:16:48.479 E/em820w_tool( 108): can't open /sys/bus/usb/devices/1-1/power/autosuspend for writing!
02-24 03:16:48.479 E/em820w_tool( 108): can'
t open /sys/bus/usb/devices/1-1/power/control for writing!
02-24 03:16:48.479 E/em820w_tool( 108): can't open /sys/bus/usb/devices/1-1/power/wakeup for writing!
02-24 03:16:48.479 D/em820w_tool( 108): 5 out of 5 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 03:16:48.479 E/em820w_tool( 108): can'
t open /sys/bus/usb/devices/1-1/power/autosuspend for writing!
02-24 03:25:57.660 D/em820w_tool( 108): 3 out of 3 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 03:39:43.730 D/em820w_tool( 108): 3 out of 3 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 03:54:11.230 D/em820w_tool( 108): 3 out of 3 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 04:09:44.010 D/em820w_tool( 108): 3 out of 3 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 04:26:29.539 D/em820w_tool( 108): 3 out of 3 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 04:39:44.329 E/em820w_tool( 108): ERROR! Modem was not set to USB-PID 1404
02-24 04:39:44.329 D/em820w_tool( 108): starting service ril-daemon ...
02-24 04:46:39.600 D/em820w_tool( 108): watchdog for /dev/ttyUSB1 initialized
u0_a37@android:/ # lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002
Bus 001 Device 007: ID 12d1:1003


The huge pause between steps seem strange. Maybe the new version introduced a bug while writing the power control settings. Could you release version 1.2 again for testing.

Thanks in advance
Hans

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 7 months ago #1914

  • YLG80
  • OFFLINE
  • Moderator
  • Posts: 776
  • Karma: 28
Hello
Here is Mickey's version 1.2.

File Attachment:

File Name: em820w_tool-V1.2.zip
File Size: 151 KB


Rgds
Yves
The following user(s) said Thank You: hhuber2001

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 7 months ago #1915

Hello Hans,

I've added download link for the previous versions to my first post.

Strange....very long waits between the step and no success.
Does it happen always like this?
Was flightmode activated?

My 3g is almost always in flightmode...don't need to enter PIN...
And I don't have tools like "auto airplane"

From this morning:
 
02-24 10:06:34.410 D/em820w_tool( 108): 3G crash detected!
02-24 10:06:42.070 W/em820w_tool( 108): setting modem to USB-PID 1404 ...
02-24 10:06:42.070 D/em820w_tool( 108): stopping service ril-daemon ...
02-24 10:06:42.190 D/em820w_tool( 108): 2 out of 2 bytes written to /sys/EcControl/ThreeGPower
02-24 10:06:44.300 D/em820w_tool( 108): 2 out of 2 bytes written to /sys/EcControl/ThreeGPower
02-24 10:07:25.290 D/em820w_tool( 108): 3 out of 3 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 10:08:08.520 D/em820w_tool( 108): 2 out of 2 bytes written to /sys/bus/usb/devices/1-1/power/autosuspend
02-24 10:08:08.520 D/em820w_tool( 108): 3 out of 3 bytes written to /sys/bus/usb/devices/1-1/power/control
02-24 10:08:08.600 D/em820w_tool( 108): 8 out of 8 bytes written to /sys/bus/usb/devices/1-1/power/wakeup
02-24 10:08:08.600 D/em820w_tool( 108): 5 out of 5 bytes written to /sys/bus/usb/devices/usb1/power/control
02-24 10:08:08.600 D/em820w_tool( 108): 2 out of 2 bytes written to /sys/bus/usb/devices/1-1/power/autosuspend
02-24 10:08:33.220 D/em820w_tool( 108): starting service ril-daemon ...
02-24 10:08:33.220 W/em820w_tool( 108): Modem was set to USB-PID 1404 successfuly
 
Like my work?

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 7 months ago #1916

  • hhuber2001
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
Hi!

This is always happening on my tablet. I don't have flightmode or any similar tools enabled. Thanks for the links to the older version. I'll give it a try.

Re: 3g fix for testing - V1.3 - Updated 21.02.2013 8 years, 7 months ago #1917

  • YLG80
  • OFFLINE
  • Moderator
  • Posts: 776
  • Karma: 28
Quick report on v1.3.
We've made many experiments, so I've decided to clean reinstall CM10 v6.1, yesterday morning.
I've much less modem drop out than before.
Two crashes and both were recovered by Mickey tool. No need to reboot.

However the tablet still crashes as soon as I quit my wifi network range.

I thought installing Kaschemme build, but the last release is only available in Nvflash image.
No time yet to check/modify the files.
I've already modified the boot.img for the P9516 but I need also to check if the partitions cfg is OK for a 64Gb tablet.

Yves
  • Page:
  • 1
  • 2
Moderators: YLG80, Ameisentaetowierer
Time to create page: 3.24 seconds
Sizler icin kurdugumuz sitemizde yabanci diziler ve film arsivi ile birlikte gunluk burc yorumlari son dakika haberler bulunur Dizimag Hayata dair herseyi sizlere gosteriyoruz. Hemen sitemize girip eglencenize bakabilir zamaninizi guzel gecirebilirsiniz.