Page 1 of 4

Ethernet

Posted: Tue Jan 24, 2012 6:24 pm
by Seedlessone
So I've read all the topics regarding this and I know wifi is the suggested route but can we use ttl to Ethernet? I would rather use Ethernet as it's already wired to my tank. Can someone point me to a link containing a tll module that would get the job done. Ive seen them range from 40-200 and I'm not sure what will work and won't. Thanks a ton.

Re: Ethernet

Posted: Wed Jan 25, 2012 4:32 pm
by rimai
Never used any of them, but if you post a link of what you have in mind, I can comment on it.

Re: Ethernet

Posted: Thu Feb 23, 2012 5:52 am
by binder
fulltusy wrote:How do you know if you need to replace your ethernet card? My computer won't let me log on to the internet, it keeps saying that it has little to no connectivity. I had a tech come out and he told me that my ethernet card was no gone anymore. I noticed that the IP address wasn't right but my lap top works fine but my desk top that is hardwired into the modem isn't working. Anyone have any ideas
It's tough to tell if it's gone bad or not. First thought is to try another network cable that you know is working. If that fails, disable and reenable the network card. Make sure you don't have it configured something odd (like a static ip or something). Also try another port on your router, hub or switch to check if the port could be bad. If all that fails, you probably need a new network card. They can fail. I've had some fail because of surges over the network line. I've lost ports on routers and switches too. It happens.

Re: Ethernet

Posted: Thu Feb 23, 2012 11:16 am
by slipperysam
i Might have the wrong end of the stic how about this

http://arduino.cc/en/Main/ArduinoBoardEthernet

Re: Ethernet

Posted: Thu Feb 23, 2012 12:27 pm
by rimai
You could turn that into an ethernet module for RA if you really wanted to :)

Re: Ethernet

Posted: Thu Feb 23, 2012 3:43 pm
by Sebyte
One drawback of wifi is that you cannot upload code across it. At the moment my controller is 30ft from my PC, and I have to use an extended USB cable.

I will be moving soon and plan to build a fish room, which will be in the basement and be over 100ft from where my PC will be. I could buy a laptop, but Ethernet would be a better option providing you could upload code over it.

I assume that there would be issues with the portal as the web server is in the wifi unit. So I would have to setup a web server on my PC to interface with the portal and the iPad app.

I would be interested in researching TTL to Ethernet providing I could still access the portal. If not I won't waste time checking out the connections etc. I have taken a quick look at the Arduino library's and there seems to be quite a bit to checkout.

Roberto, your thoughts on viability would be welcome.

Re: Ethernet

Posted: Thu Feb 23, 2012 4:25 pm
by rimai
No, actually the server is in the RA itself.
The wifi is nothing more than a Serial TTL to TCP converter, which is basically you can create a code to load on that arduino board to do just the same.
With the right code in the arduino board, you won't know the difference between wifi or hard wire.
Loading code over TCP is going to be really tought.
The protocol used for uploading code is byte by byte and it requires acknowledgement from RA that is received.
So, what goes on is avrdude sends a byte to RA and waits for another byte to come back from RA.
This kinda of traffic on TCP is very inneficient and if the TCP packet lags or needs to be resent, you broke the upload process.
I have been successful on sending small codes, but when it starts increasing in size, the chance of breaking is that much higher and it usually gets interrrupted. So, I never mentioned the option of doing this over TCP.
But, I've been somewhat successful on doing this over bluetooth, which makes it idea to upload code over the air, because bluetooth emulates COM ports.
I just need to find the correct bluetooth receiver. The one I'm using right now is very flaky.

Re: Ethernet

Posted: Thu Feb 23, 2012 7:07 pm
by Sebyte
I can understand that check sum redundancy would be an issue. Also that Bluetooth might be an area to look into. I am a bit tied up at the moment with some freelance work, but will take a look at it when things ease off. :lol:

Re: Ethernet

Posted: Sun Dec 09, 2012 1:16 am
by 00Warpig00
So after setting my access point to reboot itself daily, thanks to DDWRT. My wifi mod has been able to recover\reconnect after endless hours of fiddling with it's firmware rev's and settings for the past two months. This week my wifi mod appears to be back to it's old tricks! The workarounds that have been working for the past two months appear to be failing at this point. It was a nice run that my setup was able to "self recover\reconnect" within a few hours max after loosing connection. I was starting to actually trust my controller. :) This week unfortunately my wifi mod has disconnected three times and not been able to self "recover\reconnect" even if left with flashing blue LED for more than 24 hours over two router reboots. Figures this would happen just before I leave town again on business :( Unplugging the wifi mod TTL cable from the controller and reconnecting it was needed for a reconnect each of the three times this week to get it reconnected. Although I made several code changes to my RA+ a few weeks ago I never realized a problem afterward and the wifi mod seemed to keep going and reconnecting. I seem to doubt any of my code changes of a few weeks ago is the cause, and I have not made ANY hardware changes in several months. A new wifi firmware has been released. I have NOT upgraded or tested this. It was limping along fine... I didnt want to break it! lol Does the wifi mod self update it's firmware or settings? I seem to doubt it but have not looked at my wifi mod settings to verify nothing has changed magically.

I have been searching the forum about hard wiring an Ethernet option. I have just had it with the whole wifi thing!

I found this thread and it pretty much seems from reading above that all the wifi mod does is send\receive serial TTL data to/from the controller over the 4 wire connection B+/Gnd/Rx/Tx. It seems that this keeps being described as "pretty easy" yet nobody offers an Ethernet module or has seemed to actually successfully replace their wifi mod with an Ethernet module, or if they do, they do not share the hardware and method.

I have been scouring the net and found a few TTL to Ethernet boards that "seem" they would be a direct drop in replacement for the wifi mod. If it is this "easy" why has nobody done it? There must be reasons it is not as easy as it is made to sound. Here are a few of the boards I found. What would be the challenges of using a device like one of these?

http://www.allproducts.com/ee/pongee/06 ... 01TR5.html
http://www.amazon.com/Usr-serial-Ethern ... B009FXBAFM
http://www.ebay.com/itm/ENC28J60-Ethern ... 1e6b11c90f

I obviously didnt design the RA so it may not be as "easy" for those of us that are "not in the Know" ;) of what makes this thing tick and would be required. I am considering buying one or two of these Ethernet boards and experimenting if it is thought by someone "in the know" that a particular TTL to Ethernet board would "probably" be at least "close" to a direct drop in replacement for the Wifi mod. Truth be told at this point I would probably pay DOUBLE what I did for my wifi mod for a pre made Ethernet mod if it was guaranteed to make my controller "reliable".

It would be awesome if at least somebody had a successful Ethernet connection based on one of these or a similar board that they could say to others "go buy this Ethernet board, connect it to your RA like this, do this, this, and that and load this code (if any) and you are good to go". then there would be no production run costs and the people that want to get away from the wifi mod could.

Any guidance would be most appreciated. Wish I had all the skills to design and create all this stuff myself. If I did I probably woulnt have a RA though ;)

Nick

Re: Ethernet

Posted: Sun Dec 09, 2012 6:49 am
by DrewPalmer04
I've got a ethernet ardiuno on the way. So I'll be playing with this. I got the one with the serial header and the UNO integrated so I might have success with the existing wifi cable (still need one)

Ethernet

Posted: Sun Dec 09, 2012 7:31 am
by dbmet
I did upgrade to the latest software on wifi mod on Thursday and so far it's been working for the past 2 days. Lol
http://forum.reefangel.com/viewtopic.php?t=1871

Re: Ethernet

Posted: Sun Dec 09, 2012 11:12 am
by rimai
I can't find the manual for those :(
But, I'm willing to work out something that may work as a DIY solution....
I was talking to Drew in the past about getting one of the Arduino Ethernet boards to be a drop in replacement.
I did create a firmware in the past where I used an Arduino Ethernet board with very limited testing and then I had to put a hold on the project when I started having difficulties on manufacturing a good prototype.
Drew never got back to me, so I just left it still pending.... I've been working on another project instead.
The one thing that you need to do with any of these modules is not the ability to do TTL-Ethernet conversion. It is the ability to work on server and client mode at the same time.
Server mode is the easiest to implement as it doesn't require anything special. The module waits for connection and converts TTL-Ethernet when a connection is made. This would be the case when you are connecting to RA. All modules should be able to do this mode.
Client mode is when the module makes a connection to an external server when serial data comes in and there is no established connection alive. This is the case when RA wants to communicate with the Portal. The module must be able to have this mode implemented in the firmware to be able to do this. If you don't care about the Portal, then I guess any module would work for you.
There are 2 possible solutions that I can think of:
1. Wiznet module
http://www.wiznet.co.kr/sub_modules/en/ ... 0&pid=1023
You will need to patch your own communication cable
2. Arduino Ethernet board with my beta firmware
http://arduino.cc/en/Main/ArduinoBoardEthernet
This would be a drop in replacement. You can use the wifi attachment cable to connect to the board, but again, I have only done limited testing.
Either way, I'd be interested in knowing what you get out of either choice.
Or maybe even another solution :)

Re: Ethernet

Posted: Sun Dec 09, 2012 1:39 pm
by DrewPalmer04
Roberto. I've got the board on the way. So we can pick up again. Just need that wifi cable and the board to come in. Than we can move right along.

Re: Ethernet

Posted: Sun Dec 09, 2012 6:44 pm
by 00Warpig00
If there is anything I can do to help with this... I'd be happy to pick up an Arduino Ethernet board or whatever hardware may be deemed useful and help out in any way I can. I am a Senior Systems Admin for a Global company so I am comfortable with networking client\server stuff and have been learning to work my way around arduino sketches recently. I can copy/paste code and can test things with the best of them. I am NOT a programmer though and struggle with creating original coding of language syntax I don't know. I would be happy to help out.

Nick

Re: Ethernet

Posted: Sun Dec 09, 2012 6:50 pm
by rimai
I think Drew is already going to test out the Arduino option. If you want to try the other one, we can have a review of both modules.
With the wiznet module, there is no programming required and all you need is to make sure you match the pins and patch your own cable.

Re: Ethernet

Posted: Sun Dec 09, 2012 7:01 pm
by DrewPalmer04
That sounds good really. Yes, I have the arduino Side covered. If you'd like to try the other that would be awesome. I agree with you that an Ethernet option would be awesome and that's why I'm trying this out ASAP

Re: Ethernet

Posted: Sun Dec 09, 2012 8:53 pm
by 00Warpig00
Sounds like a plan. Already found the Manual for it online and the wiznet module with a cable is less than $30. Mouser and Jameco both have it.

I will be placing an order.

Re: Ethernet

Posted: Mon Dec 10, 2012 6:12 am
by DrewPalmer04
Great! If the wiznet turns out to be cheaper and work...I'll just use my arduino for other projects and go with yours. My board should arrive in a week or two

Re: Ethernet

Posted: Tue Dec 18, 2012 9:00 pm
by 00Warpig00
Received my Wiznet 105SR last night. I didn't buy the EVB kit since the larger of the two boards brought the cost of the kit up to $70+ I figured it wouldn't be needed. Then I received my ethernet half of the kit ~$28 or something. with two 12 pin header cables that I ordered to cut up and experiment with. Looking at the 105SR specs I see that the ethernet chip (W5100) is a 3.3V chip. Looking at the schematic for the EVB board (the ethernet half is not available) I confirmed the ethernet half of the board is a 3.3V board. Turns out the 3.3V Regulator to knock the 5V input down to 3.3V is on the EVB board in the development kit and the 3.3V is passed to the ethernet half of the board via the 12 pin cable. I should have looked closer at this before I went and ordered it. My RA+ is only putting out 4.5V to the WiFi mod, low but I'm still thinking it's too high for me to chance hooking up direct to the 3.3V board. Also a reset pin on the ethernet board needs to be pulled high to keep it from floating. Big red letters in the spec sheet say the board will not function properly if the reset pins are left floating. So it looks like to use this board I am going to need a 3.3V Regulator and at least one pull up resistor to be either worked onto the board somehow, on a second board or worked into one of my 12 pin cables and then probably potted with hot glue or something to keep it from breaking. I could probably still do some testing with a breadboard with the needed extra parts but this is probably not the best option for a "drop in" replacement for the WiFi mod. So I started poking around the Wiznet website and found the 110SR that seems to be the exact same board as the 105SR but has a 5VDC jack and 3.3V regulator built on it as well as an rs232 db9 connector.
seems as if this would be a much more straight forward way to wire this thing up and the 110SR is priced comparably to the 105SR.

Here is a link.
http://www.wiznet.co.kr/Sub_Modules/en/ ... =&pid=1040

Roberto, can you take a look at the specsheet\manual and give your thoughts on this.

Thanks,

Nick

Re: Ethernet

Posted: Tue Dec 18, 2012 10:36 pm
by rimai
:(
I'm not so sure it would work.
You would also need a RS-232 transceiver on the RA side.
I think it is easier to stay on the UART-TTL level instead of converting to RS-232.
So, to stay on TTL level and communicate to 3.3V device, you will need something like this:
http://www.gravitech.us/mi5v3lesh.html
This guy should level shift between 3.3V and 5V and also provide you with 3.3V power.

Re: Ethernet

Posted: Wed Dec 19, 2012 5:12 pm
by DrewPalmer04
Mine was back ordered where I got it from. So it'll be here after Christmas. Lame

Re: Ethernet

Posted: Wed Dec 19, 2012 8:01 pm
by 00Warpig00
rimai wrote::(
I'm not so sure it would work.
You would also need a RS-232 transceiver on the RA side.
I think it is easier to stay on the UART-TTL level instead of converting to RS-232.
So, to stay on TTL level and communicate to 3.3V device, you will need something like this:
http://www.gravitech.us/mi5v3lesh.html
This guy should level shift between 3.3V and 5V and also provide you with 3.3V power.

The level shifter looks pretty good, love the fact that it has the 5V in and 3.3V regulator on it.
The TTL serial data coming to/from the RA is at 5V then correct? If so wouldn't we need a bi directional level shifter? The datasheet for the level shifter you mention requires you to pick a conversion direction 5->3 or 3->5. Sounds great if you are doing one way traffic to your 3.3V device from a 5V device but since this is two way serial traffic wouldn't we need to shift the TX line from the 3.3V Device back up to 5V for the RA to receive data from the Ethernet port?

Nick

Re: Ethernet

Posted: Wed Dec 19, 2012 8:26 pm
by rimai
You are right... :(
All the other ones I've seen don't have the regulator built-in.

Re: Ethernet

Posted: Wed Dec 19, 2012 8:39 pm
by 00Warpig00
May not need bi-directional at all... If I am understanding this correctly... at this link

http://www.rocketnumbernine.com/2009/04 ... -converter

The low to high shift paragraphs seems to suggest that Atmel microcontrollers will accept a 3.3V logic high as a high on a 5V logic input. At least this is what I get out of it, although admittedly I didnt pay allot of attention in my digital electronics classes back in the 80's I was more interested in the Analog side of things. Anyway if this is the case then we could use the shifter to shift the RA's 5V TX down to 3.3V into the ethernet board to prevent killing the ethernet board and use the 3.3V regulator to solve the power problem to the ethernet board and just wire the TX from the Ethernet board back directly to the RX on the RA. Sounds like I really need to buy an arduino Mega2560 some breadboards and a logic probe... (I knew this was gonna happen!!! lmao) I have been considering buying an arduino Mega2560 anyhow and set it up as a pseudo RA+ emulator so I don't have to rip my controller out to build and test stuff.

Nick

Re: Ethernet

Posted: Wed Dec 19, 2012 9:06 pm
by rimai
Damn, I must be loosing it.
I got so much going on at once that my brain just can't process all at once.... lol
You are right again.
You only need to level shift the 5 to 3.3
The controller will read the 3.3 just fine.

Re: Ethernet

Posted: Tue Dec 25, 2012 1:52 pm
by DrewPalmer04
My ethernet and UNO combo came in yesterday! Where do I start?

Re: Ethernet

Posted: Tue Dec 25, 2012 2:10 pm
by rimai
Merry Christmas!!!
I was testing it with this code:

Code: Select all

/*
  Web Server
 
 A simple web server that shows the value of the analog input pins.
 using an Arduino Wiznet Ethernet shield. 
 
 Circuit:
 * Ethernet shield attached to pins 10, 11, 12, 13
 * Analog inputs attached to pins A0 through A5 (optional)
 
 created 18 Dec 2009
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe
 
 */

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 
  0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
IPAddress ip(192,168,1, 177);
IPAddress remoteserver(69,198,171,165); // forum.reefangel.com
EthernetClient clientout;
unsigned long lastmillisout=millis();
unsigned long lastmillisin=millis();
boolean sending=false;
char strout[400];

// Initialize the Ethernet server library
// with the IP address and port you want to use 
// (port 80 is default for HTTP):
EthernetServer server(80);

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(57600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  // start the Ethernet connection and the server:
  Ethernet.begin(mac);
  server.begin();
  Serial.println(Ethernet.localIP());
}


void loop() {
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
//    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      while (client.available()) {
        char c = client.read();
        if (sending==false) Serial.write(c);
        lastmillisin=millis();        
      }
      while (Serial.available()){
        char c = Serial.read();
        client.print(c);
        if (millis()-lastmillisin>2000)
        {
          Serial.println("Timeout incoming");
          Serial.flush();
          lastmillisin=millis();
          client.stop();
        }
      }
      if (millis()-lastmillisin>2000)
      {
        Serial.println("Timeout incoming");
        Serial.flush();
        lastmillisin=millis();
        client.stop();
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
    //    Serial.println("client disonnected");
  }
  else
  {
    if (Serial.available())
    {
      memset(strout,0,sizeof(strout));
      int b=Serial.readBytesUntil('\n',strout,sizeof(strout));
      Serial.flush();
//      Serial.println(b);
      Serial.println("Connecting");
      if (b>10)
      {
        sending=true;
        Serial.print(strout);
        Serial.println(" HTTP/1.0");
        Serial.println();
        if (clientout.connect(remoteserver, 80)) 
        {
          Serial.println("Connected");
          //        while (Serial.available()){
          //          char c = Serial.read();
          //          clientout.print(c);
          //        }
          clientout.print(strout);
          clientout.println(" HTTP/1.0");
          clientout.println();
          lastmillisout=millis();
        }
      }
    }
    while (clientout.available()) {
      char c = clientout.read();
      Serial.print(c);
      if (millis()-lastmillisout>8000)
      {
        Serial.println("Timeout connected");
        lastmillisout=millis();
        clientout.stop();
        sending=false;
      }
    }
    if (!clientout.connected())
    {
      clientout.stop();
      sending=false;
    }
  }
  if (millis()-lastmillisout>8000)
  {
    Serial.println("Timeout global");
    lastmillisout=millis();
    clientout.stop();
    sending=false;
  }

}

//GET /status/submitp.aspx?t1=806&t2=0&t3=0&ph=441&id=test&em=0&rem=0&key=&atohigh=0&atolow=0&r=0&ron=0&roff=255 HTTP/1.0

//GET /status/submitp.asp?t1=806&t2=0&t3=0&ph=441&id=test&em=0&rem=0&key=&atohigh=0&atolow=0&r=0&ron=0&roff=255 HTTP/1.0
//Host: forum.reefangel.com
//
//GET /status/submitp.aspx?t1=806&t2=0&t3=0&ph=441&id=test&em=0&rem=0&key=&atohigh=0&atolow=0&r=0&ron=0&roff=255 HTTP/1.0
//Host: forum.reefangel.com
//Connection: Keep-Alive


Re: Ethernet

Posted: Tue Dec 25, 2012 2:47 pm
by DrewPalmer04
Awesome!! Merry christmas!!! So to use this I need the wifi cable yes?

Re: Ethernet

Posted: Tue Dec 25, 2012 2:51 pm
by rimai
Or patch your own.

Re: Ethernet

Posted: Tue Dec 25, 2012 4:28 pm
by DrewPalmer04
Sweet. Now will the cable power the board or do I need the 5v power supply?