Meshtastic

Device cannot read data from TTGO via BLE

Hey all,
time to make the cross-platform app talk to a TTGO.

Polling characteristics 2A27 and 2A29 on nrfconnect I get frequency and board name data while on the app, running on the device, I get empty replies. Any idea why?

this.ble.read(peripheral.id, 'CB0B9A0B-A84C-4C0D-BDBB-442E3144EE30', '2A27').then((res) => console.log('2A27', res));
this.ble.read(peripheral.id, 'CB0B9A0B-A84C-4C0D-BDBB-442E3144EE30', '2A29')
this.ble.read(peripheral.id, '180A', '2A27')
this.ble.read(peripheral.id, '180A', '2A29')
1 Like

hmm - 2a27 is not a characteristic offered by our service. So at least wrt this call, I think you are trying to read from the wrong characteristic.

Our service only offers the following three characteristics:
FromNum
ToRadio
FromRadio
(documented here)

So for this call you would want something like this.ble.read(peripheral.id, 'CB0B9A0B-A84C-4C0D-BDBB-442E3144EE30', 'ed9da18c-a800-4f66-a670-aa7547e34453') (not 2a27) if you wanted to read ‘FromNum’ - you should get back a four byte integer (in little endian order).

In nrfconnect I read 2A27 and 2A29 and get back respectively “TTGO v2 lora32” and “EU433”

yes, that will work when you are reading from 0x180a (the device info service) - though as we’ve been discussing the ionic lib might have ‘issues’ :sweat_smile:. But in your first two lines you are trying to read from our meshapi service, and that service only implements the three characteristics I just listed.

I assume you are doing these reads after you asked ionic to do service discovery? If not, that would explain things.

ok problem solved, I can read values v0.7.11 and 1.0-EU433.

This code should work, unfortunately my TTGO serial port doesn’t work so I can’t see the results. Is there a way to show it on the display?

 var data = new Uint8Array(1);
    data[0] = 0x55;
    this.ble.write(peripheral.id, this.service_uuid, this.TORADIO_UUID, data.buffer).then((res) => console.log(res));
1 Like

What baud rate are you using? It needs to be 921600.

it’s correctly set up but it’s messed up

���1?�8�������&�������

But the firmware install via esptool worked? What does it say when you run “meshtastic --debug --info” (the python tool).

It works and even pairs with another TTGO. The ??km is quite ugly we may need to fix it if no GPS is detected.
Anyway, now it’s time to work on sending and receiving messages.

Can you paste the output of the meshtastic command here?

That’s all I get

E (449) spiram: SPI RAM enabled but initialization failed. Bailing out.
[15:22:42][D][esp32-hal-psram.c:47] psramInit(): PSRAM enabled

Hmm that looks like you might be running 0.8.01 which was not a good release for anything that is not a tbeam. What board are you running?

TTGO v1.6

It’s what came out of the compilation from source code. Before I was using the precompiled v0.9.1 firmware

Ok. It sure sounds like your build is linking against an old version of the arduino-esp32 prebuilt bins. The easiest way to make sure that’s not the problem is to “rm -rf .pio ~/.platformio/packages” in your buildir - to blow away the platformio caches. I bet then your build will be happy.

Because if the software install works (which uses the 921600 baud rate also), the serial port hardware is fine.

(Or just program the release build of 0.9.1 and see how it goes)