B4R Question Arduino over the internet

ALEX BISSARO PITTA

Member
Licensed User
How can I connect Arduino with my cell phone over the internet by using 4G or another wi-fi connection? I'm using udp connection by the way.

Should I make any changes on B4R and B4A program?
I have a modem1 with external IP and a wi-fi router2 connected to arduino by means of ethernet cable.
Should I make any port forward configuration on the router, VPN connection? What is the right way? How to do it?
 

Peter Simpson

Expert
Licensed User
Longtime User
Upvote 0

ALEX BISSARO PITTA

Member
Licensed User
Thanks Peter.
The only problem to me now is that the application is ready and already running on local network. I only needed to make it work by outside the LAN.
 
Upvote 0

ALEX BISSARO PITTA

Member
Licensed User
What' I undestood from this tutorial is that I need to turn my PC into a server by means of B4J application. Right?

Nowadays I'm sending the Udp packets from B4A to B4R directly and vice versa, only locally.
In this way probably I need to reconfigure all the UDP_SendPackets and UDP_ArrivedPackets to have the server beetween B4A and B4R. Right?

Is there no other way without creating the B4J server?

Please feel free to correct me.
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
I wonder if the mobile network operator wouldn't filter any UDP packet
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Give your Arduino a fixed IP and then on the router, delegate a through port which goes to this IP. Connecting to your external IP with this port should take you directly to your Arduino.
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
Based on your configuration, things may vary

1. Arduino connected to local area network.
In here to reach the Arduino, you will have to do this

  • Configure your cell phone or whatever device is sending data to the Arduino, to push packets to your internet external IP address and to a specific port ( as an example use port 5000 )
  • Configure the Arduino with a static IP address on your local area network ( as en example: 192.168.0.10)
  • Configure your router to forward port (5000) to the Arduino fixed IP Address ( 192.168.0.10 )
  • make sure the port is not blocked by the router firewall.
Your system will work no different than on a local network

2. Arduino is connected to the internet directly using the cell modem and if the SIM is M2M, you will need a middleware or at least a known configuration. Also in this case, you need to know that many operators limit the incoming traffic (meaning how long the listening port stays active after the last message sent by the device).
 
Upvote 0

ALEX BISSARO PITTA

Member
Licensed User
I'll try to make the port forwarding from the cell phone to arduino.

How the arduino will know wich external address to send information back to the cell phone? Should I configure something in the arduino?
 
Upvote 0

ALEX BISSARO PITTA

Member
Licensed User
99% of the time I'm using the app inside my local home automation connection, almost never by outside.
It's not the most fancy way, but as the app is only for my own House Automation, I decided to keep a local unused cell phone at home installed with Host Teamviewer. Whenever it's necessary I connect any external device (cell phone or computer) to my local host cell phone doing whatever I want.
 
Upvote 0
Top