No description
Find a file
2025-04-08 14:39:24 +12:00
examples add example to send message to contact 2025-04-08 14:39:24 +12:00
src add method to sync device time 2025-04-08 14:38:38 +12:00
.gitignore add node_modules to .gitignore 2025-03-03 09:46:24 +13:00
.npmignore add .idea to .npmignore 2025-02-13 13:32:49 +13:00
index.html refactor ble connection to web ble connection 2025-04-08 13:54:25 +12:00
LICENSE Create LICENSE 2025-02-12 23:09:24 +13:00
package-lock.json 1.4.2 2025-04-08 14:12:31 +12:00
package.json 1.4.2 2025-04-08 14:12:31 +12:00
README.md refactor ble connection to web ble connection 2025-04-08 13:54:25 +12:00

MeshCore.js

A Javascript library for interacting with a MeshCore device running the Companion Radio Firmware.

This library can be used in a Web Browser to connect to MeshCore Companion devices over BLE or USB Serial.

It can also be used in NodeJS to connect to MeshCore Companion devices over TCP/WiFi or USB Serial.

Supported Connection Methods

Install

npm install @liamcottle/meshcore.js

Simple Example

import { TCPConnection } from "@liamcottle/meshcore.js";

// create tcp connection
// tcp connections are supported by "Heltec_v3_companion_radio_wifi"
const connection = new TCPConnection("10.1.0.226", 5000);

// wait until connected
connection.on("connected", async () => {

    // we are now connected
    console.log("connected!");

    // log contacts
    const contacts = await connection.getContacts();
    for(const contact of contacts) {
        console.log(`Contact: ${contact.advName}`);
    }

    // disconnect
    connection.close();

});

// connect to meshcore device
await connection.connect();

Examples

There's a few other examples scripts in the examples folder.

License

MIT