I was trying to learn how to set up communication between two raspberry pi in close proximity in a remote area without a router. I am new to raspberry pi and started trying to figure out MQTT/Mosquitto but upon further research, I think that MQTT needs to be plugged into a router or into every individual pi to operate. I was wondering if I was missing something about MQTT or if I should try to find another method of communication? The goal of this communication is to send a rapidly changing number on a mobile station where a wire cannot be used.
I am currently using 2 Pi Raspberry Zero W running the full install of Raspbian Buster. The system of communication should preferably be wireless communication which can send information with minimal delay.
Example of what I am trying to do for reference:
Having a sensor and pi on one side of a vehicle transmitting sensor info to another pi on the other side of the said vehicle where a wire cannot be used.