jakkie07
Posts: 2
Joined: Thu Jun 07, 2018 11:34 am

Raspberry Pi and Ardino network connectivity

Thu Jun 07, 2018 1:47 pm

Hi
I have search topics but have not found something.
My idea is.
Running an webapp on the pi or something similar that can send command to an Arduino board to open and close relays.
I have seen this can b done using USB connectivity, I would like to be able to do this over network.

hope it makes sense.

The Arduino and the PI will not be in the same location and that is why I want to make use of LAN connectivity.

B.Goode
Posts: 6181
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry Pi and Ardino network connectivity

Thu Jun 07, 2018 2:19 pm

Welcome to the Raspberry Pi forums.

Something close to "thinking aloud" to try to help you move this project forward...

An RPi running the Raspbian Operating System is a general purpose microcomputer running a full operating system including a full suite of network protocols and connectivity. No shortage of options there..

How will you connect the Arduino to a LAN: does it have an Ethernet or WiFi shield? What network protocols can you include in the sketch to be run on the Arduino?

(Unsurprisingly for an RPi forum, I think the Arduino end might be the more challenging.)

If you can get the two devices communicating, maybe MQTT would be a useful tool for passing messages to-and-fro.

User avatar
OutoftheBOTS
Posts: 618
Joined: Tue Aug 01, 2017 10:06 am

Re: Raspberry Pi and Ardino network connectivity

Thu Jun 07, 2018 9:05 pm

Instead of using Arduino at the relay end use a ESP8266 as they are alreayd wifi enabled and specailly designed for IOT. Google "esp8266 nodemcu"

The ESP8266 can be programmed with Arudino IDE or Micro-Python or Lua.

Using MQTT is the easiest way to send instructions from your RPi to the ESP8266 via network.

asandford
Posts: 1999
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Raspberry Pi and Ardino network connectivity

Thu Jun 07, 2018 11:39 pm

Ethernet and/or WIFI enabled Arduinos are unreasonably expensive, I use Omega Onions instead.

As an alternative to (I assume TCP/IP) networking, you could use radio networking instead (they use a variety of interfaces).

jakkie07
Posts: 2
Joined: Thu Jun 07, 2018 11:34 am

Re: Raspberry Pi and Ardino network connectivity

Thu Jun 14, 2018 10:52 am

I have the network shield for my Arduino.
I would prefer cable connection then Wifi.

The part on the RPi is easy, and I was able to do this controlling relays straight from the GPIO.

I would prefer having an network device (arduino) connected to the relays.
I have looked at LAN enabled relays.

asandford
Posts: 1999
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Raspberry Pi and Ardino network connectivity

Mon Jun 18, 2018 8:59 pm

jakkie07 wrote:
Thu Jun 14, 2018 10:52 am
I have the network shield for my Arduino.
I would prefer cable connection then Wifi.

The part on the RPi is easy, and I was able to do this controlling relays straight from the GPIO.

I would prefer having an network device (arduino) connected to the relays.
I have looked at LAN enabled relays.
You could probably cobble together a networked version of firmata to do this (one may already exist), or write a sketch to interpret http messages.

pws
Posts: 54
Joined: Mon Apr 11, 2016 4:16 pm

Re: Raspberry Pi and Ardino network connectivity

Tue Jun 19, 2018 2:07 am

OutoftheBOTS wrote:
Thu Jun 07, 2018 9:05 pm
Instead of using Arduino at the relay end use a ESP8266 as they are alreayd wifi enabled and specailly designed for IOT. Google "esp8266 nodemcu"

The ESP8266 can be programmed with Arudino IDE or Micro-Python or Lua.

Using MQTT is the easiest way to send instructions from your RPi to the ESP8266 via network.
Completely agree with this! I have been amazed at how easy they are to set up.

Return to “Automation, sensing and robotics”

Who is online

Users browsing this forum: No registered users and 8 guests