[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80562":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":27,"discoverSource":28},80562,"esphome-meshtastic","Andrik45719\u002Fesphome-meshtastic","Andrik45719","Meshtastic component for ESPHome",null,"C",72,4,5,2,0,1,6,3,42.2,false,"main",true,[],"2026-06-12 04:01:29","# ESPHome Meshtastic Component\n\n![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-ESPHome-green)\n\nA powerful ESPHome component that enables integration of [Meshtastic](https:\u002F\u002Fmeshtastic.org\u002F)-compatible LoRa devices with ESPHome, allowing you to create mesh networking IoT devices with text messaging, packet routing, and mesh coordination capabilities.\n\n\n[![asciicast](https:\u002F\u002Fasciinema.org\u002Fa\u002F1041922.svg)](https:\u002F\u002Fasciinema.org\u002Fa\u002F1041922)\n\n## What It Does\n\nThis component transforms your ESP32 microcontroller into a full-featured Meshtastic mesh node. It provides:\n\n- **LoRa Mesh Networking**: Direct integration with SX126x and SX127x LoRa radios for long-range mesh communication\n- **Packet Routing**: Automatic routing and relay of packets through multiple nodes to extend network range\n- **Text Messaging**: Send and receive text messages over the mesh network to specific nodes or channels\n- **UDP Bridge Mode**: Optional bridge between LoRa mesh and UDP network for seamless integration\n- **Position Broadcasting**: Share GPS location data across the mesh network\n- **Multi-Channel Support**: Configure multiple channels with different Pre-Shared Keys (PSKs) for channel-based communication\n- **Public Key Infrastructure (PKI)**: Support for encrypted communications with public\u002Fprivate key pairs\n- **Packet Transport Protocol**: Integration with ESPHome's packet_transport component for advanced IoT applications\n\n## Key Features\n\n✨ **Meshtastic Protocol Support**\n- Compatible with official Meshtastic clients and nodes\n- Support for all Meshtastic port numbers and message types\n- Automatic packet encryption, decryption, and authentication\n- Most Meshtastic features easily implementable through simple YAML configuration\n\n🌐 **Multiple Radio Options**\n- Support for SX126x radios (SX1262, SX1268)\n- Support for SX127x radios\n- Configurable LoRa parameters (frequency, spreading factor, bandwidth, etc.)\n\n📡 **Flexible Connectivity**\n- Native LoRa mesh networking\n- UDP multicast and unicast support for local network integration\n- Bridging between LoRa mesh and UDP networks\n\n🔐 **Security Features**\n- Channel encryption with Pre-Shared Keys (PSK) for secure group communication\n- Private message encryption using Public Key Infrastructure (PKI)\n- Per-node public\u002Fprivate key management\n\n🎛️ **ESPHome Integration**\n- Full automation and trigger support\n- On-packet received triggers with lambda expression support\n- Send packet and text message actions\n- Complete configuration via YAML\n\n## Getting Started\n\n### Requirements\n\n- ESP32 microcontroller with LoRa radio (SX126x or SX127x)\n- ESPHome 2026.4 or later\n- Meshtastic mesh network (or create a new one)\n\n### Installation\n\n#### Option 1: External Component (Recommended)\n\nAdd to your ESPHome configuration:\n\n```yaml\nexternal_components:\n  - source: github:\u002F\u002FAndrik45719\u002Fesphome-meshtastic@main\n    components: [meshtastic]\n    refresh: 24h\n```\n\n#### Option 2: Local Component\n\nClone this repository into your ESPHome `components` directory:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FAndrik45719\u002Fesphome-meshtastic.git \\\n  ~\u002F.esphome\u002Fcomponents\u002Fesphome-meshtastic\n```\n\n### Basic Configuration Example\n\n```yaml\nesphome:\n  name: my-meshtastic-node\n\nesp32:\n  board: esp32-c3-devkitm-1\n  framework:\n    type: esp-idf\n\n# Configure SPI for LoRa radio\nspi:\n  clk_pin: GPIO10\n  mosi_pin: GPIO7\n  miso_pin: GPIO6\n\n# Configure LoRa radio (SX1262 example)\nsx126x:\n  id: lora_radio\n  cs_pin: GPIO8\n  busy_pin: GPIO4\n  dio1_pin: GPIO3\n  rst_pin: GPIO5\n  frequency: 433125000\n  spreading_factor: 11\n  bandwidth: 250_0kHz\n  coding_rate: CR_4_5\n\n# Configure Meshtastic component\nmeshtastic:\n  - id: mesh_node\n    lora: lora_radio\n    hw_model: 39  # DIY_V1\n    hop_limit: 3\n    \n    # Configure channels\n    channels:\n      - name: LongFast\n        psk: \"XOLPZHTWzHgykJxZ3pnj10mMJdr8glgblsNGLUIvd1w=\"\n      - name: Admin\n        psk: \"cmF4UzVWbnZWQ0xxZlFyZXBSb2xhaHRNSkI1bFhabzU=\"\n    \n    # Configure this node\n    nodes:\n      - node_number: 0\n        name: \"My ESPHome Node\"\n        short_name: \"ESPH\"\n        private_key: !secret node_private_key\n        public_key: !secret node_public_key\n    \n    # Handle received packets\n    on_packet:\n      then:\n        - lambda: |-\n            ESP_LOGD(\"mesh\", \"Packet from %08X to %08X, port %d\", from, to, portnum);\n\n# Send text messages via button press\nbutton:\n  - platform: template\n    name: \"Send Mesh Message\"\n    on_press:\n      then:\n        - meshtastic.send_text_message:\n            id: mesh_node\n            channel: LongFast\n            text: \"Hello from ESPHome!\"\n```\n\n### Advanced Configuration\n\n#### UDP Bridge Mode\n\nConnect your mesh to a local network:\n\n```yaml\nmeshtastic:\n  - id: mesh_node\n    lora: lora_radio\n    \n    udp:\n      addresses:\n        - 192.168.1.100  # UDP server address\n      multicast_address: 224.0.0.69\n      bridge_mode: true  # Forward LoRa \u003C-> UDP packets\n```\n\n#### Position Broadcasting\n\nShare GPS coordinates with the mesh:\n\n```yaml\nmeshtastic:\n  - id: mesh_node\n    lora: lora_radio\n    \n    position:\n      latitude: 50.45\n      longitude: 30.52\n      altitude: 179\n      broadcast_interval: 3h\n```\n\n#### Packet Transport Integration\n\nUse with ESPHome's packet_transport for sensor data relay:\n\n```yaml\npacket_transport:\n  - platform: meshtastic\n    meshtastic_id: mesh_node\n    binary_sensors:\n      - my_sensor_id\n    hop_limit: 2\n    update_interval: 30min\n```\n\n#### Direct Node Messaging\n\nSend messages directly to specific nodes:\n\n```yaml\nbutton:\n  - platform: template\n    name: \"Send Direct Message\"\n    on_press:\n      then:\n        - meshtastic.send_text_message:\n            id: mesh_node\n            to: 848894052  # Node ID\n            text: \"Direct message\"\n```\n\n### More Usage Examples\n\nFor additional configuration examples and a complete working setup, see [`meshtastic.yaml`](meshtastic.yaml) in this repository. It provides a real-world example with:\n- SX1262 LoRa radio configuration\n- Multiple channel setup\n- Node configuration with encryption keys\n- Button actions for sending messages\n- Packet event handling with lambda expressions\n- UDP bridge setup\n- Position broadcasting configuration\n\n## Configuration Reference\n\n### Component Configuration\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `id` | string | required | Component ID |\n| `lora` | string | required | SX126x or SX127x radio component ID |\n| `hw_model` | integer | 39 | Hardware model number (39 = DIY_V1) |\n| `hop_limit` | integer | 7 | Default hop limit for packets (0-7) |\n| `ignore_mqtt` | boolean | true | Ignore MQTT-forwarded packets |\n| `ok_to_mqtt` | boolean | false | Allow forwarding to MQTT |\n| `exclude_pki` | boolean | false | Disable private key infrastructure |\n| `broadcast_interval` | time | 3h | Node info broadcast interval |\n\n### Channel Configuration\n\n```yaml\nchannels:\n  - name: \"Channel Name\"\n    psk: \"Base64EncodedPSK\"  # Pre-shared key for encryption\n```\n\n### Node Configuration\n\n```yaml\nnodes:\n  - node_number: 0  # 0 = this node\n    name: \"Full Name\"\n    short_name: \"SHORT\"\n    private_key: !secret my_private_key\n    public_key: !secret my_public_key\n```\n\n### on_packet Trigger\n\nTriggered when a packet is received:\n\n```yaml\non_packet:\n  then:\n    - lambda: |-\n        uint32_t from_addr = from;\n        uint32_t to_addr = to;\n        uint32_t port = portnum;\n        const std::vector\u003Cuint8_t>& payload = data;\n```\n\nAvailable variables:\n- `from`: Source node ID (uint32)\n- `to`: Destination node ID (uint32)\n- `portnum`: Port number (uint32)\n- `data`: Payload data (vector\u003Cuint8>)\n\n### Actions\n\n#### `meshtastic.send_text_message`\n\nSend a text message to a channel or node:\n\n```yaml\n- meshtastic.send_text_message:\n    id: mesh_node\n    channel: \"LongFast\"  # Send to channel\n    text: \"Hello\"\n\n- meshtastic.send_text_message:\n    id: mesh_node\n    to: 848894052  # Send to specific node\n    text: \"Direct message\"\n```\n\n#### `meshtastic.send_packet`\n\nSend raw binary data:\n\n```yaml\n- meshtastic.send_packet:\n    id: mesh_node\n    data: [0x01, 0x02, 0x03]\n    hop_limit: 3\n```\n\n## Hardware Compatibility\n\n### Supported LoRa Radios\n\n- **SX1262** - LoRaWAN module (US, EU, JP frequencies)\n- **SX1268** - LoRaWAN module\n- **SX1276** - Legacy LoRa module\n- **SX1277** - Legacy LoRa module\n- **SX1278** - Legacy LoRa module\n- **SX1279** - Legacy LoRa module\n\n### Tested Boards\n\n- ESP32-C3-DevKitM-1 with SX1262\n- Generic ESP32 with SX1276\n\n### Pinout Example (ESP32-C3 + SX1262)\n\n```\nESP32-C3       SX1262\nGPIO10   ----> CLK\nGPIO7    ----> MOSI\nGPIO6    ----> MISO\nGPIO8    ----> CS\nGPIO3    ----> DIO1\nGPIO4    ----> BUSY\nGPIO5    ----> RESET\n```\n\n## Troubleshooting\n\n### Component Not Showing in ESPHome\n\n- Ensure you've added the external_components section correctly\n- Check the ESPHome logs for compilation errors\n- Verify your SX126x\u002FSX127x component is properly configured\n\n### Packets Not Being Received\n\n- Verify LoRa radio parameters match your mesh (frequency, SF, BW, etc.)\n- Check that PSKs match the channel configuration in your mesh\n- Ensure proper antenna connection and LoRa radio wiring\n- Check node_number and channel hash configuration\n\n### Cannot Send Messages\n\n- Verify the destination node exists in your mesh\n- Check hop_limit is not set to 0\n- Ensure the channel PSK matches the target network\n- Check ESP32 heap memory availability\n\n### Encryption\u002FDecryption Errors\n\n- Verify public\u002Fprivate keys are correctly configured\n- Ensure PKI is not disabled (`exclude_pki: false`)\n- Check that key format is correct (32-byte keys in base64)\n\n## Contributing\n\nContributions are welcome! To contribute:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature\u002Fyour-feature`)\n3. Commit your changes (`git commit -am 'Add feature'`)\n4. Push to the branch (`git push origin feature\u002Fyour-feature`)\n5. Open a Pull Request\n\n## Support & Resources\n\n- **Meshtastic Official Site**: https:\u002F\u002Fmeshtastic.org\u002F\n- **ESPHome Documentation**: https:\u002F\u002Fesphome.io\u002F\n- **GitHub Issues**: Report bugs or request features on [GitHub](https:\u002F\u002Fgithub.com\u002FAndrik45719\u002Fesphome-meshtastic\u002Fissues)\n- **Meshtastic Discord**: Join the community at https:\u002F\u002Fdiscord.gg\u002Fg9Hgv9KX (Meshtastic community)\n\n## Maintainer\n\n**Andrik45719** - [@Andrik45719](https:\u002F\u002Fgithub.com\u002FAndrik45719)\n\n## Acknowledgments\n\n- [Meshtastic Project](https:\u002F\u002Fgithub.com\u002Fmeshtastic\u002Ffirmware) for the mesh networking protocol\n- [ESPHome Project](https:\u002F\u002Fgithub.com\u002Fesphome\u002Fesphome) for the framework\n- [NanoPB](https:\u002F\u002Fgithub.com\u002Fnanopb\u002Fnanopb) for Protocol Buffer support\n","该项目是一个用于ESPHome的Meshtastic组件，能够将兼容Meshtastic的LoRa设备与ESPHome集成，从而创建具有文本消息、数据包路由和网格协调功能的物联网设备。其核心功能包括支持SX126x和SX127x LoRa无线电的长距离网状通信、自动数据包路由以扩展网络覆盖范围、通过网格网络发送接收文本消息以及可选的LoRa网状网络与UDP网络之间的桥接模式等。此外，它还提供了位置广播、多通道支持及基于公钥基础设施的安全通信能力。适用于需要构建低功耗广域网（LPWAN）解决方案的场景，如远距离监控系统或分布式传感器网络，在保证通信安全的同时实现高效的数据传输。","2026-06-11 04:01:13","CREATED_QUERY"]