Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPI and TUN - Link two RPi together via TCP/IP #41

Closed
epsi1on opened this issue Jan 9, 2025 · 4 comments
Closed

RPI and TUN - Link two RPi together via TCP/IP #41

epsi1on opened this issue Jan 9, 2025 · 4 comments
Labels

Comments

@epsi1on
Copy link

epsi1on commented Jan 9, 2025

Hi,
I would like to make a network link of two RPI via rf24 (TCPIP link).
i did successfully ran the /RF24/examples_linux/gettingstarted on both devices, both can send and receive data successfully.

To setup network link, this is what i did ran:

Machine 1 (IP: 10.11.2.2/24)

sudo ip tuntap add dev tun_nrf24 mode tun user pi multi_queue
sudo ifconfig tun_nrf24 10.11.2.2/24

sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -j MASQUERADE

Machine 2 (IP: 10.11.2.3/24)

sudo ip tuntap add dev tun_nrf24 mode tun user pi multi_queue
sudo ifconfig tun_nrf24 10.11.2.3/24

sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -j MASQUERADE

after running the RF24Gateway_ncurses file on both PIs, this is result:
machine 1:

image

machine 2:

image

Finally i would like to be able to ping machine 2 from machine 1 and vise versa.

But when i try to ping 10.11.2.3 from machine 1, there is no response from machine 2. I definitely think i'm missing something but cannot figure it out. :) Could you please tell me what am i missing?

Thanks in advance

@TMRh20
Copy link
Member

TMRh20 commented Jan 9, 2025 via email

@epsi1on
Copy link
Author

epsi1on commented Jan 10, 2025

Kindly thanks for the information.
It did solve the problem, now i can ping machines via NRF links. the speed is about 10KBps which is more than enough for my application.
I did not tested yet, but do you think that using UDP will increase the speed for transferring audio or video?
Thanks again for great library.

@TMRh20
Copy link
Member

TMRh20 commented Jan 11, 2025

Thanks @epsi1on

Yes I think UDP would be faster. I typically get speeds up to ~20KBps, but 10 is probably a good average.

@epsi1on
Copy link
Author

epsi1on commented Jan 12, 2025

Thanks

@epsi1on epsi1on closed this as completed Jan 12, 2025
@TMRh20 TMRh20 pinned this issue Jan 12, 2025
@TMRh20 TMRh20 changed the title RPI and TUN RPI and TUN - Link two RPi together via TCP/IP Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants