Can devices connected to the same Wi-Fi communicate with each other without using data for accessing the internet? - wifi

I need to enable multiple devices to communicate with each other using OSC protocol which runs over IP protocol etc.
I have two wireless routers, one of them is capable of providing internet access from SIM card.
What I want to accomplish is:
provide all devices wireless connection for communication between each other
provide all devices connection to the Internet
avoid spending data from SIM card when my devices communicate with each other
This last point is what I can't solve - in my mind it should not be a problem. If I understand it correctly, I am creating a WLAN and there is no need for passing the data to the internet provider (or asking for data from him) and the router should act like a switch and route the signal from one device to another one if the IP and port is correct.
I have router TP-Link Archer C6 ; router TP-Link Archer MR200 ; Windows laptop ; Android phone ; iPad.
What I want to accomplish is remote control of DAW Reaper (running on Windows laptop) over Web Control Surface or OSC Protocol with TouchOSC app or Open Stage Control app.
I will appreciate any help!
Thank you very much in advance,
Peter

Related

Internet connection problem from different network for NodeMCU ESP8266 which I am using for IOT home automation

Would anyone like to help me with this problem please?
how to connect/control Nodemcu esp8266 wi-fi module from different network for control iot devices from outside of any home/ house?
Internet connection problem from different network for NodeMCU ESP8266 which I am using for IOT home automation.
Actually, in case of an class project, I have used some code (also coppied some code and took help from some website) from internet and also used Blynk for controll my ESP8266.
But not i want to make a personal app by which app I can control my devices outside from my home.
I have already connected with my WI-FI router with my home network!!
It worked well,
But i don't know how to do the same thing from different netwrok.
If possible I think anyone can help me....
Thank you.
To everyone.
This has been answered in greater detail on both the Arduino and Internet of Things StackExchange sites. In summary:
For safety, it is difficult to start a connection to a device on another local network. Devices on WiFi networks are protected from the Internet by a firewall, which is normally configured to return responses to requests sent by the devices, but block all unsolicited messages. Even if the firewall allows an incoming connection on a given port, "port forwarding" or other custom configurations are needed for unexpected messages to reach one of the multiple devices on the network (the devices usually share the same public IP address of the network and external systems' messages cannot reach the right local address without forwarding by the router).
Any device exposed to unsolicited requests like this is at risk of being attacked and can pose a risk to other systems on the network. It is thus safer to leave the firewall the same and instead make the device subscribe to an external webserver, which acts as a mailbox for incoming messages. Then, you can send requests to the server from anything with an internet connection, and the server will store them and relay them to the ESP8266 whenever the ESP asks. MQTT protocol using a server-side broker program like Mosquitto and a client like PubSubClient on your ESP8266 could work for this sort of publish-subscribe model, and MQTT tutorials and explanations are available both on both tool sites and Stack sites.
You can use Arduino IDE to program ESP8266 device.
https://randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/
After installing ESP8266 in Arduino IDE. You need to connect ESP8266 with WiFi router(which have internet connected). Once your device is connected with a WiFi router. you can MQTT protocol to communicate with the server. You can use the following library in Arduino to implement MQTT client in ESP8266. ESP8266 is used to send and receive data from a different network. ESP8266 is subscribed to a particular topic. You can publish data to that topic from different MQTT client.
https://github.com/Imroy/pubsubclient
Use the Following link to get more familiar with MQTT protocol
https://www.hivemq.com/blog/mqtt-essentials-part-1-introducing-mqtt
You can use MQTTfx desktop application to send and receive data from NodeMcu(ESP8266).
MQTT basic diagram for understanding

How to link/pair HTML 5 with a hardware device?

I have two entities which I would like to be able to start a communication:
Hardware Device Using Atmel ATSAMS70 and WINC1500 Wifi Module
HTML 5 App
The idea to have a HTML 5 app is to be able to communicate easily with most of the commercial devices like: Windows computers, Android Phones, Mac OSX computer and iOS devices. Apart from that, I would avoid working with native code at all.
Currently, they can talk with each other using WebSockets but somehow the IP address of the custom board has to be known from HTML 5 to initiate the communication.
In order to do this, I can think of 3 options:
Using WebRTC I can get the local IP address of the browser and then I could do a scan of the local devices considering a 255.255.255.0 network mask.
Have an external server that the hardware device can send its local address which will be later retrieved by HTML 5.
Using Bonjour or some sort of device discovery service between the board and HTML5.
I could not find a way to achieve #3 but #2 seems feasible to me. #1 is what I am doing now, but WebRTC is currently not supported on iOS.
So, is there any other better possibility to achieve this communication?
You don't mention how the WINC1500 unit is being connected to the network but presumably this is in STA mode (acting as a wifi station rather than becoming a software access point or part of an ad-hoc network) and is being provided with its IP details through an existing access point?
Ordinarily I'd suggest that once connected, the device ought to start indicating its availability on the network via a regular UDP broadcast on a specific port but my (admittedly limited) understanding of WebSockets it is that it creates TCP connections. The only implementation of Bonjour that I've seen uses UDP messaging too, that may be why you've had trouble with your third approach.
Your second approach seems more likely to work well. A server at a known (or discoverable) IP on the local network which allows the Atmel device to register itself (and its IP address) and also allows other applications (your HTML 5 WebSockets applications) to request that connection information to allow them to create the WebSocket TCP connections they need.
I suppose that doesn't really answer your question as to "Is there a better way?", other than to say "Not that I can think of, your second approach looks good to me...". Sorry! Sounds like a very interesting project, overall,

Internet access between WiFi-IoT in Access Point mode with mobile phone connected

I did a lot of brain-storming about this, and couldn't reach a solution.
I am posting this as i can get some ideas.
I have developed a WiFi-IoT based device with sensor, which shows up in AP mode. A mobile phone connects to this AP and then the device starts sending sensor data to the mobile phone. A mobile application plots and displays this data.
Now, i want to send this data from mobile to internet. Connecting my mobile to another AP with internet is not an option, as i don't want to break the continuous data transmission.
Using internet of data provider is one option, but that brings constraint of have mobile data.
What other options do i have to send my data from mobile to internet ??
Edit:-
I worked on the suggestions, and came to this point:-
1) WiFi-IoT device (in station mode) and mobile phone connect to same Internet-enabled WiFi access point. WiFi-IoT device has the IP address of the mobile phone for current network, and sends data to a TCP port (eg. 9801) of this IP address. The application in mobile phone reads the data from the port no. 9801 and stores it and hosts it on the internet.
This works fine.
2)WiFi-IoT device comes up in Access Point mode, and the mobile phone connects to this Access Point. Now there is one-to-one connection between WiFi-IoT device and mobile phone.
My question is, in the second scenario, without breaking this one-to-one connection, is there way to host data to internet:-
1) without using mobile internet provided by mobile data service provider ?
2) without using a second mobile phone ?
I may be wrong, but i am just asking this to make be sure whether my requirement can be achieved or not !!
I don't think you can connect to two APs at the same time.
Maybe use Bluetooth as device to phone link?
Or have the device connect directly to internet after some config done in AP mode and then send a copy of the data to your phone app (either via WAN or locally to the private IP your phone gets from the Internet gateway AP)?
--Edit--
Let me explain about the second one:
What I mean is basically have your IoT device directly connect to Internet and send data to a server (your phone has also to be connected to Internet). Then make the server send a data copy back to your phone. It's two step process: 1) while the IoT device is in AP mode, use your phone to login and configure which Internet-connected AP it should be connected to. This serves as UI for your IoT device. 2) start sending data.
Or a bit ugly, just let the IoT device talk to your phone in the same WiFi network via private IP.
I brought up this way because you mentioned anyway your device has to send data to Internet(I assume it's a server) and have phone talk to a known location server is more portable and scalable once you have more than one IoT device.
--Further Edit--
I don't think there is a way to do what you described. At least from my experience:
1) on the link layer, the wireless NIC has to be able to connect to two APs at the same time. This is not a feature currently available.
2) on the network layer, there has to be two IP address attached to the same NIC, which I don't think is available in current OS for wireless NICs. Though there is a way to do this for Ethernet card, I.e. via Aliasing.

Real-time data from Raspberry Pi to iPhone

I recently have not much experiance about working with a raspberry.
I need to send real-time data from my Raspberry Pi 2 Model B to an iPhone. The Raspberry will get the internet connection via UMTS stick.
I thought about a websocket but I didn't find any information what websocket would be the best and how to config it.
So is there anyone who already has a solution about it?
Thank you!
WebSocket requires a WebSocket (WS) server or a webserver that understands the WebSocket protocol as defined by the IETF. So for a RPi to talk directly to your iPhone, one of the devices has to have a WS server... which is not likely.
There are a couple of possible alternatives (there are certainly others). You could send data from the RPi to an external server that hosts a WS-capable server which then forwards that data to your iPhone, either thru a native app or a web browser. The data is logically transmitted between the two devices, but physically sent using an external service to coordinate the two. Visit http://goo.gl/Utg0dU to see data exchanged between an RPi and an iPhone using web messaging (src available).
Another possible alternative is to use Bluetooth to send data directly from the RPi to the iPhone. Being a Java dude, I know you can run a JVM on the RPI and I know there's a Java bluetooth API, and obviously the iPhone supports bluetooth, so its definitely do-able with a JVM. A quick Google shows plenty of support for bluetooth on the RPi with other languages. So you're good with this approach too.
If the Raspberry Pi is connected to the Internet with a public IP Address (I guess it doesn't since it uses UMTS) then you can setup a TCP Listener where the iPhone will connect to. If it doesn't and you can do Port Forwarding (I guess you can't) then you can forward the TCP port to the Raspberry Pi. The above examples also work with an HTTP server.
If the iPhone is near the Raspberry Pi and you're writing an app for the iPhone you can use a Bluetooth transceiver on the Pi to communicate.
If you can't do any of this you may need a third server with a public IP where both devices will connect to and the server will relay all connections from one device to the other.
In general, it would help if you could describe a little bit better what you want to achieve and the network topology involved so we can provide more specific answers.

Is GSM data sending between 2 phones impossible?

Please tell me in detail why it is impossible to send the data between two phones over GSM? I can find almost no information about this problem.
There are 2 points here.
Firstly, GSM is a mobile voice telephony system - plain GSM doesn't do data connections.
GPRS and EDGE are add-ons to the GSM network that allow data to be sent.
There are other kinds of wireless phone networks that also use a SIM and allow data to be sent (UMTS, LTE).
Secondly, when you establish a data connection with a mobile phone and a phone network, you are establishing an IP connection between your phone/modem and a gateway server in the operator's network. The gateway server allows you access to the internet (together with the DNS server etc, obviously).
This is similar to a computer plugging in a LAN cable and connecting to their ISP. But you can also connect 2 computers with a crossover cable, and configure them to have an IP connection directly. So what you are asking is, why can't I do the same with 2 GSM phones? what is the equivalent of a wireless crossover cable?
The reason is because GSM has no protocol to connect phones to each other. It only defines a protocol for phones to connect to a network base station.
To transfer data between 2 phones, therefore, you need a different protocol, one which will work between 2 peers. Bluetooth is a common such protocol, but it only works over short distances.
If you want to connect 2 distant phones, you can do this via a third party, like a website, to which data can be uploaded into the cloud by the first phone and downloaded by the second phone.
Or, you could establish a connection at the IP level via the internet, e.g. if one mobile device was a web server (the last sentence is only theorising).
See also this related question
EDIT: 3GPP Release 12 includes direct Device to Device communications. At the time of writing, it's still very new, and not yet commercially available, so the answer above still holds. D2D is designed for emergency services, eg if the network is damaged by a disaster, they can still communicate directly. But 3GPP suggests that it will be commercially available as well. From 3GPP news
There are also commercial benefits of D2D, with new applications building on the physical proximity of users being trialed by operators.
2nd EDIT: Apple has created a feature called Multipeer Connectivity Framework, which uses a mixture of WiFi networks, peer-to-peer WiFi and Bluetooth to enable short distance connectivity between iPhones when there is no GSM network.
NFC is another peer-to-peer technology for communicating between 2 devices, that is supported by some phones. More information here.

Resources