Hi everyone, I’ve been tinkering for a few weeks now and have not been able to get the Bluetooth API to successfully send a Protobuf packet.
The current situation is that for protobufs that are successfully sent to the meshtastic device (Heltec ESP32 LoRa V3), they don’t end up making it onto my mesh channels. The V3 unit just thinks it sent the message, but other nodes do not receive anything. When connecting via the Meshtastic app and using the chat functionality, this node works fine, so it seems to be something wrong with the Bluetooth API or my Protobufs.
Any help would be deeply appreciated!
Logs from meshtastic device when it thinks it is sending a message:
INFO | ??:??:?? 2789 To Radio onwrite
DEBUG | ??:??:?? 2789 PACKET FROM PHONE (id=0xc7c19d5e fr=0x00 to=0x00, WantAck=0, HopLim=0 Ch=0x1 Portnum=256)
DEBUG | ??:??:?? 2789 Add packet record (id=0xc7c19d5e fr=0x00 to=0x00, WantAck=0, HopLim=0 Ch=0x1 Portnum=256)
DEBUG | ??:??:?? 2789 Unset PSK for secondary channel Public. using primary key
DEBUG | ??:??:?? 2789 Using AES128 key!
DEBUG | ??:??:?? 2789 ESP32 crypt fr=433f1fa0, num=c7c19d5e, numBytes=7!
DEBUG | ??:??:?? 2789 enqueuing for send (id=0xc7c19d5e fr=0xa0 to=0x00, WantAck=0, HopLim=0 Ch=0x88 encrypted)
DEBUG | ??:??:?? 2789 txGood=9,rxGood=5,rxBad=0
INFO | ??:??:?? 2789 Telling client we have new packets 58
INFO | ??:??:?? 2789 BLE notify fromNum
DEBUG | ??:??:?? 2789 [RadioIf] Starting low level send (id=0xc7c19d5e fr=0xa0 to=0x00, WantAck=0, HopLim=0 Ch=0x88 encrypted priority=64)
DEBUG | ??:??:?? 2789 [RadioIf] (bw=250, sf=11, cr=4/5) packet symLen=8 ms, payloadSize=23, time 403 ms
DEBUG | ??:??:?? 2789 [RadioIf] AirTime - Packet transmitted : 403ms
INFO | ??:??:?? 2789 getFromRadio=STATE_SEND_PACKETS
DEBUG | ??:??:?? 2790 [RadioIf] Completed sending (id=0xc7c19d5e fr=0xa0 to=0x00, WantAck=0, HopLim=0 Ch=0x88 encrypted priority=64)
react-native object being used as input to be encoded as a protobuf:
const toRadioPayload = {
packet: {
channel: 1, // have tried with and without this, channel 1 is encrypted
decoded: {
portnum: 256, // have tried 1 as well.
payload: Buffer.from(“Hello”, ‘utf-8’)
},
//set the id as a uint32
id: Math.floor(Math.random() * 10000000000),
}
}