First, I need to apologise for copy&paste this thread. I accidentaly write one first time in wrong forum division. [ Installation & Troubleshooting - I'm sorry for trouble. Topic shares the same title there. If it's possible delete this thread. I don't know how to do this ]
==========================================================
Hello!
I have a big problem with my hardware. I don't know if it works properly or if I configured something not properly. I guess I'm not doing something right. Anyway, let's get to the point.
I want to connect my Arduino with the local website by using Ethernet Shield and make it work.
My hardware:
>Arduino Leonardo,
>Ethernet Shield W5100.
I connected my Arduino Leonardo with Ethernet Shield module and it works fine. I even programmed a LCD a bit and it worked.
I'm providing you with that information, because it was very hard for me to find any information if I could assembly Leonardo + Ethernet Shield together without any problem.
Going further I wanted to actually use Ethernet Shield to make a simple connection with Arduino to localhost // local website and see results on my laptop (and maybe control Arduino outputs later on).
The problem is... I can't use;
more than 1x RJ45 wire,
router.
Then, my plan is using WiFi, Laptop and Ethernet+Arduino connected via RJ45:
WiFi (provided by Smartphone as Hotspot) ---> Laptop ---RJ45---> Ethernet Shield.
(My laptop has only 1x RJ45 socket by the way)
It doesn't work. I used the method showed by this Sir:
Link, but it doesn't work properly.
I used example sketches like:
DhcpAddressPrinter [Doesn't print an IP in overall.]
WebServer [Was printing 0.0.0.0 (and it didn't work) earlier, before I have used a preferred IP (Link method). Program WebServer started to print localIP (!= 0.0.0.0) quite fast, but when I tried to enter that website I got message from my browser: "CONNECTION REFUSED"].
I have no idea what is wrong. How can I enter local website to control my Arduino via program or some HTML, PHP stuff later on, If I cannot make a simple connection?
I have no idea how to repair it. I guess the problem lies in WiFi hotspot provided by Smartphone and not by portable router or something else...
Do you have any idea, please?
===============================================================
Also each time I compile those programs I get following warnings ONCE, but program still compiles. Is it a serious problem? Is it a reason it doesn't work?
----------------------------------------------------------------------------------------------------------
In file included from C:\Users\X\Documents\Arduino\libraries\Ethernet\src\Dns.cpp:7:0:
C:\Users\X\Documents\Arduino\libraries\Ethernet\src\Dns.cpp: In member function 'uint16_t DNSClient::BuildRequest(const char*)':
C:\Users\X\Documents\Arduino\libraries\Ethernet\src\utility/util.h:4:24: warning: result of '(256 << 8)' requires 18 bits to represent, but 'int' only has 16 bits [-Wshift-overflow=]
*#define htons(x) ( ((x)<< 8 & 0xFF00) | *
C:\Users\X\Documents\Arduino\libraries\Ethernet\src\Dns.cpp:185:21: note: in expansion of macro 'htons'
- twoByteBuffer = htons(QUERY_FLAG | OPCODE_STANDARD_QUERY | RECURSION_DESIRED_FLAG);*
- ^~~~~*
----------------------------------------------------------------------------------------------------------
I noticed on the preview that 8) emote shows up, instead of this emote there should be '8')' in that code.
===============================================================
I really want this to work. I'm looking forward for any help