Good day,
I am very new to Arduino.
I have in my hands a working Arduino nano_328 and a w5100 ethernet board.
I am able to load programs on the Nano and it is working well.
I will apppreciate very much if someone could help me in wiring ( to interconnect ) the two boards together and instruct me on a program to load on the Nano_328 to start with.
Thanks in advance for any assistance.
iw2fvo
Try a few examples for the Ethernet.
For example the WebServer example, try to connect to it with a browser.
To exchange data between them, you can use UDP.
Within a home network, that is no problem. When you want to communicate via the internet, you might have to open a port in the router, to make the Arduino board visible on the internet.
Thanks Peter_n,
I loaded the web_server and I am able to get analog data on my PC and mobile phone connected to the home wifi network.
It is not clear to me how to access to my home network from the outside through internet .
Could you please give me some directions?
Thanks for helping.
Regards,
Ambro
Iw2fvo
iw2fvo:
It is not clear to me how to access to my home network from the outside through internet .
Could you please give me some directions?
You must port forward your public IP and port to your Arduino's private IP and port. How you do that depends on the router you are using. Normally there is a section in your router's manual that explains how to do that.
Suppose your home network is at http://192.168.0.xxx
And your Arduino is at 192.168.0.120
The webserver is at port 80, you browser uses port 80 as default to get a website.
On the internet you have a IP number. Let's say: 1.2.3.4
When a browser tries to read a webpage from port 80 from 1.2.3.4, nothing happens, since the router blocks everything.
You can change the settings of the router and 'open' a port. You can open port 80 can redirect that to 192.168.0.120.
After that, when a browser opens http://1.2.3.4 on the internet, the webpage of the Arduino is shown.
How to open a port is different for every router, you probably find a tutorial on the internet.
It is a security risk to open a port. If you accidently open a port and redirect it to a computer, the computer can be attacked from the internet.
(While I was writing this, SurferTim wrote the same)
Thanks to all for the assistance.
I have to study something more on my modem/router.
Security: How can I protect my PC's if I do open a port ? Any particular advice ?
Thanks
Ambro
I give my Arduino a fixed IP address, so I can redirect the open port to that fixed local IP and it doesn't get accidently go to something else.
You can set the fixed IP number in the sketch with Ethernet.begin(mac,ip), and you probably can assign a fixed IP number in the modem/router. The modem/router identifies the Arduino by its 'mac' address, and can assign that fixed IP to it.
You should have a different 'mac' address for every Arduino, so you might change the default 'mac' which is DEADBEEFFEED. I use an online mac generator for a new and unique mac address.
Security is about knowing what you are doing. Don't enable a lot of things in your modem/router.
Peter_n,
I loaded the web_server from Arduino and I have not changed the original settings:
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
(192,168,1,177);
EthernetServer server(80);
My ethernet shield is connected to my domestic network via a LAN ( ethernet ) cable.
It is working well since it allows me to access the analog data from all my PC's and smart_phones in the domestic net.
Are the above MAC, IP and Server port " static " ? Does it means that the router does not filter_out for the MAC ? Is the router setting Ok for now ?
Thanks
Ambro
More...
The IP is set within the Arduino or is set by the router ?
I can access to the data using the same IP all the time long...
Ambro
This sets a fixed ip address in the sketch : Ethernet.begin(mac, ip);
This let the router give an ip address to the Arduino : Ethernet.begin(mac);
When you use the fixed ip address in the sketch, that is the ip address that the Arduino gets.
The same happens when the router is set to assign a static ip address to the Arduino.
When both the Arduino and the router set the same ip address, everything is still okay. No problem.
When you use another Arduino board with the same mac address, that is when you get into trouble. The router sees the same mac address (DE AD BE EF FE ED), and thinks it is the same device.
Thanks Peter,
it is clear to me now .
Ambro
If I will have the second device: is it OK to change the MAC and the IP in the Arduino web_server to avoid conflicts ?
Thanks
Ambro
Yes, that is how it should be done
I prefer every computer in my home network to have a fixed IP number. That makes it easier to setup a communication between them. And I don't want to set the fixed IP number in every operating system. That is why I use my router to set fixed IP addresses. So I also use my router to give my Arduino a fixed IP number. The result is that I have a IP list of everything in my home network, and can easily transfer data between everything. But that is just me, normally the fixed IP is set in the Arduino sketch.
HI to all in this forum,
I am going to use the BMP180 pressure sensor with the Nano_328.
I red a lot on the Ardufruit and I found they have a new library and a very accurate program.
I did follow all the instruction but I am not able to overcome the Verify step : probably some libraries are not found.
Is there someone that could help me in setting up the correct library in the relevant folder and indicate what is the correct sketct to be loaded?
these are the errors list:
Arduino: 1.0.6 (Windows 7), Board: "Arduino Nano w/ ATmega328"
sketch_nov04a:5: error: 'Adafruit_BMP085' does not name a type
sketch_nov04a.ino: In function 'void setup()':
sketch_nov04a:13: error: 'bmp' was not declared in this scope
sketch_nov04a.ino: In function 'void loop()':
sketch_nov04a:25: error: 'bmp' was not declared in this scope
Thanks for helping
Ambro
more...
I would like to use the following project:
Following all the direction i get the following message:
Arduino: 1.0.6 (Windows 7), Board: "Arduino Nano w/ ATmega328"
sketch_nov04a:5: error: no matching function for call to 'Adafruit_BMP085::Adafruit_BMP085(int)'
C:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit-BMP085-Library-master/Adafruit_BMP085.h:57: note: candidates are: Adafruit_BMP085::Adafruit_BMP085()
C:\Users\Ambrogio\Documents\Arduino\libraries\Adafruit-BMP085-Library-master/Adafruit_BMP085.h:55: note: Adafruit_BMP085::Adafruit_BMP085(const Adafruit_BMP085&)
sketch_nov04a.ino: In function 'void loop()':
sketch_nov04a:25: error: 'class Adafruit_BMP085' has no member named 'getEvent'
Thanks for helping me
ambro