how to use a mac to connect to a ethernet server

Hi Guys, I have used the ethernet shield and connected via the router to the internet and obtained an IP address. The Arduino with the shield is connected in 1 room and I want to connect to it as in the example "DHCPChatServer"

I have tried using the terminal on the MAC but I am not able to connect to the server

I am really sorry if this a dummy question, but this is a project started during lockdown and I would like to finish it and be able to control the Arduino via the internet if possible (I know it is, if I am able to)

is your Mac / PC on the same network ?

the documentation states

Software Required

A telnet server
Alternatively, Processing has a ChatServer example that works well for this purpose

what did you setup ?

as client you could use probably ssh in terminal

Hi Thanks for the reply

yes the MAC is connected via WiFi and the Arduino via Ethernet cable to the router. I am new to this so it might be I don’t understand your question correctly so bare with me

also I did try ssh in the terminal window,

ssh 192.168.0.65 for example and I get this message “connect to host 192.168.0.65 port:22 Operation Timed Out”

also i i open the terminal and right click and use "new remote connection" there us a option "Remote Login (Telnet)" but when i use this and give the IP address of the server i get this error

[Command not found: telnet]

[Could not create a new process and open a pseudo-tty.]

this example is super old and telnet is no longer part of many distribution as totally insecure

either you re-install telnet on your machine I'm sure there are tutorials for this on line or you go and use ssh and update the code to become secure.

the basic shell command for connection should be

ssh 192.168.0.65 [color=red]-p 23[/color] (as the port on the arduino is 23, which is telnet default port)

and you should see a connection attempt on the arduino (something dumped into the console, like a list of key exchange protocols supported etc)

What happens next though is that ssh is expecting a key exchange for security. As the arduino program does not honor this, you are likely going to get in the terminal an error, something "kex protocol error"

Ok so I tried what you mentioned and YES I got the error you mentioned as well, so if I am to use the Ethernet shield and be able to connect to it using a MAC what options do I have?

as you said installing "Telnet" wouldn't be the best option

Sorry for the questions but I have googled a solution and there is nothing that has worked, they say use ssh but nowhere have I found a solution to the example in the IDE or how to modify it

any help or if someone could point me in the right direction it would be awesome and thanks in advance

as you said installing "Telnet" wouldn't be the best option

telnet is insecure, data flows unencrypted and there is no authentication and could have man in the middle type of attacks etc

that being said, if you only play in your local Network at home that might still be a low hanging option.

The code you found for this example does not handle authentication nor does your Arduino Uno have the power to crypt the data

what are you trying to achieve ? may be a RPi would be better suited or use HTTP protocol

Hi JML,

can you direct me to where I can find code that would use SSH and be able to authenticate the connection PLEASE

My intention is to use the connect from when I am away from home as well

if you need security then don’t go for a “small arduino” directly exposed to the internet. SSH is way too heavyweight for Uno/Mini/Nano/Mega etc so that won’t run. You would need a MKR or ESP32 kind to have the horsepower.

For example on an ESP32 you could use this code (first hit with ESP32 SSH, I never tried) but note what they say though

Use at your own risk. This is just a proof of concept. Please generate a new key instead of using the same key and use another login credentials! This is NOT for production uses

or use HTTPS

You could also have your arduino not exposed to internet and have a more powerful server as a bridge (and RPi or any other reasonable computer that could stay always on in your network) and modify your internet access so that you can ssh into that computer - then attach the arduino through Serial to this computer.

an alternative would be to push your data from your Arduino to somewhere in the cloud where you always have access. this way the Arduino never need an incoming connection.

Understanding your use case would help

Hi JML

thanks again for the reply mate, appreciate you taking the time to help.

I started a project to create an automated garden watering system during the lockdown and not am very much serious about Arduino and what can be done and want to learn more. I was able to follow a lot of tutorials by people on YouTube and it all works,

so I was looking at now connecting to the web to be able to control stuff as the next step in my learning.

I do have an old computer sitting around that I can put an ethernet card and connect to my home network.

will give this s try and see how goes

again thanks for all the help