Organization: Akita Engineering Website: www.akitaengineering.com Contact Email: info@akitaengineering.com
This Meshtastic plugin, akita-meshtastic-ipfs, integrates the InterPlanetary File System (IPFS) with Meshtastic, enabling decentralized data storage and retrieval over your Meshtastic network. It is implemented as a Meshtastic plugin to simplify integration with Meshtastic-based projects.
- Plugin Integration: Designed to integrate with Meshtastic's plugin framework for modularity and maintainability.
- Decentralized Data Storage: Store and retrieve messages and files using IPFS.
- Offline Access: Access previously retrieved data even without an internet connection.
- Content Addressing: Ensure data integrity and authenticity using IPFS CIDs.
- Message Metadata: Messages are stored with sender ID and timestamp.
- Configuration: Configure plugin settings through the Meshtastic app or CLI.
- Resource Management: Includes memory checks and configurable storage limits.
- FreeRTOS Task: IPFS operations run in a separate FreeRTOS task to prevent blocking the main Meshtastic loop.
- Progress Indication: Displays connected peers and free heap memory.
- Security: Includes basic authentication with a pre-shared key.
- Robustness: Implements retries and detailed error logging.
- HTTP Gateway Bridge: The plugin exchanges JSON requests with the gateway over HTTP and receives CID or data responses immediately.
-
Dependencies:
- Install the required libraries as described in the Gateway Installation and Plugin Installation sections.
-
Plugin Files:
- Place
akita-meshtastic-ipfs.cppandakita-meshtastic-ipfs.hin thesrc/pluginsdirectory of your Meshtastic project.
- Place
-
Compile and Flash:
- Compile and flash the Meshtastic firmware to your devices.
- Depending on your Meshtastic setup, you may need to register the plugin in
main.cppor follow your project's plugin registration process.
-
Configuration:
- Use the Meshtastic app or CLI to configure the plugin:
- Enable or disable the plugin (
enabled). - Set the IPFS gateway address (
gatewayAddress). - Set the IPFS gateway port (
gatewayPort). - Set the shared gateway key (
gatewayKey) when gateway authentication is enabled.
- Enable or disable the plugin (
- Use the Meshtastic app or CLI to configure the plugin:
-
Dependencies:
-
Install Python 3.7 or later.
-
Install the required Python packages:
pip install -r gateway/requirements.txt
-
Ensure IPFS is installed and running on your system. See the IPFS documentation for installation instructions.
-
-
Configuration:
-
Configure the gateway using environment variables. See the
gateway/src/config.pyfile for available options. -
Important: Set a strong
PRESHARED_KEYenvironment variable for authentication. -
Example:
export PRESHARED_KEY="your_secure_key" export MESHTASTIC_DEVICE="/dev/ttyUSB0" # Or use MESHTASTIC_HOST and MESHTASTIC_PORT python gateway/src/main.py
-
-
Dependencies:
- You'll need the Meshtastic development environment set up for your specific platform (e.g., Arduino IDE for ESP32).
- Install the following libraries:
IPFS_LiteArduinoJsonTimeLibWiFi(for ESP32)
-
Include Plugin Files:
- Place
akita-meshtastic-ipfs.cppandakita-meshtastic-ipfs.hin thesrc/pluginsdirectory of your Meshtastic project.
- Place
-
Compile and Flash:
- Compile and flash the Meshtastic firmware to your devices.
The following environment variables can be used to configure the gateway:
IPFS_PORT: The Meshtastic port number used for IPFS communication. Default:200.USE_MESH_INTERFACE: Set toTrueto use a Meshtastic Mesh Interface (TCP/IP),Falseto use serial. Default:True.MESHTASTIC_HOST: The hostname or IP address of the Meshtastic device (for TCP/IP). Default:127.0.0.1.MESHTASTIC_PORT: The port number of the Meshtastic device (for TCP/IP). Default:4444.WEB_PORT: The port number for the SocketIO web server. Default:8080.AUTHENTICATION_ENABLED: Set toTrueto enable authentication,Falseto disable. Default:True.PRESHARED_KEY: The pre-shared key used for authentication. Required if authentication is enabled. Default:secret_key(CHANGE THIS!).
The following options can be configured in the Meshtastic settings (using the app or CLI):
enabled: (Boolean) Enables or disables the IPFS plugin. Default:true.gatewayAddress: (String) The IP address of the IPFS gateway.gatewayPort: (Integer) The port number of the IPFS gateway.gatewayKey: (String) The pre-shared key sent asAuthorization: PSK <key>. Default:secret_key.
- Once the plugin and gateway are set up, Meshtastic devices can send and receive data via IPFS.
- When sending data, the Meshtastic device sends the data to the gateway, which stores it on IPFS and returns the CID. The CID is then broadcast over the Meshtastic network.
- When receiving a CID, a Meshtastic device can request the data from the gateway, which retrieves it from IPFS and sends it back to the device.
- The gateway also provides a SocketIO interface for web applications and an authenticated HTTP endpoint at
/api/ipfsfor the embedded plugin.
- Resource Usage: IPFS can be resource-intensive. Monitor device memory and CPU usage, especially on the gateway.
- Network Connectivity: IPFS and Meshtastic require network connectivity. Ensure that your devices have a stable connection.
- Security: This plugin includes basic authentication. For production environments, use a more secure solution (e.g., OAuth 2.0, certificates).
- Testing: Thoroughly test the plugin and gateway in your specific Meshtastic environment before deployment.
This project is licensed under the GNU General Public License v3.0.