Hello forum,
I have an RFID reader connected to a Pi 4 which sends data through a TCP socket as chips are scanned. The reader connects to the Pi through eth0, and the Pi connects to the internet through wifi and sends on the data from the RFID reader to an API on my server.
To get everything talking I had to put the RFID reader in a different IP range (192.168.3.11) and I give eth0 on the Pi address 192.168.3.10. Then the Pi wifi interface has static address 192.168.0.111 in order to connect to my router, which is 192.168.0.1. We couldn’t get things working while the RFID reader and Pi eth0 were in the same IP range as the wifi and router.
It all works fairly well as it is when I set the Pi’s eth0 using ifconfig in the balena cloud terminal, the only hickup is that I can’t seem to get the connection file syntax right since it doesn’t go through the gateway - my question is whether there is a way to set this static address for the Pi’s eth0? Or is there a better way to link eth0 and wifi so I can receive data from the RFID reader, let the Pi compile the JSON so it can send it to my API through wifi?
This is what I currently have in the connection file for eth0: (I realise there is no way it could work, but can we change it so that it will work?)
[connection]
id=my-ethernet
type=ethernet
interface-name=eth0
permissions=
secondaries=
[ethernet]
mac-address-blacklist=
[ipv4]
address1=192.168.3.10/24,192.168.0.1
dns=8.8.8.8;8.8.4.4;
dns-search=
method=manual
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto