Pi communicate with Arduino

Hi, I’m searching for the best way to let a Pi 3 ‘talk’ with a Arduino Uno Rev3 or higer.
I want to talk in fixed strings of information both ways.

use an esp8266 module instead of an arduino, they are cheaper and integrate wifi chip
program the esp8266 like an arduino, and program it to be a simple web server.
then communicate with the raspberry with wifi and tcpsockets.

This sounds sofisticated, but in our location we aren’t allowed to use any wireless technics!

then may be, send serial data from the arduino to the pi3
try to read serial port with xojo from the Pi3 it may work directly in fact.

Are you asking about physical interconnection methods? Wires, serial, i2c, wifi, radio whatever? or about code to packetize and get the data back and forth?

The easiest way is to connect both with a USB cable and use their serial classes: https://oscarliang.com/connect-raspberry-pi-and-arduino-usb-cable/

If you want to avoid a cable, you can connect their ports directly: https://oscarliang.com/raspberry-pi-and-arduino-connected-serial-gpio/

In my experiments, I found the USB solutions handles ground problems or interferences that appeared with a direct connection while driving a WS2812 LED chain.

Asking about a good working physical interconnection!
I was thinking about the gpio connections but wanted to check first you all.
My experience with Arduino is good, but I’m not familiar enough with Pi gpio.

I’m not a real fan of USB because I don’t know what names they get when the system is started. Maybe I’m doing something wrong but I like hardcoded ports instead of names which are given by an OS.

Is there a Xojo example somewhere how to talk with the Pi’s gpio serial pin’s?

@Ulrich Bogun Is your Pigpio library complete enough to use SPI with an Arduino?

Good question. In theory it is, but I haven’t tested SPI.

Not really a code example, but some details are here: https://forum.xojo.com/33713-connecting-raspi-and-ardiuno-gpio-pins