Arduino Ethernet & Touchscreen? Suggestions?

Basic / Standard Reef Angel hardware
Post Reply
mbcolangelo
Posts: 3
Joined: Fri Mar 13, 2015 8:32 am

Arduino Ethernet & Touchscreen? Suggestions?

Post by mbcolangelo »

I recently purchased an RA+ for my wife's tank and love it! I've had it barely a week and decided to order a 2nd unit to replace the DIY Arduino setup I currently have on my tank.

What I'm interested in doing is connecting both an ethernet module AND a touchscreen to my unit.

Just kinda looking to the community for some ideas, suggestions, feedback, etc :)

I think it would be simple enough to connect one OR the other via serial and borrow the wifi library. I'm not really sure on the best way to use both these units together though.

Hardware I have right now is;
- Arduino Uno
- Arduino Leonardo
- 2x Ethernet Shields
- 2.8" TFT TouchScreen Shield (Seeed Studio model)
- Plus random parts, shields, etc acquired over time.

* I pretty much capped my spending allowance for a while on the two RA+ units so I have to make due with what I have for now lol.

I'm going off the info from another thread for the Ethernet portion of the setup (I can't post links)

Since the touchscreen consumes a ton of pins, I don't see any way of piggybacking the touchscreen and ethernet shield together.
Touchscreen Pin Assignment: Digital 2-17! (illustrated seeestudio wiki page TFT_Touch_Shield_V1.0)

First idea to come to mind is:
Leonardo/Touch <-> Uno/Ethernet Module <-> RA+

Leonardo RX/TX serial pin <-> Uno SoftwareSerial on unused pins
Uno TX/RX pins <-> RA serial.

Communication between the Leonardo/Touchscreen would be forwarded to/from the Uno/Ethernet

Is there a better way? A way to go directly to the RA vs. through the ethernet/uno?

As to why I would want the touchscreen AND the ethernet?
Mainly because I want the ability to quickly toggle relays without my phone, tablet, computer, etc.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Arduino Ethernet & Touchscreen? Suggestions?

Post by lnevo »

Any reason you can't do the wireless?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Arduino Ethernet & Touchscreen? Suggestions?

Post by rimai »

Technically, you could tap into the experimental protocol I created a while ago.
It uses the expansion bus to communicate with the touch module.
Add this to your loop()

Code: Select all

  ReefAngel.UpdateTouchDisplay();
Then, catch the commands sent to your touch module through the expansion bus.
Check the source for more info on what info gets set to the touch module:
https://github.com/reefangel/Libraries/ ... .cpp#L2078
The default I2C address for the touch module is 0x12
Roberto.
mbcolangelo
Posts: 3
Joined: Fri Mar 13, 2015 8:32 am

Re: Arduino Ethernet & Touchscreen? Suggestions?

Post by mbcolangelo »

lnevo wrote:Any reason you can't do the wireless?
- I think I would face similar issues since the wireless module also uses the RA serial header? But otherwise I'm limited to the hardware I currently have laying around (I've been cut off from spending any more money lol).

When you say expansion bus, are you referring to the bus port on the relay box?

Hopefully I'll have a chance to play around with stuff tonight and over the weekend. I may have to wait until my unit comes in though because wife keeps yelling at me lol
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Arduino Ethernet & Touchscreen? Suggestions?

Post by rimai »

Yes, the port on the side of the relay box.
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Arduino Ethernet & Touchscreen? Suggestions?

Post by lnevo »

Oh I thought you meant screen in general.. The regular RA is sufficient for most things. I guess if you want to control individual relays our current interface isn't good for that... it could be though :)
mbcolangelo
Posts: 3
Joined: Fri Mar 13, 2015 8:32 am

Re: Arduino Ethernet & Touchscreen? Suggestions?

Post by mbcolangelo »

My unit came in yesterday!! Got it all hooked up, programmed, etc! Works great!

Haven't had a chance to play with the I2C communication with touchscreen yet though. Probably tonight or tomorrow night when I have more time.


I'm having an issue with the ethernet though that I can't figure out.

I can communicate with it just fine via browser or Android app.. I forwarded my ports and can hit it remotely too.

It's not updating the reefangel portal though?
--- I did a live packet dump on my router and didn't see any requests to/from the website. Only traffic is when my phone makes a request.

Both my RA and Ethernet code are attached.
- Shouldn't make a difference but I'm using a Duemilanove(328) + Ethernet Shield

Any ideas? Am I missing something?
Attachments
RA_EtherMod.ino
Code running on arduino+ethernet unit
(5.12 KiB) Downloaded 375 times
RA_Current.ino
Code on RA unit
(3.09 KiB) Downloaded 349 times
Post Reply