WIFI Transmo: WI-FI Peer to Peer Text, File transfer with Live audio transmitting

There is a block (Sent data) with block of length of bytes that had been sent.

1 Like

Thank you :+1:

1 Like

Hi, great extension but I was thinking. Is it possible to use it to send control info from one phone over wifi to another that send to an arduino over serial or Bluetooth.

1 Like

Hi Guys, I am new to MIT AppInventor and running the examples on the thread but I get the following errors !


image

Location services are enabled for the companion app. How did you guys get it going ?

Any Help would be appreciated

Hi, it seems that you are testing in companion, try with APK instead.

Hi B.G, I managed to get it to connect between two android phones. Seems stable enough. Although the explanation on how the Rx of Text needs a better explanation. Took me a while to work out a combination that works. Can you expose a method to provide Host Name and Address ? I am happy to test for you if needed, I can publish my example project once finished for others to better understand how it is meant to be used. But the Receiving of data needs better description.

Let me know if you want my help to mature this extension ?

WifiP2PExampleV1.aia (41.7 KB)

Here is my example.

For this example follow these steps:

  1. Build as apk, do not use companion.
  2. Give app location permission in android phone
  3. Connection is only required from one phone, the second will prompt for acceptance of connection.
  4. S Button- initiates the search. Then select other phone from the list.
  5. D button - disconnects connection
  6. Tx Button - sends a string to the other peer.
  7. 2nd Button right of "Tx button" changes ID from 1 to 2, so that the string sent is unique. Set phone 1 to 1, phone 2 to 2.
  8. Rx button is redundant - was using it for testing. Timer does the receipt of text.

Enjoy !

Hi, while receiving data, the extension provides a block that shows the available bytes pending to be received. It can be a file, regular bytes (text). You connect it to the ReceiveBytes block then you can receive text or file.

When sharing files, buffer (or maximum bytes it can send at one time) will be around 700 KB for a modern device. You will receive parts of files split into different files. Later you can merge the bytes to create a original thing using the merge feature.

Hi
For me, WiFiTransfer1 is NOT running properly; (.DeviceAvailable is not returning a result unless both smartphones are sending the same request)
WiFiCalling1 does the job.
thanks

1 Like

very good extension. will use it :blush:

1 Like

By the way...
How are you debugging applications that communicate via wifi ?
++

1 Like

Hi.
Can everybody help me to know why I can not find other device when start discovery?
Other device's Wi-Fi enable is enough or Hotspot On is needed ?

thanks.

1 Like

will they merge two videos

Yes it will be merged.

Greetings,

Does that extension allow to connect more than one device at the same time

Dear all,
I'm using two pads connected each other via WiFi dirdect by using @Kumaraswamy extension (great job indeed!), WiFiCalling.
It works, more or less: in other words, once connected the two pads (both Lenovo M8, but Android 9 on the first, Android 11 on the second) everything works fine for hours, the two pads are exchanging data with no troubles. The only problem is the connection procedure. It seems that I cannot find a repetitive sequence to get the connection "at the first time". It seems somewhat random.
Let's assume that Android 9 is Tablet #1, the primary, while Android 11 is Tablet #2, the secondary. Whichever I start first to search the available devices, sometimes none of two is capable to find the other, more often is Pad #1, the primary, that is not capable to find the secondary, while on the contrary it seems that the Secondary is more capable to find the Primary (which remains un-capable to find the Secondary). I've checked for the same configuration of both pads (i.e. settings of the WiFi channels at system settings).
On both pads I've set localization, BT and Nearby to ON (at least for sure it must be done on Android 11).
An additional help, I need, is : since I shall connect always the same pads together, I don't need to create a visual-list of available devices, among which select a device, but I would rather need to set always the same devices names.
That is: once started the app, the Primary shall connect always (and only) the Secondary, while the Secondary shall connect the Primary, without the need for the user to select within a list.
Since the extension requires a list.index to connect the related Name, I've tried to create a list from a srting, containing only the name of the pad to connect, and I've tried to force the index to "1" but it doesn't work, since it rises runtime error of index ="0".

Sorry having been so verbose !
Any hint is much appreciated.
Cheers, Ugo.

image

Hello, before you could call the Connect block, you have to first make sure you call the block which searches for the devices first, only when you get them, you are eligible to call the Connect block.

Hello @Kumaraswamy,
thanks a lot for your answer. I was out and I read it only now.
I will investigate a bit more if I can make the connection "automatic" as much as possible, since the to pads are installed on a race (rally) car and if their interconnection is lost (hopefully never, but in the case...), it shall be recovered easily by the co-driver with just a hit on a button or, even better, completely automatic.
I will let you know if I succeed.
Best, Ugo.

1 Like

Dear @Kumaraswamy,
thanks a lot for your help. I've been out for a few days, so I'm returning to you only today.
The attached aia is my version of a code that is capable to get a peer communication automatically when started, on two Lenovo pad's (as I told, the first is an Android 9 and the second is an Android 11) based on your extension :clap:.
The annexed pdf is the explanation on how it works: it's a bit tricky, for this reason I've preferred to explain it in a separated file instead of making this post too large.
You'll see that I use many clocks, because it seems that the operations on the WiFi need some delay between them (i.e. once called one method, it shall be waited a while before doing the next one, like if it was necessary to allow some time for the completion). Anyway, it works !
Now the only problem that remains is the need to "manually" restart the WiFi at Android level at least on one of the two pad's before trying a re-connection. But, also by reading @Taifun's posts, it seems that there is no chance to programmatically switch-off and -on the WiFi due to security reasons.
I've found some javscript pieces of code, that seem to be capable to do that, but I'm not familiar with that language, so I need to study a bit more.
As usual, any hint is much appreciated.
Best, Ugo.

AutoWiFi_11122022.aia (61.1 KB)

Flow_AutoWiFi.pdf (255.4 KB)

EDITED on 21/12/2022
Dear all thanks for your time and hints, but at the very end I've changed my mind. Instead of using the direct wifi between two pads, I use the BT. One is configured as server and the other as client, and that's all. It works fine and if (just in case of) they disconnect, I can reconnect them programmatically, without the need to exit to pad configuration and to switch off-and-on the WiFi to make it working again.
So, the flow is:
ESP32 (server) -> [(BT client) PAD#1 (BT server)]-> (BT client) PAD#2
Maybe not particularly brilliant but it works :slight_smile:
Again, many thanks to @Taifun for his extension teaching me how to set the client-server pads' configuration !

Merry Christmas to the whole Community and (hopefully) a Peaceful New Year !
Ciao, Ugo.

Hello!
I would like to know if this extension allows us to connect via WifiDirect with a laptop and what steps should be followed. I would also like to know if someone could help me activate the Wifi Direct option in Windows 11.

Thank u!