Forum > Networking and Web Programming

Basic Data Exchange over home network

(1/3) > >>

AlanTheBeast:
I have a RPi4 project using Ultibo RTL (no OS).

That end of the project is generating a lot of data and I'm not happy with using the SD card to 'import' it to the Mac or same to transport updated run time program to the Pi.

I'd like a bare bones ethernet solution where my Mac can send/receive arbitrary data from the Pi and v-v.  (I'd be writing the code for each machine). 

Call the Mac program Boss and the Pi program Sensor.

I'm not sure if TCP/IP is too much or if UDP is too little.  In the later case I can easily implement checksumming and such to verify the data.

I have no idea how to do this.

Is there an absolutely bare bones FP demo of using UDP or TCP/IP on a local network between two machines?

The local network has a WiFi-modem-router and a switch in between the two machines.  This is all wired, not WiFi.

Thanks.

Update: I've found some code for the Ultibo RTL unit called Winsock2.  It compiled and is allegedly sending a test message 1/second to my Mac from the Pi.  (Local IP and port).

I see mention here of INet, but it won't "uses" on the mac (FPC compiler).... hmm - seems to be for Windows and Linux, not Mac.  !

MarkMLl:
Are you moving packets of data described by a fixed-size record or streams?

MarkMLl

p.s. You've probably seen my considered opinion of LNet elsewhere.

AlanTheBeast:
Fixed size packets is fine.  That is to say the packets may vary in size from packet to packet, but not be a stream.

I have not seen your opinion but your tone says it all...

PierceNg:

--- Quote from: AlanTheBeast on May 09, 2021, 08:18:15 pm ---I have a RPi4 project using Ultibo RTL (no OS).
I'd like a bare bones ethernet solution where my Mac can send/receive arbitrary data from the Pi and v-v.  (I'd be writing the code for each machine). 

--- End quote ---

MQTT https://mqtt.org/ is designed for IoT networking. Here's an implementation for Ultibo: https://github.com/pjde/ultibo-mqtt. Search the forum for threads of MQTT for FPC / Lazarus on the usual 'regular' operating systems.

MarkMLl:

--- Quote from: AlanTheBeast on May 09, 2021, 10:37:17 pm ---Fixed size packets is fine.  That is to say the packets may vary in size from packet to packet, but not be a stream.

--- End quote ---

In that case either follow @PierceNg and use whatever you can find available, or stick to UDP which is a very thin wrapper over IP which is a very thin wrapper over Ethernet or SLIP. Avoid TCP unless you really need it, it's a rabbit hole.

LNet might have been OK before threads were universally implemented, but is somewhat... abstruse. I use it for Telnet and have added a couple of bits to the variant bundled as a tool with FPC, but there are some nasty bugs in there which have defied resolution and if I need to do more I'll quite simply reimplement Telnet from scratch.

MarkML

Navigation

[0] Message Index

[#] Next page

Go to full version