Closed
Bug 979739
Opened 11 years ago
Closed 11 years ago
setStaticIpMode
Categories
(Firefox OS Graveyard :: Wifi, defect)
Firefox OS Graveyard
Wifi
Tracking
(blocking-b2g:-)
People
(Reporter: wang.rong, Assigned: chucklee)
References
Details
(Whiteboard: [p=1])
Attachments
(5 files, 2 obsolete files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1 (Beta/Release)
Build ID: 20120615040358
Steps to reproduce:
We need to test wifi connection with static ip and find that a function is provided in gecko.
nsIDOMDOMRequest setStaticIpMode(in jsval network,
in jsval info);
And then we called this function.
Actual results:
we met a lot of problems with using this function. It doesn't work.
Expected results:
It should work fine with us.
Updated•11 years ago
|
blocking-b2g: 1.3? → -
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → chulee
| Assignee | ||
Comment 2•11 years ago
|
||
The error is caused by wrong-formatted |mask_str|.
Also did some refactory by using ip transform functions in netHelpers.
Tested in Gaia with following code:
var network = navigator.mozWifiManager.connection.network;
navigator.mozWifiManager.setStaticIpMode( network, {
enabled: true,
ipaddr: "192.168.5.2",
maskLength: 24,
gateway: "192.168.5.254",
dns1: "192.168.5.1",
dns2: "192.168.5.254"
});
Attachment #8386649 -
Flags: review?(vchang)
Comment 3•11 years ago
|
||
Comment on attachment 8386649 [details] [diff] [review]
Fix netmask string format error and use netHelper.
Review of attachment 8386649 [details] [diff] [review]:
-----------------------------------------------------------------
This patch looks fine for me, but I would like the reporter to give it a shoot before landing the patch.
Attachment #8386649 -
Flags: review?(vchang) → review+
Comment 4•11 years ago
|
||
Can you help us to double check if this patch works for you ?
Flags: needinfo?(wang.rong)
The function stringtoIp is one problem and there is another problem we met.
here, netFromDOM() makes setNetworkKey not equal to curNetworkKey in WifiManager.setStaticIpMode().
we delete it and stringtoIp, then nsIDOMDOMRequest setStaticIpMode(in jsval network,
in jsval info);
can work properly.
setStaticIpMode: function(msg) {
const message = "WifiManager:setStaticMode:Return";
let self = this;
let network = msg.data.network;
let info = msg.data.info;
//netFromDOM(network, null);
info.ipaddr_str = info.ipaddr;
info.proxy_str = info.proxy;
info.gateway_str = info.gateway;
info.dns1_str = info.dns1;
info.dns2_str = info.dns2;
WifiManager.setStaticIpMode(network, info, function(ok) {
if (ok) {
self._sendMessage(message, true, true, msg);
} else {
self._sendMessage(message, false, "Set static ip mode failed", msg);
}
});
},
Flags: needinfo?(wang.rong)
| Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Wang Rong from comment #5)
> The function stringtoIp is one problem and there is another problem we met.
>
> here, netFromDOM() makes setNetworkKey not equal to curNetworkKey in
> WifiManager.setStaticIpMode().
> we delete it and stringtoIp, then nsIDOMDOMRequest setStaticIpMode(in jsval
> network,
> in jsval info);
> can work properly.
>
>
> setStaticIpMode: function(msg) {
> const message = "WifiManager:setStaticMode:Return";
> let self = this;
> let network = msg.data.network;
> let info = msg.data.info;
>
> //netFromDOM(network, null);
We don't have this function all in our code base.
Comment 7•11 years ago
|
||
Hi,
I am unable to connect to wifi using static ip but i am unable to ping after connecting to wifi. Please attach the complete wifiWorker.js and domWifiManager files. So that it will be helpfull for me.
Thanks
Comment 8•11 years ago
|
||
(In reply to sb00349044 from comment #7)
> Hi,
>
> I am able to connect to wifi using static ip but i am unable to ping after
> connecting to wifi. Please attach the complete wifiWorker.js and
> domWifiManager files. So that it will be helpfull for me.
>
> Thanks
| Assignee | ||
Comment 9•11 years ago
|
||
You can get full source code from mozilla repo [1] or browse online by dxr[2].
[1] https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Mercurial
[2] http://dxr.mozilla.org/mozilla-central/source/dom/wifi/
Comment 10•11 years ago
|
||
As given in the above comment, Where i have to put this function
var network = navigator.mozWifiManager.connection.network;
navigator.mozWifiManager.setStaticIpMode( network, {
enabled: true,
ipaddr: "192.168.5.2",
maskLength: 24,
gateway: "192.168.5.254",
dns1: "192.168.5.1",
dns2: "192.168.5.254"
});
Where i have to give static IP address.
Comment 11•11 years ago
|
||
As given in the above comment, Where i have to put this function
var network = navigator.mozWifiManager.connection.network;
navigator.mozWifiManager.setStaticIpMode( network, {
enabled: true,
ipaddr: "192.168.5.2",
maskLength: 24,
gateway: "192.168.5.254",
dns1: "192.168.5.1",
dns2: "192.168.5.254"
});
Where i have to give static IP address. I attached wifiworker.js
Attachment #8471525 -
Flags: feedback?
| Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 8471525 [details]
WifiWorker.js
The API is exposed to Gaia, so you should implement static IP function using the API in app, not trying to change anything in gecko.
That's the sample code is for.
Although you didn't mentioned what use case you are dealing with, I think you probably need to handle it in wifi part of settings app[1].
If you are not familiar with developing app,you might need get some background knowledge first[2].
[1] https://github.com/mozilla-b2g/gaia/tree/master/apps/settings
[2] https://developer.mozilla.org/en-US/Apps/Quickstart
Attachment #8471525 -
Attachment is obsolete: true
Attachment #8471525 -
Flags: feedback?
Comment 13•11 years ago
|
||
(In reply to Chuck Lee [:chucklee] from comment #12)
> Comment on attachment 8471525 [details]
> WifiWorker.js
>
> The API is exposed to Gaia, so you should implement static IP function using
> the API in app, not trying to change anything in gecko.
> That's the sample code is for.
> Although you didn't mentioned what use case you are dealing with, I think
> you probably need to handle it in wifi part of settings app[1].
> If you are not familiar with developing app,you might need get some
> background knowledge first[2].
>
> [1] https://github.com/mozilla-b2g/gaia/tree/master/apps/settings
> [2] https://developer.mozilla.org/en-US/Apps/Quickstart
I not making any apps. Just for testing purpose i want to give static IP.
Only i need to check weather wifi is working or not using staticIPMode. I do not require any apps from frontend side. DHCP is not working. So i want to check with staticip weather wifi is working or not.
| Assignee | ||
Comment 14•11 years ago
|
||
You should still use app to set Static IP even for test purpose. You can use API to set static IP before associate[1].
[1] https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/modules/wifi_context.js#L342
| Assignee | ||
Comment 15•11 years ago
|
||
Add reviewer's name.
Attachment #8386649 -
Attachment is obsolete: true
| Assignee | ||
Comment 16•11 years ago
|
||
Just noticed that I forgot to checkin the patch, wait for try reopen.
Depends on: 1040308
| Assignee | ||
Comment 17•11 years ago
|
||
Try looks good: https://tbpl.mozilla.org/?tree=Try&rev=02f29334ed2a
No longer depends on: 1040308
Keywords: checkin-needed
Comment 18•11 years ago
|
||
Keywords: checkin-needed
Comment 19•11 years ago
|
||
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S3 (29aug)
| Assignee | ||
Updated•11 years ago
|
Whiteboard: [p=1]
Comment 20•11 years ago
|
||
Hi,
I am using staticIpmode to connect wifi. I am able to connect wifi.
After connecting to wifi, i try to access market place. I am unable to access the market place.
Please check below logs:
08-20 08:03:44.695 I/Gecko ( 1149): *** AUS:SVC Checker:onError - request.status: 2152398878
08-20 08:03:44.695 E/GeckoConsole( 1149): AUS:SVC Checker:onError - request.status: 2152398878
08-20 08:03:44.695 I/Gecko ( 1149): *** AUS:SVC getStatusTextFromCode - transfer error: Update server not found (check your internet connection), code: 2152398878
08-20 08:03:44.695 E/GeckoConsole( 1149): AUS:SVC getStatusTextFromCode - transfer error: Update server not found (check your internet connection), code: 2152398878
08-20 08:03:44.695 I/Gecko ( 1149): *** AUS:SVC UpdateService:onError - error during background update. error code: 2152398878, status text: Update server not found (check your internet connection)
08-20 08:03:44.695 E/GeckoConsole( 1149): AUS:SVC UpdateService:onError - error during background update. error code: 2152398878, status text: Update server not found (check your internet connection)
Attachment #8476610 -
Flags: feedback?
| Assignee | ||
Comment 21•11 years ago
|
||
It doesn't seem to be problem of static IP, if you set the parameters correctly, and static IP works correctly on flame.
The log shows there's something wrong in your platform library and start to killing daemons, including netd.
> 08-20 08:03:41.648 D/AndroidRuntime(13650):
> 08-20 08:03:41.648 D/AndroidRuntime(13650): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
> 08-20 08:03:41.648 D/AndroidRuntime(13650): CheckJNI is OFF
> 08-20 08:03:41.648 E/AndroidRuntime(13650): JNI_CreateJavaVM failed
> 08-20 08:03:41.656 I/Gecko ( 1149): [Parent 1149] WARNING: End of file: file /home/techm/surya/suryabuild/27_feb_build/home/techm/marvell/gecko/ipc/chromium/src/base/message_pump_libevent.cc, line 393
> 08-20 08:03:41.656 I/Gonk ( 1149): Error connecting to : netd (Connection refused) - will retry
> 08-20 08:03:41.656 I/Gonk ( 1149): Fail to connect to Netd
> 08-20 08:03:41.664 W/AudioSystem( 1149): AudioPolicyService server died!
> 08-20 08:03:41.664 W/AudioSystem( 1149): AudioFlinger server died!
> 08-20 08:03:41.664 I/ServiceManager( 104): service 'media.audio_policy' died
> 08-20 08:03:41.664 I/ServiceManager( 104): service 'media.audio_flinger' died
> 08-20 08:03:41.664 I/ServiceManager( 104): service 'media.player' died
> 08-20 08:03:41.664 I/ServiceManager( 104): service 'media.camera' died
> 08-20 08:03:41.664 I/ServiceManager( 104): service 'MarvellWFDAVManager' died
> 08-20 08:03:41.664 I/ServiceManager( 1149): Waiting for service media.audio_policy...
> 08-20 08:03:41.679 I/Netd (13652): Netd 1.0 starting
Maybe some static IP settings is lost during the process.
You can check IP, routing table, and dns settings of the devices to make sure if the static IP is set correctly.
| Assignee | ||
Comment 22•11 years ago
|
||
Another error in log, I think you should solve these issues first.
> 08-20 08:03:41.687 W/InterfaceController(13652): Warning (Cannot load library: load_library(linker.cpp:745): library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
Comment 23•11 years ago
|
||
I used static ip mode to conenct ip address. Now i am able to connect static ip address. In ui it is showing as connect. But in connectionInfoUpdate ipAddress:(void 0) or ipAddress:"". I clicked on browser and type url. Once i click on go button. Some times it showing unable to connect network url and some time b2g is restarting. PFB logs and attached adb logs.
Line 9977: 08-20 08:01:24.242 I/Gecko ( 1201): -*- WifiWorker component: Firing connectionInfoUpdate: ({signalStrength:-66, relSignalStrength:75, linkSpeed:54, ipAddress:""})
Line 10951: 08-20 08:01:29.203 I/Gecko ( 1201): -*- WifiWorker component: Firing connectionInfoUpdate: ({signalStrength:-67, relSignalStrength:73, linkSpeed:54, ipAddress:(void 0)})
Attachment #8480456 -
Flags: feedback?
Comment 24•11 years ago
|
||
(In reply to Chuck Lee [:chucklee] from comment #22)
> Another error in log, I think you should solve these issues first.
>
> > 08-20 08:03:41.687 W/InterfaceController(13652): Warning (Cannot load library: load_library(linker.cpp:745): library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
I am using static ip adress.
Now i am able to connect internet. Monday i able to browse internet in browse. Today i am unable to browse internet in browser. It showing Server not found. Can't find the server at http://www.google.com.
PFA below logs:
09-04 03:32:53.062 I/Gonk (11520): Error connecting to : netd (Connection refused) - will retry
09-04 03:32:53.062 I/Gonk (11520): Fail to connect to Netd
09-04 03:32:53.070 E/ (11520): GetPrevFBAcquireFd: FB acquire fence is invalid!
Comment 25•11 years ago
|
||
(In reply to Chuck Lee [:chucklee] from comment #21)
> It doesn't seem to be problem of static IP, if you set the parameters
> correctly, and static IP works correctly on flame.
> The log shows there's something wrong in your platform library and start to
> killing daemons, including netd.
>
> > 08-20 08:03:41.648 D/AndroidRuntime(13650):
> > 08-20 08:03:41.648 D/AndroidRuntime(13650): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
> > 08-20 08:03:41.648 D/AndroidRuntime(13650): CheckJNI is OFF
> > 08-20 08:03:41.648 E/AndroidRuntime(13650): JNI_CreateJavaVM failed
> > 08-20 08:03:41.656 I/Gecko ( 1149): [Parent 1149] WARNING: End of file: file /home/techm/surya/suryabuild/27_feb_build/home/techm/marvell/gecko/ipc/chromium/src/base/message_pump_libevent.cc, line 393
> > 08-20 08:03:41.656 I/Gonk ( 1149): Error connecting to : netd (Connection refused) - will retry
> > 08-20 08:03:41.656 I/Gonk ( 1149): Fail to connect to Netd
> > 08-20 08:03:41.664 W/AudioSystem( 1149): AudioPolicyService server died!
> > 08-20 08:03:41.664 W/AudioSystem( 1149): AudioFlinger server died!
> > 08-20 08:03:41.664 I/ServiceManager( 104): service 'media.audio_policy' died
> > 08-20 08:03:41.664 I/ServiceManager( 104): service 'media.audio_flinger' died
> > 08-20 08:03:41.664 I/ServiceManager( 104): service 'media.player' died
> > 08-20 08:03:41.664 I/ServiceManager( 104): service 'media.camera' died
> > 08-20 08:03:41.664 I/ServiceManager( 104): service 'MarvellWFDAVManager' died
> > 08-20 08:03:41.664 I/ServiceManager( 1149): Waiting for service media.audio_policy...
> > 08-20 08:03:41.679 I/Netd (13652): Netd 1.0 starting
>
> Maybe some static IP settings is lost during the process.
> You can check IP, routing table, and dns settings of the devices to make
> sure if the static IP is set correctly.
Hi below parametes i am passing for the static ip address.
setStaticIpMode(network, {
enabled: true,
ipaddr: "192.168.0.106",
proxy:"",
maskLength: 24,
gateway: "192.168.0.1",
dns1: "8.8.8.8",
dns2: "8.8.4.4"
})
Please let me know parameter are correct or not.
| Assignee | ||
Comment 26•11 years ago
|
||
(In reply to sb00349044 from comment #25)
> Hi below parametes i am passing for the static ip address.
> setStaticIpMode(network, {
> enabled: true,
> ipaddr: "192.168.0.106",
> proxy:"",
> maskLength: 24,
> gateway: "192.168.0.1",
> dns1: "8.8.8.8",
> dns2: "8.8.4.4"
> })
>
> Please let me know parameter are correct or not.
I mean use console command including "adb shell netcfg", "adb shell cat /proc/net/route", and "adb shell getprop | grep dns" to check if your IP/Gateway/DNS settings are set correctly.
Also you still have to check the crash I found in log above.
Comment 27•11 years ago
|
||
PFA screen shot.
Please let me know your view.
Attachment #8489204 -
Flags: feedback?
| Assignee | ||
Comment 28•11 years ago
|
||
Net network settings seems correct to me, I don't know why it doesn't work.
Comment 29•11 years ago
|
||
Hi
Check the below logs for static IP. Please let us know any thing is wrong.
Attachment #8490644 -
Flags: feedback?
Comment 30•11 years ago
|
||
This issue is resolved. U can close this issue.
You need to log in
before you can comment on or make changes to this bug.
Description
•