Hi i am wondering if someone can guide me in the right direction as i am new to this
I have a device which i want to extract data from via ethernet to an arduino uno and use this data to control the position of a stepper motor...
The device is an image checker PV310 which is connected to my hub and assigned a static ip adress. Using Putty, i can telnet into the image checker and view the data when the camera is triggered.
so i set up the arduino uno with the ethernet shield as a telnet server using the sketch provided in the Ethernet library but i was unable to retrieve the data from the image checker.
Would anyone have any information on how to set up the arduino uno to replicate putty so i can access the data via the arduino instead of putty
You mean a telnet client ? The Arduino is the telnet client and the PV310 is the telnet server I suppose.
This one ? https://www.arduino.cc/en/Tutorial/TelnetClient
Does it at least connect ?
PuTTY can do many things: secure connections, adapt itself to many protocols and so on. The Arduino can not do that.
I think the PV310 has a simple telnet server running. Perhaps you could try to create a bridge between the serial and the telnet, that passes everything through.
Does the PV310 have options for the telnet ?
I think the Ethernet Shield is low speed 10Base-TX, and the PV310 is 100Base-TX. Does it allow a low speed connection ?
Thanks for the reply Koepel, You can tell I am a noob at this
I meant server when i wrote the above but I also set the Aduino as a Telnet client using the sketch below to see if that worked, but when i did this the arduino failed to connect everytime so i thought the PV310 was the client.It would make more sense if the PV310 was running a small telnet server.
The only mention of telnet on the data sheet is copied below:
"Establish communication between PV310 and a computer using the software that supports for Telnet installed on the computer." From here it just describes how to use hyperterminal but iv used putty with no problems to display the information needed
Again this may show my inexperience but it does not mention explicitly that it allows low speed connection but It mentions communicating between a computer and PV310, you need to use a hub or router for 100BASE-TX or 10BASE -T so my thoughts was that it did allow for low speed connection.
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };// must be unique for each device
IPAddress ip(192,168, 0, 15);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // address for arduino
IPAddress server(192, 168, 0, 14);Â Â Â Â Â Â Â Â Â Â Â Â // IP address of camera
char camera;Â // Variable to store information
EthernetClient client; //Creates a client which can connect to an IP address and port
void setup()
{
 Ethernet.begin(mac, ip); // start the Ethernet connection
 Serial.begin(9600);
 while (!Serial) {
            ; }    // wait for serial port to connect.
 delay(1000);
 if (client.connect(server, 8601)) {
    Serial.println("connected"); }    // Confirm connection
                    Â
 else { Serial.println("connection failed");
   }
for(int i= 0; i < 10; i++) pinMode(i, OUTPUT); // Declare outputs
}
void loop()
{
 if (client.available()) { // Read and print bytes from camera
  camera = client.read();
  Serial.print(camera); }
 // as long as there are bytes in the serial queue,
 // read them and send them out the socket if it's open:
 while (Serial.available() > 0) {
  char inChar = Serial.read();
  if (client.connected()) {
   client.print(inChar);
  }
 }
 if (!client.connected()) {   // if the server's disconnected, stop the client:
  Serial.println();
  Serial.println("disconnected from server.");
  client.stop();         // do nothing:
  while (true);
 }
}
PuTTY is a telnet client.
The PV310 is the server and the client is just a "dumb" terminal.
It worries me a little that PuTTY can do almost everything, and the Arduino can not.
Could you be more specific ? What do you use to connect PuTTY to it ?
What is the output of the sketch ? You could copy it, or make a screendump.
When you read something on the internet, please add a link to it.
Which Ethernet Shield do you have, and with which chip ? The old W5100, or W5200 or W5500 ?
Which Arduino board are you using ?
Do you use Arduino IDE 1.6.6 ?
I think the PV310 is almost the same as the PV200 series. Perhaps you can find better documentation for the PV200 (I still can not find it though).
If it is confusing, you could give them better names. For example "myIP" instead of "ip" and "camIP" instead of "server".
And this is where it happens: if (client.connect(server, 8601)) {The "client" object in the Arduino is used to connect to the "server" at port "8601", the server is the camera.
Do you get the message "connection failed" ? And PuTTY can connect without any problem ? And you use PuTTY to connect to 192.168.0.14:8601 as well ?
That is weird, a simple connection should work.
Perhaps the router is blocking the Arduino. For example if the own IP is wrong, or you tried to many bad things and the router decides to block it, or the router doesn't like the 'mac' no more. These things do happen sometimes.
Are you sure that the Ethernet Shield is working and is connected ?
Perhaps you can do a test with this : https://www.arduino.cc/en/Tutorial/WebClient
Try both with and without the DHCP.
I am not sure what you mean by what do i use to connect putty to it. What i did was downloaded putty and connected to 192.168.0.14:8601. From here i triggered to camera to give me a judgement and this judgement (1 if ok, 0 otherwise) would display on the putty terminal.
I have got the W5100 chip and i also have an Arduino UNO R3. (if it helps i also have a mega and intel Galileo floating about but have only tried this on the uno) Also I am using IDE v1.7.8 that i downloaded from Arduino.org.
I have the datasheet for the PV310 but found it harder to find the data sheet for the PV200. I will email Panasonic and ask them to send me a copy to see if it is better documented.
When I tried to connect with the Arduino, it takes about 2 minutes and than i get a message to say "connection failed" But when I use putty to the same address it will connect without any issues.
Iv exams starting tomorrow so will probably be a week+ before i can access the camera again and i will take some pictures of what outputs i am getting from putty and the arduino and i will also check the example you provided and report back the results.
Thanks again for your time, i really appreciate it and and the good news is that it looks like i have a ton of research to do to keep me busy over the holidays
PuTTY in normal telnet mode (not SSH), that is okay.
The older W5100 chip is okay, that means the Ethernet libraries will work with it.
The Arduino Uno board is okay.
The 2 minutes delay is not okay.
Something is waiting or retrying.
It could be the router or the PV310.
Try the webserver sketch again to test if the Ethernet Shield is still okay. If that works, then I have only one conclusion: Somehow the Arduino with W5100 is not compatible with the PV310