[MOD][MAGISK][STOCK] TTL Tethering Fix - Asus ZenFone Max Pro M1 Themes, Apps, and Mods

Adds kernel module for changing packets' Time To Live (TTL) and sets TTL to 64. Requires stock ROM. This will help to workaround tethering restrictions set by your network operator.
Donate:
Yandex.Money: 4100144375295
PayPal: [email protected]

is there a way to get this on a nougat essential phone?

timjosten said:
Adds kernel module for changing packets' Time To Live (TTL) and sets TTL to 64. Requires stock 8.1 Oreo ROM. This will help to workaround tethering restrictions set by your network operator.
Donate:
Yandex.Money: 4100144375295
PayPal: [email protected]
Click to expand...
Click to collapse
Does this mod work on other phones too as long as it's rooted by Magisk and running Oreo?

billa said:
Does this mod work on other phones too as long as it's rooted by Magisk and running Oreo?
Click to expand...
Click to collapse
No, only this particular model is supported. Because kernel modules are kinda device-dependant.

timjosten said:
No, only this particular model is supported. Because kernel modules are kinda device-dependant.
Click to expand...
Click to collapse
Thanks, I'm currently running GoldenOrb OpenWRT firmware on a ZBT WG3526 mobile router which has full TTL settings support built into the UI.
I was wondering, would this this Linux command work on any rooted Android phone to change the system wide TTL value to 65, since any tethered device will also decrement it by 1, so the returned TTL would be 64?
For hotspot sharing
iptables -t mangle -A PREROUTING -i eth0 -j TTL --ttl-set 65
For RNDIS sharing
iptables -t mangle -A POSTROUTING -o rndis+ -j TTL --ttl-set 65

Anyone pls help me how to install viper4 android without causing bootloop through magisk

Related

USB to Ethernet dongle (from DealExtreme) - WORKS!

This is a DEV thread.
Unfortunately can't post in DEV forums as i never wrote in this site.
I've been working on enabling USB to Ethernet dongle on our Transformers as i didn't see any successful attempt in this area.
For my experiments I use USB to ethernet dongle from DealExtreme: (Link deleted. Can't post links. Search for "SKU 34691")
This dongle is based on ASIX AX88772B chipset.
Linux Driver was downloaded from: (Link deleted. Can't post links. Google for the driver v4.1.0)
I've compiled the driver with latest Clemsyn kernel downloaded from his git: (Link deleted. Can't post links)
The driver compiles without errors to asix.ko file (attached)
After insmoding the driver into the kernel i connected the dongle to USB port on the keyboard dock and connected RJ45 cable to it from my router. The blue led turned on and started to blink!! (Never happened before!).
Encouraged by this development i've executed the following sequence in terminal:
Code:
ifconfig eth0 10.0.1.17 netmask 255.255.255.0 broadcast 10.0.1.255
route add default gw 10.0.1.1
The commands executed without errors and i tried to ping my router
Code:
ping 10.0.1.1
and.. it WORKED!
Started pinging computers in my local LAN - everything WORKED!
Access to router web interface via browser - WORKS!
Here the happy story ends.
I couldn't manage to ping any IP addresses outside the local network.
I think i'm very close to make this work.
Any help will be appreciated.
Edit:
FULLY WORKS!!!
Need to add DNS configuration (i set to Google DNS server):
Code:
setprop net.dns1 8.8.8.8
And that is it!
USB to Ethernet dongle fully works on Asus Transformer
Edit 2:
Not all applications work with wired connection.
Browser and Gmail work, but Skype does not.
Need to investigate further.
Good stuff! It would be nice to have the option to use a wired network in case you needed to! Great work!
dear Quiethinker~~
i have been searching for whole day and finally reach your post. good stuffs
it would be even better if you can share the procedures step by step, such as how to "insmod" ....
thank you very much~~
jaseli said:
dear Quiethinker~~
i have been searching for whole day and finally reach your post. good stuffs
it would be even better if you can share the procedures step by step, such as how to "insmod" ....
thank you very much~~
Click to expand...
Click to collapse
I'll try to explain the procedure step by step (a bit improved sequence since my first trails):
1. Get USB to Ethernet dongle from DealExtreme (SKU 34691) - Do not attach it yet.
2. Install terminal application on the Transformer (such as "Android Terminal Emulator")
3. Turn off the WIFI.
4. Extract axis.ko.zip to some location in the Transformer (for example root of the sdcard)
5. Open terminal application and execute the following commands in the command line:
Code:
su
insmod [PATH_TO_KO]/axis.ko
6. Attach USB to Ethernet dongle to USB port on the Transformer's dock and connect RJ45 network cable. (Blue led on the dongle should start blinking)
7. Execute the following commands in the command line:
Code:
/system/bin/dhcpdc eth0
setprop net.dns1 8.8.8.8
8. Test that you have internet connection:
Code:
ping google.com
Currently there is lots of limitations with this solution:
- I compiled the KO module with clemsyn kernel v8b and checked only with this kernel.
- Android system doesn't recognize wired connection and therefore many apps think that there is no connection available
- When transformer going to power-down mode it disconnects the USB network. After waking up need to execute step 7 again.
I'm currently working on several directions in this area:
- Enabling support for more USB to Ethernet sticks within the kernel (custom kernel release is needed unless kernel devs will push the changes into their kernels)
- Enabling automatic configuration for wired network in android (Some scripting)
The achievement in this post is a proof of concept. I'm making a progress but very slowly due to very limited time. I hope more devs will pick this up.
Also attaching the sources for asix.ko driver so people can compile it with different available kernels
The drivers for ASIX AX88772B chipset are already in the kernel
I have one of these usb-eth dongles too and it works without the need for any extra drivers.
I simply run dhcpcd eth0 to pickup an ip address from dhcp and then setprop net.dns1 8.8.8.8 for dns.
I have an EDIMAX EU-4207
Other dongles using this chipset include the WII adapter, the Apple dongle and the linksys/cisco USB200M or USB300M
Roach2010 said:
The drivers for ASIX AX88772B chipset are already in the kernel
I have one of these usb-eth dongles too and it works without the need for any extra drivers.
I simply run dhcpcd eth0 to pickup an ip address from dhcp and then setprop net.dns1 8.8.8.8 for dns.
I have an EDIMAX EU-4207
Other dongles using this chipset include the WII adapter, the Apple dongle and the linksys/cisco USB200M or USB300M
Click to expand...
Click to collapse
Good to know that your kernel includes it!
(Checked your GITHUB, do your refer to CONFIG_USB_NET_AX8817X=y ?)
Till now i worked with Clemsyn-Blades kernel and this wasn't included (maybe need to switch kernels )
Now only need to find automatic way to configure eth0 on insert/wake-up and it will be usable for regular users.
Quiethinker said:
Good to know that your kernel includes it!
(Checked your GITHUB, do your refer to CONFIG_USB_NET_AX8817X=y ?)
Till now i worked with Clemsyn-Blades kernel and this wasn't included (maybe need to switch kernels )
Now only need to find automatic way to configure eth0 on insert/wake-up and it will be usable for regular users.
Click to expand...
Click to collapse
Ah yes, Asus added support since 3.2. I think we can enable it via a service call in init.rc but eth0 doesn't play too well with wlan0 I've found.
proby a dumb question anyways
but has to be a rooted device doesn't it?
lil-devil said:
proby a dumb question anyways
but has to be a rooted device doesn't it?
Click to expand...
Click to collapse
Shortly - yes
Ok, it works well with my USB Lan adapter (Browser, Market browsing, etc.), but if I want to download an app from the market it doesnt work (only over Bluetooth or Wifi).
Lines I used:
dhcpcd eth0
setprop net.dns1 8.8.8.8
Is there a solution for the market download problem?
Would one or both of these adapters be supported?
http://www.monoprice.com/products/subdepartment.asp?c_id=103&cp_id=10311&cs_id=1031102
Thanks.
No: Product ID: 6150
Maybe: Product ID: 5345
You need NetGear FA 120 (search ebay)
xperiaflooter said:
Ok, it works well with my USB Lan adapter (Browser, Market browsing, etc.), but if I want to download an app from the market it doesnt work (only over Bluetooth or Wifi).
Lines I used:
dhcpcd eth0
setprop net.dns1 8.8.8.8
Is there a solution for the market download problem?
Click to expand...
Click to collapse
Its a problem with honeycomb. Currently it doesn't support wired connections. We can trick it on "kernel level" but some applications use additional API to check for connectivity. Currently I don't know how to trick this API.
Sent from my HD2 using xda premium
Thanks for the info. But I dont know why Asus integrated USB LAN drivers, without automatic loaders. That makes no sense. But,... ok, I am glad that the driver is inside
xperiaflooter said:
Thanks for the info. But I dont know why Asus integrated USB LAN drivers, without automatic loaders. That makes no sense. But,... ok, I am glad that the driver is inside
Click to expand...
Click to collapse
Maybe in some future honeycomb update this feature will be built-in.
I really hope so at least!
I was able to get my USB 2.0 NIC working without a module on Stock3.2 (rooted) and Prime! 1.8.4.
I found a script on here that I placed in /data/ for DHCP
Code:
#!/system/bin/sh
netcfg eth0 dhcp
dhcpcd eth0
DNS1 = `getprop net.eth0.dns1`
DNS2 = `getprop net.eth0.dns2`
setprop net.dns1 $DNS1
setprop net.dns2 $DNS2
Here is the one for static.
Code:
#!/system/bin/sh
busybox ifconfig eth0 192.168.1.22
route add default gw 192.168.1.1
setprop net.dns1 8.8.8.8
setprop net.dns2 8.8.4.4/
Here is the original post from XDA user : Linuxslate
http://forum.xda-developers.com/showpost.php?p=14367749&postcount=41
I don't recall the brand, but here is the chipset.
http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=97;71;101&PLine=71
ciphercore said:
I was able to get my USB 2.0 NIC working without a module on Stock3.2 (rooted) and Prime! 1.8.4.
.....
I don't recall the brand, but here is the chipset.
http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=97;71;101&PLine=71
Click to expand...
Click to collapse
That's pretty cool. The Cisco-Linksys USB300M adapter appears to be using that same chipset, so I went ahead and ordered one. I should receive it sometime next week, at which time I'll report back if it works.
I'm working now
Running 3.2 with the latest build 8.5.9. It seems to have the needed driver built in corectly. I've then taken the following script and put it in /system/sbin (I called it wired) The apple USB to ethernet adapter is the one I'm using (cheapest available)
#!/system/bin/sh
ifconfig eth0
if [ $? -gt "0" ]; then
netcfg eth0
dhcpcd eth0
export DNS1=`getprop net.eth0.dns1`
export DNS2=`getprop net.eth0.dns2`
setprop net.dns1 $DNS1
setprop net.dns2 $DNS2
else
netcfg eth0 down
fi
If the device is not up $? will be larger than 0 (0 is success and if the device is down the command fails.) So the script brings up eth0. If eth0 is up $? equals 0 and the script brings the device down cleanly.
Now If I can just figure out how to turn this into an icon on the desktop I'll be all set
linuxrebel said:
Running 3.2 with the latest build 8.5.9. It seems to have the needed driver built in corectly. I've then taken the following script and put it in /system/sbin (I called it wired) The apple USB to ethernet adapter is the one I'm using (cheapest available)
#!/system/bin/sh
ifconfig eth0
if [ $? -gt "0" ]; then
netcfg eth0
dhcpcd eth0
export DNS1=`getprop net.eth0.dns1`
export DNS2=`getprop net.eth0.dns2`
setprop net.dns1 $DNS1
setprop net.dns2 $DNS2
else
netcfg eth0 down
fi
If the device is not up $? will be larger than 0 (0 is success and if the device is down the command fails.) So the script brings up eth0. If eth0 is up $? equals 0 and the script brings the device down cleanly.
Now If I can just figure out how to turn this into an icon on the desktop I'll be all set
Click to expand...
Click to collapse
Great script!
Search for GScript app on the market. This is what you looking for
earlyberd said:
That's pretty cool. The Cisco-Linksys USB300M adapter appears to be using that same chipset, so I went ahead and ordered one. I should receive it sometime next week, at which time I'll report back if it works.
Click to expand...
Click to collapse
Just to update, the USB300M works fine as well.

[FIX] [DRIVER] Kernel Module Pack V4

Here is kernel module pack version 4.
The modules should load without any problems.
If you need more drivers, PM me the module name or the .config changes.
Installing:
Create a directory /data/local/modules and copy the *.ko files to /data/local/modules via your method of choice (e.g., Root Explorer)
Fix for hangs/stalls/lags, because of background disk I/O
Code:
su
cd /data/local/modules
insmod cfq-iosched.ko
echo cfq >/sys/block/mmcblk0/queue/scheduler
Modules for some Logitech Joysticks:
Code:
su
cd /data/local/modules
insmod ff-memless.ko
insmod hid-logitech.ko
Modules for IPSec VPN support:
Code:
su
cd /data/local/modules
insmod tun.ko
insmod ah4.ko
insmod xfrm_user.ko
insmod xfrm4_mode_tunnel.ko
Modules included are:
Code:
adi.ko
ah4.ko
cifs.ko
cfq-iosched.ko
deadline-iosched.ko
ff-memless.ko
gameport.ko
hid-logitech.ko
iforce.ko
ipip.ko
md4.ko
tun.ko
xfrm4_mode_tunnel.ko
xfrm_user.ko
The file config.txt in the zip archive is the actual .config used.
Howto build them?
Install chroot Ubuntu or any other distribution on your Prime.
chroot to the distribution
wget the kernel source from Asus
$ mkdir linux; cd linux
unpack the kernel source here
modify Makefile, Find the CFLAGS_MODULE line, add -fno-pic this flag to the end of the line: CFLAGS_MODULE = -fno-pic
$ zcat /proc/config.gz > .config
$ make oldconfig
modify .config or use "make menuconfig"
$ make -j5 modules
$ make modules_install
$ depmod -a
$ find /lib/modules/$(uname -r) -name '*.ko'
Module description:
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_XFRM_USER=m
Support for IPsec user configuration interface used by native Linux tools.
Module: xfrm4_mode_tunnel.ko xfrm_user.ko
+CONFIG_NET_IPIP=m
IP tunneling
http://cateee.net/lkddb/web-lkddb/NET_IPIP.html
Module: ipip.ko
+CONFIG_INET_AH=m
Support for IPsec AH.
Module: ah4.ko
+CONFIG_TUN=m
http://cateee.net/lkddb/web-lkddb/TUN.html
TUN/TAP provides packet reception and transmission for user space programs. It can be viewed as a simple Point-to-Point or Ethernet device, which instead of receiving packets from a physical media, receives them from user space program and instead of sending packets via physical media writes them to the user space program.
+CONFIG_HID_LOGITECH=m
+CONFIG_INPUT_FF_MEMLESS=m
Modules for Logitech FF pads, wheels, joysticks
Module: ff-memless.ko hid-logitech.ko
+CONFIG_GAMEPORT=m
+CONFIG_JOYSTICK_ADI=m
Logitech ADI digital joysticks and gamepads
Might not be needed on the prime, because there is no gameport
Module: gameport.ko adi.ko
+CONFIG_JOYSTICK_IFORCE=m
http://cateee.net/lkddb/web-lkddb/JOYSTICK_IFORCE.html
vendor: 044f ("ThrustMaster, Inc."), product: a01c
vendor: 046d ("Logitech, Inc."), product: c281 ("WingMan Force")
vendor: 046d ("Logitech, Inc."), product: c291 ("WingMan Formula Force")
vendor: 05ef ("AVB, Inc. [anko?]"), product: 020a ("Top Shot Pegasus Joystick")
vendor: 05ef ("AVB, Inc. [anko?]"), product: 8884 ("Mag Turbo Force Wheel")
vendor: 05ef ("AVB, Inc. [anko?]"), product: 8888 ("Top Shot Force Feedback Racing Wheel")
vendor: 061c ("Act Labs, Ltd"), product: c084
vendor: 061c ("Act Labs, Ltd"), product: c0a4
vendor: 06f8 ("Guillemot Corp."), product: 0001
vendor: 06f8 ("Guillemot Corp."), product: 0003
vendor: 06f8 ("Guillemot Corp."), product: 0004
vendor: 06f8 ("Guillemot Corp."), product: a302
Module: iforce.ko
+CONFIG_CIFS=m
+CONFIG_CRYPTO_MD4=m
This is the client VFS module for the Common Internet File System (CIFS) protocol which is the successor to the Server Message Block (SMB) protocol, the native file sharing mechanism for most early PC operating systems. The CIFS protocol is fully supported by file servers such as Windows 2000 (including Windows 2003, NT 4 and Windows XP) as well by Samba (which provides excellent CIFS server support for Linux and many other operating systems). Limited support for OS/2 and Windows ME and similar servers is provided as well.
Module: cifs.ko md4.ko
ChangeLog:
v4:
cfq-iosched.ko
deadline-iosched.ko
v3:
added cifs.ko
v2:
stripped the modules from the debug symbols, package is much smaller now
Version 2 now a lot smaller, because the debugging symbols have been removed.
added cifs.ko
Could you attach the .config you're using?
Thanks
curreyr said:
Could you attach the .config you're using?
Thanks
Click to expand...
Click to collapse
It's in the zip-file ... "config.txt"
Any list as to what each of these new driver modules included goes with? are these like controller drivers or different/new USB drivers not included on stock prime. just trying to find out what each of them go to.
kind of surprised to see:
# CONFIG_CRYPTO_DEV_TEGRA_AES is not set
My initial looking indicates that unless that's baked in, android might not make use of it
I'll research a bit more tho.
Should be useful when we can get custom ROMs in the oven!
demandarin said:
Any list as to what each of these new driver modules included goes with? are these like controller drivers or different/new USB drivers not included on stock prime. just trying to find out what each of them go to.
Click to expand...
Click to collapse
Added some more information about the modules, what I could find quickly..
Did you explicitly use the NDK to cross-compile? Or did the package from Asus just work?
Noxious Ninja said:
Did you explicitly use the NDK to cross-compile? Or did the package from Asus just work?
Click to expand...
Click to collapse
The package from Asus just works for the modules at least.
Noxious Ninja said:
Did you explicitly use the NDK to cross-compile? Or did the package from Asus just work?
Click to expand...
Click to collapse
Oh, and I didn't cross compile... I compiled natively on the Prime in a chrooted Ubuntu.
saturn_de said:
Oh, and I didn't cross compile... I compiled natively on the Prime in a chrooted Ubuntu.
Click to expand...
Click to collapse
Since Asus had only release .7 kernel version, I assume this would not be with source from latest ota.
I plan to try it on .11ota. Have anyone successfully use it on latest ota?
Thanks.
warmRLS1+Anthrax
saturn_de said:
Oh, and I didn't cross compile... I compiled natively on the Prime in a chrooted Ubuntu.
Click to expand...
Click to collapse
Oh, cool. I didn't even think to try that.
Noxious Ninja said:
Oh, cool. I didn't even think to try that.
Click to expand...
Click to collapse
Yeah, you can "make modules_install; depmod -a" and afterwards you can "modprobe" any modules without thinking about the dependencies
huytrang90 said:
Since Asus had only release .7 kernel version, I assume this would not be with source from latest ota.
I plan to try it on .11ota. Have anyone successfully use it on latest ota?
Thanks.
warmRLS1+Anthrax
Click to expand...
Click to collapse
Well, it's kernel version 2.6.39.4 in all ICS Prime version so far.
saturn_de said:
Well, it's kernel version 2.6.39.4 in all ICS Prime version so far.
Click to expand...
Click to collapse
Yea the kernel is the same and the modules work fine for me on .11
This might not be the correct place for this and if so I apologize.
Is this thread about finding/compiling drivers for things so that they will work when plugged into the usb port on the keyboard dock? If so how would I go about making this usb headset work?
http://h10025.www1.hp.com/ewfrf/wc/...n&lc=en&product=4085832&task=prodinfoCategory
Again I am sorry if I have totally misunderstood the point of this thread. Thanks!
version 4 now with:
cfq-iosched.ko
deadline-iosched.ko
Fix for hangs/stalls/lags, because of background disk I/O
Code:
su
cd /data/local/modules
insmod cfq-iosched.ko
echo cfq >/sys/block/mmcblk0/queue/scheduler
Nico^APEX said:
This might not be the correct place for this and if so I apologize.
Is this thread about finding/compiling drivers for things so that they will work when plugged into the usb port on the keyboard dock? If so how would I go about making this usb headset work?
http://h10025.www1.hp.com/ewfrf/wc/...n&lc=en&product=4085832&task=prodinfoCategory
Again I am sorry if I have totally misunderstood the point of this thread. Thanks!
Click to expand...
Click to collapse
Ok, boot your PC/Laptop from a Linux Live CD or a locally installed Linux. Log in, start a terminal, plug in the headset and show me the output of:
# dmesg | tail -20
# lsusb
# lsmod

[Q] Reverse bluetooth tethering: connect YP-G70 to the internet via bluetooth

After realising the player won't connect to my Skype Phone S2 to nick the internet, I did a bit of "hacking":
1) Rooted the device
2) Installed Nook Color Bluetooth Tether from Google Play
3) After realising Nook Color is not working, tried running pand --connect, got "Failed to open control socket: Protocol not supported" error message
4) Dowloaded the Samsung kernel source and cross-compiled it to get the missing bnep.ko module for my kernel version.
5) Successfully inserted the mod (lsmod reports live). However pand --connect [address] does not return anything, neither does pand -l
I am running out of ideas how to get the player to connect to the skypephone. Any ideas?
I bought the player as a replacement of hx4700 (released in 2004), which was able to tether with my skypephone easily. I still can not believe that this modern device is lacking the feature.
a.fiodorov said:
After realising the player won't connect to my Skype Phone S2 to nick the internet, I did a bit of "hacking":
1) Rooted the device
2) Installed Nook Color Bluetooth Tether from Google Play
3) After realising Nook Color is not working, tried running pand --connect, got "Failed to open control socket: Protocol not supported" error message
4) Dowloaded the Samsung kernel source and cross-compiled it to get the missing bnep.ko module for my kernel version.
5) Successfully inserted the mod (lsmod reports live). However pand --connect [address] does not return anything, neither does pand -l
I am running out of ideas how to get the player to connect to the skypephone. Any ideas?
I bought the player as a replacement of hx4700 (released in 2004), which was able to tether with my skypephone easily. I still can not believe that this modern device is lacking the feature.
Click to expand...
Click to collapse
Are you running pand from the Player? What does logcat show after? Are you running stock rom? Does "netcfg" show a bnep0 device?
If you have a 5.0, I can confirm that I've gotten bluetooth networking working using the CM7 ROM in the development section.
Thank you for informing me about CM7, but current alpha is not good for me though. I ll keep checking the progress.
logcat showed:
"E/pand (22197): Connect to 00:12:40:53:AC:A4 failed. No route to host(113)"
bnep0 is missing from netcfg output.
You think that uploading the compiled kernel, with bnep.ko might solve it?
a.fiodorov said:
Thank you for informing me about CM7, but current alpha is not good for me though. I ll keep checking the progress.
logcat showed:
"E/pand (22197): Connect to 00:12:40:53:AC:A4 failed. No route to host(113)"
bnep0 is missing from netcfg output.
You think that uploading the compiled kernel, with bnep.ko might solve it?
Click to expand...
Click to collapse
I could be wrong, but I didn't think stock gingerbread android bluetooth stack supported networking. I know ICS does. But then again if pand is available..
Is hciconfig there? What does hciconfig -a show?
BlueZ
BlueZ (hciconfig) is not installed.
pand is from /system/bin, so it's not from BusyBox, which is in /system/xbin in my case.
How can I test that the bnep module is functioning?
P.S. might be easer to go for CM7, but I am running exactly the same kernel CM requires: rj13 (for international).
a.fiodorov said:
BlueZ is not installed.
pand is from /system/bin, so it's not from BusyBox, which is in /system/xbin in my case.
How can I test that the bnep module is functioning?
P.S. might be easer to go for CM, but I am running exactly the same kernel CM requires: rj13 (for international). So I am not convinced other rom is necessarily.
Click to expand...
Click to collapse
There's more to it than just loading the bnep module. It will be pretty tough to figure out what's going on without hciconfig/hcitool/l2ping. You could try
Code:
cat /sys/class/bluetooth/hci0/class
With CM7 bluetoothd this shows 0x5a020c on my player. The third byte (0x5a) shows the service classes supported, and the second bit is whether Networking is supported.
@ambrice,
Just realised that it's you who ported CM7. Kudos!
I am very tempted to try bluetooth tethering from CM7, could you address my concern that I will be running the same kernel (rj13), so how will ROM be able to fix my (possibly) not working bnep0?
>>cat /sys/class/bluetooth/hci0/class
cat: can't open '/sys/class/bluetooth/hci0/class': No such file or directory
a.fiodorov said:
@ambrice,
Just realised that it's you who ported CM7. Kudos!
I am very tempted to try bluetooth tethering from CM7, could you address my concern that I will be running the same kernel (rj13), so how will ROM be able to fix my (possibly) not working bnep0?
>>cat /sys/class/bluetooth/hci0/class
cat: can't open '/sys/class/bluetooth/hci0/class': No such file or directory
Click to expand...
Click to collapse
There is a userspace component to setting up bluetooth networking. It's not all done by the bnep module.
It's weird that you have no hci0. Is your bluetooth turned on? Is there anything in /sys/class/bluetooth?
rj13 kernel is incompatible with CM7. However, the kernel that comes with the CM7 ROMs has bnep turned on, and I have been using it to do reverse bluetooth tethering.
Sorry did not realise the kernel for CM7 is different.
I am now running CM7 and still looking for tethering settings in GUI.
EDIT: Still can not find it
a.fiodorov said:
Sorry did not realise the kernel for CM7 is different.
I am now running CM7 and still looking for tethering settings in GUI.
EDIT: Still can not find it
Click to expand...
Click to collapse
There isn't an easy gui setting to do that, the normal way to do bluetooth tethering is to run the pand connect from another device such as a PC, and CyanogenMod has a pand listening for connections and shares its internet, because the normal case is for a laptop to connect to a phone's cell network.
But running pand from the player should work now and give you a bnep0 device that you can configure. Easiest way is to put the steps in a script and run it to connect.
The bluetooth won't come on: says it's in airplane mode. Wifi ignores it though.
So should I fire up pand -c [address] from the player and I am ready to go?
Did not work when bluetooth was still on.
a.fiodorov said:
The bluetooth won't come on: says it's in airplane mode. Wifi ignores it though.
So should I fire up pand -c [address] from the player and I am ready to go?
Did not work when bluetooth was still on.
Click to expand...
Click to collapse
pand will get the bnep0 network device to show up. Then you need to use dhcpcd or ifconfig to configure the network device.
# pand -c 00:12:40:53:AC:A4
# netcfg
lo UP 127.0.0.1 255.0.0.0 0x00000049
ifb0 DOWN 0.0.0.0 0.0.0.0 0x00000082
ifb1 DOWN 0.0.0.0 0.0.0.0 0x00000082
usb0 DOWN 0.0.0.0 0.0.0.0 0x00001002
tunl0 DOWN 0.0.0.0 0.0.0.0 0x00000080
sit0 DOWN 0.0.0.0 0.0.0.0 0x00000080
ip6tnl0 DOWN 0.0.0.0 0.0.0.0 0x00000080
Click to expand...
Click to collapse
Still no bnep0 . The bluetooth is on.
After some googling found a command:
# sdptool search dun
Inquiring ...
Searching for dun on 00:12:40:53:AC:A4 ...
Service Name: Dial-up Networking
Service RecHandle: 0x10009
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 8
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100
Click to expand...
Click to collapse
What am I missing?
CM
for people who found this thread, here's a potentially very useful link:
http://forum.cyanogenmod.com/topic/...r-blackberry-phone-via-bluetooth/#entry268658
I will see what I can make of it
CM7
I tried the above guide with CM7, and that's the error I got: "Couldn't set tty to PPP discipline: Invalid argument". pptpclient.sourceforge.net says it's just a matter of ppp_async module. I will see if I can get ambrice to include it into the kernel.
any progress or info on this?
I have tried entropy512 as well as rj's kernel and not found the beep module. I also loaded CM7 Rom and got a boot loop. I updated to CM9 and it booted but still no beep module.
Any info would be appreciated.
Thanks.
Try ambrice's ppp_async kernel module with his latest CM7. Use the guide above to get the reverse tethering. That's the only solution I found so far.
Here's the module: http://www.2shared.com/file/PTXe8_Y-/ppp_async.html

[Q] Wifi tethering uses slightly broken iptables line for masquerading?

As seen when I type with wifi tethering enabled
iptables -L -t nat -v
the MASQUERADE line is like "-o pdp0 -i any", this means that packets are matched only when they exit via the mobile network.
However, the line should be more like "-i softap0 ! -o softap0". The MASQUERADE line should match packets that enter via the wifi access point, and leave via any other interface. (But see below, -i doesn't work, must use -s)
I found this while trying to use openvpn. When openvpn is running, the android device has complete access to the vpn according to my tests. The laptop associated with the AP can access the internet, the android device, but not the network behind the VPN connection. I can find no reason for this other than the MASQUERADE line. The routing table, sysctl *.forward etc. are all looking fine.
With this MASQUERADE line, it cannot possibly work, because when the unmasqueraded softap0 packets go down the tun0 interface, no machine knows where to route the reply packets.
This is on Android 2.3, Samsung galaxytab stock firmware. I'll investigate further.
Update:
when I stop tethering, the MASQUERADE rule goes away. This proves it's indeed controlled by tethering.
I tried it on Android 4.0, Sony Xperia pro, Cyanogenmod 9 ---> same thing
I can understand that noone ever thinks about making a MASQUERADE line with "-i interface", but it seems actually the right thing to me. (Must use -s addr/mask instead) I'm doing this on a laptop with lots of virtual machines connected to an internal network. This must be masqueraded for outgoing packets, no matter what interface it goes out (wlan0, eth0, openvpn etc.)
Update:
-i interface doesn't work in POSTROUTING. So the line should be "-s address_range_of_softap ! -o interface".
This complicates matters for a workaround. I'm planning to schedule a script at boot time, but I don't know how to (correctly) find the softap address when it's not running.
Update:
I tried tethering and replaced the iptables rule with "-s address_range_of_softap ! -o softap0" instead of just "-o pdp0". This still works to route/masquerade traffic to the internet, but doesn't work vor tun0 (openvpn). I don't know why. No packets/bytes go through it (counter doesn't increase) when pinging the other side of the vpn.

[Q] [XPERIA P] Configuring wireless adapter

Hi,
The goal of my project is to implement mobile ad-hoc network routing protocol(AODV).
My problem is that I need to reconfigure the wireless driver/adapter to be able to work in ad-hoc mode. This means receiving packets from other nodes and resending packets if 2 nodes which want to communicate are far away from each other.
I don't have experience with drivers changing and I'm noob in Linux.
For better imagination, I've got source code for the Nexus One and HTC Hero and this code should be able to change wireless drivers configuration on these devices.
Here's the code for Nexus One:
Code:
case 0: //NEXSUS
system("insmod /system/lib/modules/bcm4329.ko");
snprintf(cmd, sizeof cmd, "ifconfig eth0 %s netmask 255.255.255.0", ip);
printf("\ncmd: %s\n", cmd);
system(cmd);
system("ifconfig eth0 up");
system("iwconfig eth0 mode ad-hoc");
system("iwconfig eth0 essid nexusbac");
system("iwconfig eth0 channel 6");
system("iwconfig eth0 commit");
break;
And here for the HTC Hero
Code:
system("insmod /system/lib/modules/wlan.ko");
system("wlan_loader -f /system/etc/wifi/Fw1251r1c.bin -e /proc/calibration -i /data/local/bin/tiwlan.ini");
snprintf(cmd, sizeof cmd, "ifconfig tiwlan0 %s netmask 255.255.255.0", ip);
system(cmd);
system("ifconfig tiwlan0 up");
break;
I was wondering if you could give me some advice what commands to use.
My Sony Xperia P is Rooted and I'm using Honami Moonwalker V8 ROM.
It seems that command ifconfig is not working. If I try to execute e.g
Code:
ifconfig eth0 up
android shell throws this error:
ifconfig eth0 up
error: SIOCGIFFLAGS (No such device)
Thank you for your answers. I really appreciate the time you give to this thread.
Try wlan0
ChikeD said:
Try wlan0
Click to expand...
Click to collapse
thanks ChikeD, it seems that wlan0 works fine for ifconfig but it seems that iwconfig binary is missing. Are there any alternatives for this shell command in Android?
I tried to use iwconfig binary from Android tethering project but using it throws an error like this:
Code:
[email protected]:/ # iwconfig wlan0 essid xperiaP
SET failed on device wlan0; Invalid argument
Ageiris said:
thanks ChikeD, it seems that wlan0 works fine for ifconfig but it seems that iwconfig binary is missing. Are there any alternatives for this shell command in Android?
I tried to use iwconfig binary from Android tethering project but using it throws an error like this:
Code:
[email protected]:/ # iwconfig wlan0 essid xperiaP
SET failed on device wlan0; Invalid argument
Click to expand...
Click to collapse
There is iw binary see what you can make out of that.
ChikeD said:
There is iw binary see what you can make out of that.
Click to expand...
Click to collapse
Thanks, this looks very interesting. I'll give some feedback later if I manage to make it work
Ageiris said:
Thanks, this looks very interesting. I'll give some feedback later if I manage to make it work
Click to expand...
Click to collapse
You changing the driver source?
ChikeD said:
You changing the driver source?
Click to expand...
Click to collapse
I just need to make it work in the ad-hoc mode. If think it's an IBSS mode. I just need to figure out, how to setup this type of connection
Ageiris said:
I just need to make it work in the ad-hoc mode. If think it's an IBSS mode. I just need to figure out, how to setup this type of connection
Click to expand...
Click to collapse
Assuming(thinking) is not an option.
From a brief look at the sources it seems the ad-hoc is not implemented.
ChikeD said:
Assuming(thinking) is not an option.
From a brief look at the sources it seems the ad-hoc is not implemented.
Click to expand...
Click to collapse
Sorry for delay.
So you don't consider an IBSS mode as a true ad-hoc mode? Am I right? I thought that IBSS is like a synonym of the term "ad-hoc"
According to this website: http://en.kioskea.net/contents/804-wifi-modes-of-operation-802-11-or-wi-fi
It should be the same.
To my problem. I've made this commands to work:
Code:
/*Bring the interface up (an additional step like rfkill unblock wifi might be needed: ip link set wlan0 up*/
system("iw dev wlan0 set type ibss"); //Set the operation mode to ibss ):
system("iw dev wlan0 ibss join MyAdHocNetwork 2412") //frequency for channel 6: 2437, 2412 for channel 1...
system("ip addr add 192.168.1.2/24 broadcast 192.168.1.255 dev wlan0");
system("ip route add default via 192.168.1.1");
What do you think?
Thanks
Seems so, does it work?
ChikeD said:
Seems so, does it work?
Click to expand...
Click to collapse
I don't know yet. I seems that everything is set up. Now I need to buy at least another xperia p or similar smartphone to test communication.
I am now trying to run ad-hoc mode on HTC Desire and Tablet Prestigio Multipad 3270b. But it's pain, because they don't have iwconfig and iw binaries.
Ageiris said:
I don't know yet. I seems that everything is set up. Now I need to buy at least another xperia p or similar smartphone to test communication.
I am now trying to run ad-hoc mode on HTC Desire and Tablet Prestigio Multipad 3270b. But it's pain, because they don't have iwconfig and iw binaries.
Click to expand...
Click to collapse
So what is the purpose of this?
Doesn't have to be a smartphone, you can do it with a wireless pc/laptop
http://windows.microsoft.com/en-us/windows/set-computer-to-computer-adhoc-network#1TC=windows-7
http://www.tp-link.com/en/article/?id=219
ChikeD said:
So what is the purpose of this?
Doesn't have to be a smartphone, you can do it with a wireless pc/laptop
http://windows.microsoft.com/en-us/windows/set-computer-to-computer-adhoc-network#1TC=windows-7
http://www.tp-link.com/en/article/?id=219
Click to expand...
Click to collapse
Thanks for the links. The goal of my project is to run ad-hoc mode on android. I will definitely test this later using windows but I am running out of time, so I'm focusing mainly to at least changing wireless mode from managed to ad-hoc. That's the most difficult thing because right now I am not able to change wireless mode on HTC and Prestigio using linux system commands. Maybe there is a way to change wireless mode programmatically (Java or C) but I haven't found that information yet.

Categories

Resources