Ad-Hoc Networking

From WebOS Internals
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

To enable:

iwconfig eth0 mode ad-hoc essid pre 

This of course disconnects your existing wi-fi connection, so make sure you're connected via EVDO or USB.

This is just the standard linux method for enabling ad-hoc functionality. However, if you've got WiFi turned on via the Pre interface, it's not going to work for long, since the WiFi manager forces the device back into Managed mode periodically. In order to avoid this, you need to turn off the WiFi functionality through the webOS GUI. Then, bring the WiFi card up using:

/usr/sbin/wifidriver -i

This will load the driver for the WiFi card, but will not send any notifications to webOS, so it won't try to force the setting back to those it likes. At this point, the standard command above will work, and you can create an ad-hoc network. Useful for ssh-ing into your Pre when there are no access points available.

GUI enabled application to switch the mode coming soon..

Testing notes: Enabling wi-fi like this seems to turn it on full blast. The Pre battery will heat up quite a bit and if you're close to the device you may not get a decent signal due to overpowering principles of antenna theory.. Consider adding settings to limit wifi power output to 10-20% to help preserve battery life and minimize heat output. The nature of ad-hoc will guarantee some level of proximity, and therefore not need maximum power output. ~ Robi

root@castle:~# iwpriv eth0
eth0      Available private ioctls :
          extscan          (8BFA) : set   0 int   & get   2 char
          cachescanssid    (8BF0) : set   0 int   & get   2 char
          hostcmd          (8BE4) : set 2047 byte  & get 2047 byte
          arpfilter        (8BE6) : set 2047 byte  & get 2047 byte
          regrdwr          (8BE3) : set 256 char  & get 256 char
          sdcmd52rw        (8BFE) : set   7 byte  & get   7 byte
          sdcmd53rw        (8BFF) : set  32 char  & get  32 char
          setgetconf       (8BEA) : set 2000 byte  & get 2000 byte
          getcis           (8BE1) : set   0       & get 512 byte
          scantype         (8BEB) : set   8 char  & get   8 char
          getNF            (0001) : set   1 int   & get   1 int
          getRSSI          (0002) : set   1 int   & get   1 int
          bgscan           (0004) : set   1 int   & get   1 int
          enable11d        (0005) : set   1 int   & get   1 int
          adhocgrate       (0006) : set   1 int   & get   1 int
          sdioclock        (0007) : set   1 int   & get   1 int
          wmm              (0008) : set   1 int   & get   1 int
          uapsdnullgen     (000A) : set   1 int   & get   1 int
          setcoalescing    (000B) : set   1 int   & get   1 int
          adhocgprot       (000C) : set   1 int   & get   1 int
          enableroaming    (000D) : set   1 int   & get   1 int
          enablepwrmgmt    (000E) : set   1 int   & get   1 int
          chipenable       (000F) : set   1 int   & get   1 int
          wmm_qosinfo      (0002) : set   1 int   & get   1 int
          lolisteninter    (0003) : set   1 int   & get   1 int
          fwwakeupmethod   (0004) : set   1 int   & get   1 int
          psnullinterval   (0005) : set   1 int   & get   1 int
          bcnmisto         (0006) : set   1 int   & get   1 int
          adhocawakepd     (0007) : set   1 int   & get   1 int
          ldocfg           (0008) : set   1 int   & get   1 int
          sdiomode         (0009) : set   1 int   & get   1 int
          rtsctsctrl       (000E) : set   1 int   & get   1 int
          autodeepsleep    (000C) : set   1 int   & get   1 int
          wakeupmt         (000D) : set   1 int   & get   1 int
          setrxant         (0001) : set   1 int   & get   0
          settxant         (0002) : set   1 int   & get   0
          authalgs         (0004) : set   1 int   & get   0
          encryptionmode   (0005) : set   1 int   & get   0
          setregioncode    (0006) : set   1 int   & get   0
          setlisteninter   (0007) : set   1 int   & get   0
          setmultipledtim  (0008) : set   1 int   & get   0
          setbcnavg        (0009) : set   1 int   & get   0
          setdataavg       (000A) : set   1 int   & get   0
          associate        (000B) : set   1 int   & get   0
          getregioncode    (0001) : set   0       & get   1 int
          getlisteninter   (0002) : set   0       & get   1 int
          getmultipledtim  (0003) : set   0       & get   1 int
          gettxrate        (0004) : set   0       & get   1 int
          getbcnavg        (0005) : set   0       & get   1 int
          getdataavg       (0006) : set   0       & get   1 int
          getdtim          (0007) : set   0       & get   1 int
          getrxant         (0001) : set   0       & get  12 char
          gettxant         (0002) : set   0       & get  12 char
          gettsf           (0003) : set   0       & get  12 char
          wpssession       (0004) : set   0       & get  12 char
          deepsleep        (8BFB) : set   1 char  & get   6 char
          hostsleepcfg     (8BE5) : set  31 char  & get   0
          deauth           (0001) : set   0       & get   0
          adhocstop        (0005) : set   0       & get   0
          radioon          (0002) : set   0       & get   0
          radiooff         (0003) : set   0       & get   0
          rmaeskey         (0004) : set   0       & get   0
          wlanidle-on      (000A) : set   0       & get   0
          wlanidle-off     (000B) : set   0       & get   0
          sleepparams      (0002) : set  64 char  & get  64 char
          bca-ts           (0003) : set  64 char  & get  64 char
          scanmode         (0006) : set  64 char  & get  64 char
          getadhocstatus   (0009) : set  64 char  & get  64 char
          setgenie         (000A) : set  64 char  & get  64 char
          getgenie         (000B) : set  64 char  & get  64 char
          qstatus          (000D) : set  64 char  & get  64 char
          setaeskey        (0001) : set  32 char  & get   0
          getaeskey        (0001) : set   1 int   & get 128 char
          version          (0002) : set   1 int   & get 128 char
          verext           (0003) : set   1 int   & get 128 char
          setwpaie         (8BE0) : set  24 char  & get   0
          getlog           (8BE9) : set   0       & get 512 char
          tpccfg           (0001) : set  16 int   & get  16 int
          scanprobes       (0006) : set  16 int   & get  16 int
          ledgpio          (0005) : set  16 int   & get  16 int
          sleeppd          (0007) : set  16 int   & get  16 int
          rateadapt        (0008) : set  16 int   & get  16 int
          inactivityto     (0009) : set  16 int   & get  16 int
          getSNR           (000A) : set  16 int   & get  16 int
          getrate          (000B) : set  16 int   & get  16 int
          getrxinfo        (000C) : set  16 int   & get  16 int
          atimwindow       (000D) : set  16 int   & get  16 int
          bcninterval      (000E) : set  16 int   & get  16 int
          sdiopullctrl     (000F) : set  16 int   & get  16 int
          scantime         (0010) : set  16 int   & get  16 int
          dataevtcfg       (0012) : set  16 int   & get  16 int
          txcontrol        (0013) : set  16 int   & get  16 int
          hscfg            (0015) : set  16 int   & get  16 int
          hssetpara        (0016) : set  16 int   & get  16 int
          drvdbg           (0019) : set  16 int   & get  16 int
          setuserscan      (0001) : set 2000 byte  & get 2000 byte
          getscantable     (0002) : set 2000 byte  & get 2000 byte
          setmrvltlv       (0003) : set 2000 byte  & get 2000 byte
          getassocrsp      (0004) : set 2000 byte  & get 2000 byte
          addts            (0005) : set 2000 byte  & get 2000 byte
          delts            (0006) : set 2000 byte  & get 2000 byte
          qconfig          (0007) : set 2000 byte  & get 2000 byte
          qstats           (0008) : set 2000 byte  & get 2000 byte
          txpktstats       (000C) : set 2000 byte  & get 2000 byte
          getcfptable      (0009) : set 2000 byte  & get 2000 byte


root@castle:~# iwlist
Usage: iwlist [interface] scanning [essid NNN] [last]
              [interface] frequency
              [interface] channel
              [interface] bitrate
              [interface] rate
              [interface] encryption
              [interface] keys
              [interface] power
              [interface] txpower
              [interface] retry
              [interface] ap
              [interface] accesspoints
              [interface] peers
              [interface] event
              [interface] auth
              [interface] wpakeys
              [interface] genie
              [interface] modulation

root@castle:~# iwlist eth0 txpower
eth0      2 available transmit-powers :
          0 dBm         (1 mW)
          16 dBm        (39 mW)
          Current Tx-Power=10 dBm       (10 mW)

root@castle:~# iwconfig eth0
eth0      MRVL-SD8686  ESSID:"default"  Nickname:""
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:17:31:ED:CE:B1
          Bit Rate:54 Mb/s   Tx-Power=10 dBm
          Retry limit:9   RTS thr=2347 B   Fragment thr=2346 B
          Encryption key:****-****-**   Security mode:open
          Power Management:off
          Link Quality:0/100  Signal level:-54 dBm  Noise level:-93 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:5969
          Tx excessive retries:1824  Invalid misc:4005   Missed beacon:0

Finally, something promising I just stumbled on:

root@castle:~# wifi-mfg-labtool
Cannot Find File setup.ini
Cannot Find File setup.ini
Name:           DutApiClass
Version:        1.3.5.00
Date:           Wed Jul 15 21:09:03 2009


Note:
Static Object

Cannot Find File setup.ini
 DutIf_InitConnection: 0

8686 (802.11a/g/b) TEST MENU
------------------------------
11. Get RF Channel
        (5GHz Channels:
         36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165, 183, 184
        , 185, 187, 188, 189, 192, 196, 7, 8, 11, 12, 16, 34, 38, 42
        , 46, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140)
12. Set RF Channel (decimal)
13. Get RF DataRate (rate)
        (1 for  1M;  2 for  2M;  3 for 5.5M; 4 for 11M,  5 for 22M,
         6 for  6M;  7 for  9M;  8 for 12M;  9 for 18M, 10 for 24M,
        11 for 36M, 12 for 48M, 13 for 54M, 14 for 72M)
17. Set Continous Tx Mode
        (enable datarate (pattern=0))
18. Set CW Tx Mode (enable)
19. Set Carrier Suppression Tx Mode(enable)
22. Set Power at Antenna Using Cal data (decimal decimal [modulation=0]) (ch pow [b =0, g=1])
25. Set DutyCycle Tx Mode
        (enable dataRate ((payloadweight =50)(pattern=0)(shortPreamble=0))
27. Xosc Calibration (TU =10)
28. PSM cycling (NumOfCycle=1 (decimal) SleepDur=1000000(us)(decimal)
                rxDur=1000000(us)(decimal)  StableDelay=2000(us)(decimal))
29. Get RF Band (0 for 2.4G, 1 for 5G)
30. Set RF Band (band (0 for 2.4G, 1 for 5G))
31. Clear received packet Count (Start Rx FER test)
32. Get received packet Count (Stop Rx FER test)
33. Tx MultiCast Packet (0x)(len=400) (0x)(Count=64) (rate=4)
        (pattern=0xAA) (shortPreamble=1) (bssid-xx.xx.xx.xx.xx.xx)
34. Enable BSSID filter (enable bssid-xx.xx.xx.xx.xx.xx ssid-string)
39. SPI download from sbin file.
40. SPI Verify from sbin file
41. Dump E2PROM content
45. Read MACAddress (0|1 from Mac Reg or not)
46. Write MACAddress (xx.xx.xx.xx.xx.xx 0|1 (from Mac Reg or not))
53. Write CalTable (from file:CalDataFile.txt)
54. Read CalTable from EEPROM
88. FW Version
89. Load Dut configuration file (FileName)
95. Get Rf XTAL control
96. Set Rf XTAL control (setting(8 bits))
117. Tx IQ Cal Mode(enable(1|0)))
121. Thermal Compensation(enable(0|1), [TempRef, SlopNum, SlopDenom, CalInMs, PPACoeff, PACoeff])
99. Exit
125. Write PM Reg (0x 0x)(addr data)
126. Read PM Reg (0x 0x)(addr data)
Enter option:

It seems we have some things to play with. Notice 121. Thermal Compensation. ~Robi