WIFI ADHOC Peer to Peer COMM

balistreri1

Member
Licensed User
Longtime User
I have an application that requires communicating with a remote
WIFI device using Peer to Peer or ADHOC mode.

Essentially, Andoid WIFI default settings search for and connects to
only WIFI Networks, whereas Bluetooth searches for and connects to
several Bluetooth device profiles, such as SPP(Serial)..

Now, I have my application already working well using Bluetooth Serial
except the range limits me to about 30 feet or 10 meters.

Question: Can anyone help solve this problem?

(Basci4Android APP WIFI) <===> (external WIFI ADHOC peer to peer Device)
Bidirectional data link.................
 

Stulish

Active Member
Licensed User
Longtime User
Is there a wrapper for this WifiP2p or a library for B4A, i need to connect to a adhoc network for an app a company want me to make, otherwise they will go with iPads

Cheers
 
Last edited:
Upvote 0

Stulish

Active Member
Licensed User
Longtime User
can the reflections library be used for this, what i need to do is connect to a know IP address and Port, and then just listen for the data being sent, i do not need to send any data just receive it, the inly problem is i need to be on the wifi network that is ADHOC??

Thanks

Stu
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Did you ever get your P2P network running? If so, how?
Thanks,
Rusty
 
Upvote 0

Stulish

Active Member
Licensed User
Longtime User
Rusty,

I never got P2P (ADHOC) network to run with android, you can look into Rooting your android device and then adding 3rd party drivers to allow android to work with ADHOC networks. I am unsure why Google have limited connections to these types of networks because when you search for a WiFi network Android finds them but will filter out the ADHOC networks from the selection list

Luckily for the app i have created the company have just produced a serial to WiFi adaptor that sets up and Access point (the old unit set up an adhoc network). So once i get my grubby hands on the unit i can finish the app.



Sorry i wasn't much more help

Stu
 
Upvote 0

balistreri1

Member
Licensed User
Longtime User
update on the update..

I currently use a Bluetooth Serial device and my Basic4Android APP
can control a small robotic device.

I hope to use a WIFI connection for this same purpose.

A remote micro-controlled robotic device with a WIFI to serial
device that I can send and receive serial ASCII data back and forth.

????????????
 
Upvote 0

balistreri1

Member
Licensed User
Longtime User
Android Set to HOST Tethering..

Ok, does anyone know if it would be possible to set an Android cell phone into the WIFI tethering mode, essentially making it a WIFI bridge HOST and then
connect a remote WIFI to serial bridge to the Android APP and establish a bi-directional connection???

Any other angles???
 
Upvote 0

balistreri1

Member
Licensed User
Longtime User
Android APP tethering to remote WIFI to Serial device

I sure hope I'm on to something here...

The idea is to have a Basic4Android APP that uses the Android cell phones tethering to connect to a remote Serial to WIFI adaptor...
 
Upvote 0

Mikonios

Active Member
Licensed User
Longtime User
How to connect B4a-bridge between laptop and mobile phone network via Ad Hoc.
Tune & optimize speed on your internal network connection Android development.


Gradually my project has grown too.
Each time it costs me more time to compile and transfer the APK to smartphone.
Do not work with emulators.
Working directly with the device connected by wifi.
The wifi router through shared vg 8050 is two floors below, speed is not stable and varies 48Mbs until 5Mbs.
It is a router problem constantly negotiating between different 802.11n, 802.11g, 802.11b. So the connection between the laptop with AR9285 bgn network card and note 3 bgn/ac is a .....
horrifying terrible and odious !!!!

Solution.
Create an ad hoc network on the notebook.
Connect note 3 by B4A-Bridge. 65Mbps/72Mbps speed.
Very stable. Very fast. Without dropout. Independent router.
Laptop with internet connection to share your mobile.
Maximum distance 5-9 meters.

OldConfig To NewConfig


Settings in Windows 7 ultimate ............................................. .........
(Cmd) :: netsh wlan set hostednetwork mode=allow ssid=MyNet key=MyPass keyUsage=persistent

MyNet adapter properties / (TCP / IPv4) ::
IP Address: 192.168.137.1 (No modify this. Internal manage MiniPort Win 7)
Subnet Mask: 255.255.255.0
Everything else blank.

(Cmd) :: netsh wlan start hostednetwork

Finally we can only share the Internet access to the connection ::
on the adapter by which we get Internet
.- Sharing tab and activate Allow other network users connect via the Internet on this computer
.- Choose the name of the new connection that you created earlier
.- Allow other network users to control or disable the shared Internet connection
.- Configuration and activate there the last two boxes (HTTP and HTTPS).

Adapters Config::



Settings on the Note 3 ............................................. ..................
Now we have ready access point, enter Settings / Wireless / Wi-Fi Settings
Once there we give the button-down menu (which are next to the house) and enter "Advanced".
There activate Use static IP and put the following data:

IP Address: 192.168.137.110
Gateway: 192.168.137.1
Network Mask: 255.255.255.0
And nothing more. "NOTHING MORE"

OldConfig & NewConfig
(On Note3 press code *#0011# to get more data, and then Menu/WiFi )



This work !!!!

Result of the process:::


C:\>ipconfig

Configuración IP de Windows 7 Ultimate

Adaptador de LAN inalámbrica Conexión de red inalámbrica 2:
Sufijo DNS específico para la conexión. . :
Vínculo: dirección IPv6 local. . . : fe80::5e6:ff68:c20c:8794%22
Dirección IPv4. . . . . . . . . . . . . . : 192.168.137.1
Máscara de subred . . . . . . . . . . . . : 255.255.255.0
Puerta de enlace predeterminada . . . . . :
Adaptador de Ethernet Conexión de área local:
Estado de los medios. . . . . . . . . . . : medios desconectados
Sufijo DNS específico para la conexión. . :
Adaptador de LAN inalámbrica Conexión de red inalámbrica:
Sufijo DNS específico para la conexión. . :
Vínculo: dirección IPv6 local. . . : fe80::68fb:eb55:71ae:13ec%10
Dirección IPv4. . . . . . . . . . . . . . : 192.168.1.100
Máscara de subred . . . . . . . . . . . . : 255.255.255.0
Puerta de enlace predeterminada . . . . . : 192.168.1.1
Adaptador de túnel isatap.{54FB7255-1B5D-408B-AC05-7161BA80F048}:
Estado de los medios. . . . . . . . . . . : medios desconectados
Sufijo DNS específico para la conexión. . :
Adaptador de túnel isatap.{294C158A-E06A-4FE3-A4EE-6D0C4C643673}:
Estado de los medios. . . . . . . . . . . : medios desconectados
Sufijo DNS específico para la conexión. . :
Adaptador de túnel isatap.{17C66AC3-0F9F-4896-A8D7-59AE7348C4A2}:
Estado de los medios. . . . . . . . . . . : medios desconectados
Sufijo DNS específico para la conexión. . :

C:\>arp -a

Interfaz: 192.168.1.100 --- 0xa ...................................... (Laptop)
Dirección de Internet Dirección física Tipo
192.168.1.1 f8-8e-85-c7-51-a1 dinámico
192.168.1.101 5c-a3-9d-8f-c4-c2 dinámico
192.168.1.110 84-38-38-65-6c-fb dinámico ............(Smartphone-OldConfig)
192.168.1.111 c4-62-ea-86-56-4b dinámico
192.168.1.113 7c-61-93-36-7c-93 dinámico
192.168.1.114 1c-b0-94-4d-9d-28 dinámico
192.168.1.120 64-16-f0-46-80-0f dinámico
192.168.1.255 ff-ff-ff-ff-ff-ff estático
224.0.0.2 01-00-5e-00-00-02 estático
224.0.0.9 01-00-5e-00-00-09 estático
224.0.0.22 01-00-5e-00-00-16 estático
224.0.0.252 01-00-5e-00-00-fc estático
239.2.0.251 01-00-5e-02-00-fb estático
239.2.0.252 01-00-5e-02-00-fc estático
239.255.255.246 01-00-5e-7f-ff-f6 estático
239.255.255.250 01-00-5e-7f-ff-fa estático
255.255.255.255 ff-ff-ff-ff-ff-ff estático

Interfaz: 192.168.137.1 --- 0x16 ...................................... (Laptop)
Dirección de Internet Dirección física Tipo
192.168.137.110 84-38-38-65-6c-fb dinámico..............(Smartphone-NewConfig)
192.168.137.255 ff-ff-ff-ff-ff-ff estático
224.0.0.2 01-00-5e-00-00-02 estático
224.0.0.9 01-00-5e-00-00-09 estático
224.0.0.22 01-00-5e-00-00-16 estático
224.0.0.252 01-00-5e-00-00-fc estático
239.2.0.251 01-00-5e-02-00-fb estático
239.2.0.252 01-00-5e-02-00-fc estático
239.255.255.246 01-00-5e-7f-ff-f6 estático
239.255.255.250 01-00-5e-7f-ff-fa estático
255.255.255.255 ff-ff-ff-ff-ff-ff estático

FtpTransfer From Laptop to Note3 :::
With OldConfig 77Mb: 5/7 minutes.
Now NewConfig 77Mb: 19 sg
With a very bad internet connection theoretically 100 / 300Mb reflecting speed wireless router, not just the internet speed ISP


I can now work seamlessly with B4a-Bridge.
With very good guaranteed rate , uncut and very stable.



Last Detail "Ip.Fordwarding" ............................................. ..................
It is possible from the laptop 192.168.1.100 to ping 192.168.137.110 unresponsive:::

C:\>ping 192.168.137.110
Haciendo ping a 192.168.137.110 con 32 bytes de datos:
Tiempo de espera agotado para esta solicitud.
Estadísticas de ping para 192.168.137.110:
Paquetes: enviados = 4, recibidos = 0, perdidos = 4
(100% perdidos),

This is because the laptop is configured as router, but need to activate the networks routing between 192.168.1.0 and 192.168.137.0
In Windows 7 you must activate RRAS (Routing and RemoteAccess).
Start / Run services.msc / Locate "Routing and Remote Access" set to Automatic and start the service.

C:\>ping 192.168.137.110
Haciendo ping a 192.168.137.110 con 32 bytes de datos:
Respuesta desde 192.168.137.110: bytes=32 tiempo=78ms TTL=64
Estadísticas de ping para 192.168.137.110:
Paquetes: enviados = 4, recibidos = 4, perdidos = 0
(0% perdidos),
Tiempos aproximados de ida y vuelta en milisegundos:
Mínimo = 2ms, Máximo = 78ms, Media = 24ms

C:\>ipconfig /all
Configuración IP de Windows

Sufijo DNS principal . . . . . :
Tipo de nodo. . . . . . . . . . : híbrido
Enrutamiento IP habilitado. . . : sí
Proxy WINS habilitado . . . . . : no
....
....

See more details ::: http://computerstepbystep.com/routing_and_remote_access_service.html

And now you can make an shared network unit as ftp://user@192.168.137.110.port/ and very good transfer speed, both the internal network or the external network (Intranet / Extranet) for example!!!!!



Another detail not less important.
When an ad hoc wireless network on implants in 2.4 GHz band, the theoretical speed 802.11n is 300 Mbps downstream and 150 Mbps upstream. In practice are 75Mbps downstream and upstream 25Mps to be shared among all connected equipment.

Ad hoc networks are very sensitive to interference of any kind, even an external hard drive close. It is therefore recommended that the router is configured at 40MHz on a fixed channel to be 1 or 11. Otherwise in 20Mhz down the speed and automatic channel generate constant changes in channel function is the quality of the signal.
The AdHoc network may be blocked causing constant disconnections B4a-bridge.

This is my experience after 3 months Basic4android, without knowing why not transfer the apk , believing that the problem was B4aBridge, or that the problem was the configuration of the notebook, or thinking that the phone was not working properly.
ISP's Router is the problem, and ISP no guarantee wifi connection, only external connection.
With this quick fix at no cost or depending on anything or anyone I managed to save a lot of long every day and every time compile the project.

I hope that works if only one person .
I think I had to share it !!!
 
Last edited:
Upvote 0

Mikonios

Active Member
Licensed User
Longtime User
Merci beaucoup pour votre réponse !!!!
Pardonnez mon ignorance, mais après beaucoup de recherches , je ne l'ai pas trouvé un lien qui indique comment . Vous me dites ou donner une référence ou un lien qui a été expliqué ci-dessus gentiment .
----------------------------------------------------------------------------------------------------------------------------------
Vielen Dank für Ihre Antwort !!!!
Verzeihen Sie meine Unwissenheit , aber nach langem Suchen habe ich keine Verbindung gefunden, die wie anzeigt. Sie sagen mir freundlicherweise oder einen Verweis oder Link geben , die oben erläutert wurde.
----------------------------------------------------------------------------------------------------------------------------------
Большое спасибо за Ваш ответ !!!!
Простите мое невежество, но после долгих поисков я не нашел ни одного ссылку, указывающую , как . Вы скажите на милость или дать ссылку или ссылку, которая была объяснена выше.
----------------------------------------------------------------------------------------------------------------------------------
Bol'shoye spasibo za Vash otvet !!!!
Prostite moye nevezhestvo, no posle dolgikh poiskov ya ne nashel ni odnogo ssylku, ukazyvayushchuyu , kak . Vy skazhite na milost' ili dat' ssylku ili ssylku, kotoraya byla ob"yasnena vyshe.
----------------------------------------------------------------------------------------------------------------------------------
非常感謝您的回答!!!!
請原諒我的無知,但經過一番搜索我沒有發現,指示的任何鏈接。請你告訴我,或者給它上面已經解釋的參考或鏈接。
----------------------------------------------------------------------------------------------------------------------------------
Fēicháng gǎnxiè nín de huídá!!!!
Qǐng yuánliàng wǒ de wúzhī, dàn jīngguò yī fān sōusuǒ wǒ méiyǒu fāxiàn, zhǐshì de rènhé liànjiē. Qǐng nǐ gàosù wǒ, huòzhě gěi tā shàngmiàn yǐjīng jiěshì de cānkǎo huò liànjiē.
----------------------------------------------------------------------------------------------------------------------------------
La ringrazio molto per la risposta !!!!
Perdonate la mia ignoranza , ma dopo molte ricerche non ho trovato alcun collegamento che indica come . È gentilmente dirmi o dare un riferimento o un link che è stato spiegato in precedenza .
----------------------------------------------------------------------------------------------------------------------------------
Muchas gracias por tu respuesta !!!!
Disculpa mi desconocimiento, aunque después de mucho buscar no he encontrado ningún enlace que indique como hacerlo. Serias tan amable de indicarme o dar una referencia o enlace donde se haya explicado anteriormente.
----------------------------------------------------------------------------------------------------------------------------------
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…