GPRS and modem commands - Windows Mobile Development and Hacking General

I have written code to send and receive modem commands and make a data call using the ATDT command. However, sometimes the modem starts to reply with "AT-Command Interpreter" on every command issued, and the command is never executed. At the same time the modem often responds with AT+CSQ: 99,99 (without issuing a request for CSQ).
Once it gets into this mode, I am unable to get it back to the state of actually processing the command. It looks as though this state happens when I am connected to the COM2: port and insert the unit into the cradle for ActiveSynch.
I assume that the problem has something to do with the RIL layer, and all I need to do is "reset" it.
Any suggestions?

Related

detect device radio state (flight mode)

My application needs to know if device has flight mode turned on (radio is shut down). The ExTAPI API, lineGetEquipmentState, works well for other PocketPc phone devices but fails frequently on M1000.
lineGetEquipmentState frequently fails with 80000048 (LINEERR_OPERATIONFAILED)
I have attached code snippet.
Pseudo code looks like
1, initialize with lineInitializeEx
2. look for phone device by calling lineGetDevCaps and then checking media mode for the line device is LINEMEDIAMODE_INTERACTIVEVOICE
3. negotiate version with lineNegotiateAPIVersion
4. negotiate extension version with lineNegotiateExtVersion
5. open line with lineOpen
6. get radio state with lineGetEquipmentState
7. close line with lineClose
8. shut it down with lineShutdown
Step 6 frequently fails with 8000048 (LINEERR_OPERATIONFAILED)
Any idea, clue why it fails.
Your response is highly appreciated

Problems with AT

1)Command AT+CMUT (mic mute?) doesn't work.
2)I think, after modem established data connection, it musts switch from command mode to data mode automatically. But modem still in command mode.
some GSM modems have 2 channels - one for commands and second for data only. Maybe our device has such modem, i've seen that OS uses COM9 during data connections.
You right. It works.
Thx.
In GMK CryptoPhone, data and commands use one port.
Maybe different PDAs use different modems (with one or two channels)?
There is API for check what modem is used in the current device?
Other question
If I'll send '+' or 'DLE' from device with modem with two channels to device with modem with one channel, it will receive symbols?
COM2 is for GSM command and COM9 is for GSM data.
Use COM2 for call setup, after receiving the CONNECT message, open COM9 for data transfer.
Or you can use TAPI. it works for me.
davidchu2000
I allready know it, cause I can read, and mamaich wrote
some GSM modems have 2 channels - one for commands and second for data only. Maybe our device has such modem, i've seen that OS uses COM9 during data connections.
I wana know why GMK programmers use one port...I think they are not fools...

Internet Sharing

Well I have a carPC and i have been using my Cingular 8525 as my internet connection for the carPC. I have been tethering the phone to my carPC via bluetooth. I was wondering since it is very annoying to have to go into windows and start the network access for bluetooth and then start internet sharing on the phone in order to set up the connection. Is it possible to to somehow have the PC automatically start the network access when internet sharing is activated? Or is there an easier way to even do this?
I would like this too!
(one thing i did notice is that the new 12 button comm manager that somone has made has a button for internet sharing. this would be less hassel to use that you current setup i would think?)
Mortscript can probably do everything you want...
However im not sure how/what you can use as the trigger for mortscript. do you run any specific app, or make a bluetooth car kit connection of any type when you get into the car?
i will try and write a mortscript for this sometime soon..
Well i think i have a solution comming for you...
Here is what i ahve got so far.
On the PC iniciate an Object push to the phone, this will pop up a dialoge window on the phone saying "recieving data"
If you have a mort script running a loop in the Background that waits for this window, you can then check the text of the active window to make sure the receiving data window is talking about a push from the right machine.
If it is, you cna then use mortscrit to start the right app, change the parameters of the app and activate the sharing of the app.
The object push from the pc could be triggered after 30 seconds after boot for instance.. or somthing similar. should be easy to script that on thePC!

GPS Works Once (No GPS reconnect for 50 minutes)

After obtaining a fix, and then disconnecting manually or automatically (via an app closure) I have to start the gps again within 10 seconds in airplane mode or 25 seconds out of airplane mode to reconnect. If I dont reconnect within this time frame it will not reconnect for about 40-50 minutes. Rebooting or shutting down does not help. This renders the gps specific functions of the phone useless. This does not impact the location services provided by other chips i.e. wifi, cdma (3g data).
If sats are only in view and no more than two are in use (a fix has not been obtained). You can end the session and restart it anytime without a reboot.
This test was actioned in and out of airplane mode but never connected to the network i.e only searching for the network. Its unlikely being connected to the network would impact the outcome of these tests. If you wish to test your own device you should download and use GPS test from the app store. Having or not having AGPS data has no impact on the tests outcome.
From reviewing the logs and assuming this is not a hardware issue my supposition is it appears that when an active gps session with a fix is closed the device does a gps_cleanup. Upon reconnecting it attemps to call back this session against cache that no longer exists. After about 50 minutes a new session is initiated. This problem is somewhat highlighted in this example code. https://github.com/android/platform_frameworks_base/commit/0a5098106c116f2b67c9e77e4ec0afbc92acd61c
I would also be interested in some insight into the cache cleanup commands in the gps.conf script file for this device. It appears GPS1_ CLEANUP_ENABLED=0 does not appear to work for this device. This example was pulled from another example http://forum.xda-developers.com/showthread.php?t=1338486 for another brand so maybe the commands are different with each device. I am also unsure if the gps.conf is read/executed too, per boot/ session/ agps call etc. I'm also unsure which permissions should be set.
I have also attached some log files of the various operations along with a copy of the GPS conf/ system files. In addition I have also noticed cleanup errors when im having problems getting a fix including status 9 errors and wrong prn errors too, I have no idea what these are.
I have already factory reset the phone without success and tried other roms. I do not believe this is a hardware error as it wouldn't function in the first instance.
Any insight would be appreciated.
Peter
Samsung R720
Android 2.3.4 Gingerbread
Log Details
B1 - It finds some sats but I intentionally terminate the session.
B2 - I then restart it. It finds sats again and gets a fix.
B3 - A continuation of B2 but it is terminated manually. A2 would occur next.
A1 - Reconnects at end of the long searching/ downtime period (50 minutes) and gets a fix. I'm not sure why it starts working at this point or what triggers this and im not sure if it´s captured in the log.
A2 - This attempts to reconnect to the previous session via a callback but it fails even though the session is ongoing.

Eonon GA7151W Android - Wifi connected but no internet?

I have Eonon GA7151W headunit - Android 6.0
Suddenly my wifi says "Connected" but 'No Internet' .... it doesn't matter whether I tether to my phone or use my home wifi, for some reason the wifi says 'No internet'.
I tried a few things and ended up resorting to a factory reset ... unfortunately it's still not working after the factory reset! Exactly the same symptoms ...
Any ideas?
hogiela said:
I have Eonon GA7151W headunit - Android 6.0
Suddenly my wifi says "Connected" but 'No Internet' .... it doesn't matter whether I tether to my phone or use my home wifi, for some reason the wifi says 'No internet'.
I tried a few things and ended up resorting to a factory reset ... unfortunately it's still not working after the factory reset! Exactly the same symptoms ...
Any ideas?
Click to expand...
Click to collapse
I have the same issue that has me stumped. any luck fixing it?
Did anyone find a solution for this? Same thing is happening to me. I don't use the internet much on my head unit but I need it. It seems this is a widespread issue.
I'm having the same problem with my radio and after Google'ing I found that you need to run this command to fix it. I don't have root on my radio yet, which is why I'm not sure if this will work.
Code:
su
settings put global captive_portal_server google.com
"Each time your Android device connects to a Wi-Fi network, the system performs a Captive Portal Check. Android aims to ensure that your device has not only received an IP address from the access point, but can actually reach targets on the Internet. This is necessary, for example, for the detection of portal pages of WLAN hotspots (e.g. in hotels). Android sends a request to the address "connectivitycheck.gstatic.com" for verification. If the request is successful or is answered with HTTP Response Code 204, the Internet is accessible. With this request, the system transmits information about the IP address of the connection, the time of Internet access and which browser is currently used to Google.If you block this request to Google via AFWall+ or anywhere else in your network, a small cross will appear on the Wi-Fi icon in the Android menu bar. Depending on the Android version, a message will also appear that no Internet is available. However, privacy-conscious users in particular do not want to send a "ping" to Google every time they go online. There is now a solution that works on rooted and non-rooted devices."
Here's a method that may work without root. Only problem is it seems to be for German devices. Also my device is Android 6.
Android Nougat (7.x)
Connects the device to your computer via USB cable and activates ADB for the process. You then place the following commands via a terminal on the computer:
adb shell 'settings put global captive_portal_http_url "http://captiveportal.kuketz.de"'
adb shell 'settings put global captive_portal_https_url "https://captiveportal.kuketz.de"'
Android Oreo (8.x) | Pie (9.x)
Connects the device to your computer via USB cable and activates ADB for the process. You then place the following commands via a terminal on the computer:
adb shell 'settings put global captive_portal_http_url "http://captiveportal.kuketz.de"'
adb shell 'settings put global captive_portal_https_url "https://captiveportal.kuketz.de"'
adb shell 'settings put global captive_portal_fallback_url "http://captiveportal.kuketz.de"'
adb shell 'settings put global captive_portal_other_fallback_urls "http://captiveportal.kuketz.de"'
You can check whether the URLs have been adjusted as desired with the following command:
adb shell 'settings get global captive_portal_https_url'
I think I've broken it down to one command that needs to be run at terminal or adb.
Code:
settings put global captive_portal_detection_enabled 0
Again, I don't have root yet on my device and spent the whole day trying to root it, but you guys can try it out for yourselves. You can use this command to see if you disabled it.
Code:
settings get global captive_portal_detection_enabled
Don't know if all of you solved this issue or swapped unit... But the same happened to me this week after a crash that made me reboot the unit.
Since then, no internet at all, besides the wifi was running like supposed to.
Also tried the factory default, a pain for nothing.
This is how I fixed the issue:
Go to date time of the unit on settings, change it to manual, get it right and adjust the time fuse to the correct one for you, then, switch off then on the wifi and should be running like a charm.
I'm my case, the internet came back in most of apps, but in google store don't, needed to reboot the unit. (I have the by eonon and the code to my radio it's 126, so I can reboot it going to eonon settings)
Rpscavaleiro said:
Don't know if all of you solved this issue or swapped unit... But the same happened to me this week after a crash that made me reboot the unit.
Since then, no internet at all, besides the wifi was running like supposed to.
Also tried the factory default, a pain for nothing.
This is how I fixed the issue:
Go to date time of the unit on settings, change it to manual, get it right and adjust the time fuse to the correct one for you, then, switch off then on the wifi and should be running like a charm.
I'm my case, the internet came back in most of apps, but in google store don't, needed to reboot the unit. (I have the by eonon and the code to my radio it's 126, so I can reboot it going to eonon settings)
Click to expand...
Click to collapse
I'm gonna try this. Would be silly that messing with the clock fixes it. I haven't been able to do anything about it since I need to root the stereo to run those commands.
I truly rocomemd you to do it!
I won't lie that first I get it running, I came to this post and when I saw you guys answer, I was already thinking in take the stereo off, but my mazda 6 it's a pain to get it off, because I have to unscrew the dash.
After some dig, found that solution for issues with access with hotspots.
I also didn't believe that the proceed would work but... the important thing is that my Eonon came back to internet life!
Let me know if also worked with you.

Categories

Resources