How to integrate multiple IP cameras into Android programmatically? - android

I am new in android networking. Now I am doing an Android network related project. In this project I want to integrate 6 IP cameras into my project and all cameras stream simultaneously. This IP cameras are Wi-Fi enabled cameras. The problem is here, how we connect multiple wifi devices into an Android device ? Only we can connect single Wi-Fi at a time. But one way is Wi-Fi direct or Hotspot. But how the IP camera identify and connect mobile hotspot ?
This is the cgi command given by the client to get Wi-Fi scan result
get_wifi_scan_result.cgi
Description: Gets the camera results of search for wireless networks
Certification: administrator
Syntax: /get_wifi_scan_result.cgi
Returns:
ap_number : Refers to the search for how many SSID , The following variable groups, with the first group, for example:
ap_ssid[0]:ssid
ap_mode[0]:0->infra 1->adhoc
ap_security[0]:
0->WEP-NONE
1->WEP
2->WPA-PSK TKIP
3->WPA-PSK AES
4->WPA2-PSK TKIP
5->WPA2-PSK AES
ap_dbm0[0]:
ap_channel:

Android cannot currently connect to more than 1 Wi-Fi provider.
Try connecting all cameras to a single router, and then the Android device uses the same router.
Beware that this might not work on some Wi-Fi cameras that behave as mini web servers such that the router has to connect to them (via RTSP/RTMP).

Related

Is it possible to communicate without a router by connecting the device and the smartphone via Wi-Fi?

To connect a device (ex. air purifier) ​​made with a Wi-Fi chip to a phone and control it from the outside
I was told that there should be three devices: a device (Wi-Fi chip internal IP), a router (Wi-Fi), and a smartphone.
Is it possible to think of the device itself as a router without a router and control it from the outside by connecting to a smartphone and Wi-Fi?
Video while searching YouTube (video of making a toy car with a Wi-Fi chip (Arduino), finding out the IP address, and controlling it by entering the IP with the Android app)
Is it controlled from the outside through bidirectional communication (device sensor value->smartphone and smartphone->device power on/off)?
Samsung or Kakao air purifiers are said to require a router.
I was wondering if it is possible to connect directly and send/receive data using only an air purifier and two smartphones.

Connect to WiFi network without DHCP and private IP address in 169.254.0.0/16

I have a device that broadcasts a WiFi AP which doesn't have a DHCP server. Computers and iPhones can connect to it and end up with an IP in 169.254.x.y. Then, mDNS such as device-name.local are resolved and allow to use the web interface of the device to configure it (notably, send it the SSID/PSK of the target WiFi network to connect to).
For some reason, my Android devices (tested on Moto G6 Android 9 and Pixel 3 XL Android 11) fail to reach the IP state. They can associate with the AP but don't get a 169.254.x.y. IP. They usually keep mobile data active, or try to switch to another working AP.
When I disable mobile data and remove all known AP, they still won't get an IP after association.
When I manually set an IP in the same subnet (obtained by a computer that managed to connect to the IP and land in 169.254.x.y.), then it works! Name resolution doesn't work, but the Android device is able to reach the other device by using its IP address.
Now this is very bad, especially because I didn't find any stable API that didn't use reflection to set a static IP address when establishing a connection to a new AP.
Is there a way to connect to the AP and be able to reach the device using whatever.local without any interaction from the user?
My code basically does these steps, with a 15-time retry on each step if it fails (and start over from #1):
connect to SSID with
WiFiForIoTPlugin.connect(ssid,
password: 'XXXX', security: NetworkSecurity.WPA, joinOnce: true, withInternet: true))
get SSID with WiFiForIoTPlugin.getSSID(), check it matches the target
get RSSI and check it's not null or == -127
try to resolve myhostname.local (which works on Linux, MacOS, iOS but not on Android)
try to communicate with the device now that its host is resolved and we have IP connectivity

Connect Android to laptop without Internet connection

Say I have a laptop (Windows 10) and an Android phone. The laptop does not have an internet connection and the Android does not have an internet connection.
I have an Xamarin app that uses a C# Web API that is deployed to the laptop (for testing). How can I connect the mobile to the laptop without any form of internet connection? I believe I have two options:
1) USB cable
2) Bluetooth
I believe I have to install a wireless hotspot on the laptop and then a reverse tethering on the Android.
Have I understood this correctly? Do I have to do this regardless of whether I use a USB cable or a Bluetooth connection.
Tethering is the name given to a mobile that acts as a hotspot. It make use of a network interface (Wifi, Bluetooth, USB port acting as Ethernet...) to share internet connection through the selected interface.
As you'll note I'm not incluiding mobile data in the list. Mobile data is used to connect to Internet. So your mobile is capable of connecting to internet via mobile data and share it via any other interface, i.e. Wifi, Bluetooth and USB (Ethernet)
At least in my mobile im able to just enable Tethering configuring it from Settings -> Wifi connections -> Share internet. Here I can switch on/off the desired interface: USB, bluetooth or Wifi. I can enable just one, both or even all of those
As far as I know a Xamarin app is an android app that embeddes a website and, optionaly but highly common, uses a server as an endpoint (your laptop in this case), also known as API.
So as you ask you don't want to have internet connectivity, all the connections must be made in a local network. To do so you could just enable tethering and turn off mobile data on your mobile. Then on your laptop, connect to your new network over wifi, enable ethernet or connect via bluetooth, depending on your choose.
Of course, you'll have to handle firewall on your laptop to ensure connections are made successfuly. But you should be able at last to ping each other.

wifi direct queries

I have 2 queries related to android wifi direct.
I am able to connect my motorola phone with Redmi via Wifi Direct. However when i try to connect my Motorola phone with Xiomi device it fails. So is there some device compatibility issues when working with Wifi Direct? I couldn't find any answer online.
Once 2 devices are connected via Wifi Direct, i don't get to decide which device gets groupadmin role. But only client can send files to server. But how Shareit allows any device to send data in any direction?
Thanks!

Direct serial port connectivity from arduino to android for data communication

Using Arduino I can get the sensor values logged into the serial monitor over the USB cable...
Is there any way that I can read these values directly on an android tablet by connecting a usb convertor(So that I can tramnsmitt it via GPRS to a server Db)...Please give my some solid directions...
You can do it wired if you use a FT232 or CP2102 converter. Here are a couple apps on the Google Play store that act as a serial monitor.
USB Serial Terminal
Slick USB Serial Terminal
One thing to note is that wired USB communication with Android is not very common, so you may run into some problems depending on the phone you are using. If you want a more guaranteed solution, look into an Arduino Bluetooth module that supports SPP - Serial Port Profile. You can connect the Arduino's RX/TX pins to the Bluetooth module, and have it communicate with the Android device over a wireless Bluetooth serial connection.
Also, here is a similar question on SO, however the answer may have outdated information regarding using the wired solution.
How to make Android and Arduino communicate without a wireless module

Categories

Resources