Meshtastic

Interested in making a flutter-based third party app - documentation?

How would I interface with the meshtastic app to make an app that uses the meshtastic network? I understand it from the computer side: the python API seems really cool and straightforward to use. However, I don’t see a page dedicated to making android apps.

My use case is that I have a few friends who would also be interested in doing a mesh network with me. We share a discord together (that I’ve paired with a matrix server) and I think I’d like to make an app dedicated to our group. It’d be written in flutter and open source cause I have a lot of experience with it.

Things I plan for it to do is ask the gateway node to emit the most recently sent messages in the discord (via a matrix bot), and send texts to the discord. I’d like to someday get rid of the bot and just run low-bitrate matrix over it, but I’d like to wait for when P2P support on it matures.

What would really help me is to know what mechanism I can use to talk to the Meshtastic app on the smartphone to send and receive packets/messages for my own purposes. Then maybe I can make it a flutter plugin for wider use

3 Likes

Hi!

It is great you mention flutter because I was recently chatting with @jeksys about how it might be a good platform so we could have an iOS app. I also figured I might look into it in a few weeks as a tool to learn Flutter. Here’s the pitiful state of my notes on the idea (two days ago):

However since you know Flutter you would be the ideal geek to make a Flutter client. Which would be great because it would also provide us an iOS client (which Jeksys was interested in working on).

Here’s the documentation on the BLE (USB/serial is almost identical) protocol used between the phone/computer and the device:

But as you are writing this (if you decide to do this you would be a hero for humankind :smile: ) the easiest codebase to refer to is the the python client:

https://github.com/meshtastic/Meshtastic-python/blob/master/meshtastic/init.py

Because it is super minimal. I’m also happy to help if you have any questions. I can not overstate how cool I think this would be.

I would recommend proceeding in stages:

  • Can connect to the device and receive the nodeDB
  • Can send text (or data) messages to the mesh
  • Can receive text (or data) message from the mesh (by subscribing for BLE notifies on “FromNum”, and when those notifies arrive keep reading FromRadio packets from “FromRadio” until you get an empty packet"
  • At that point you have a working Flutter (and iOS/alternate Android) client
  • Then add parsing of Position messages to update some sort of map view
  • At that point you have a similar feature set to the Android app.
2 Likes

Yes please! We are waiting for iOS client with friends. Our Ali baskets are full of TTGO T-Beams :smiley:

2 Likes

Hi thanks so much! My skill in dart/flutter isn’t great but I’d enjoy taking this on as a learning project. I ordered two T-Beams a few days ago but it isn’t due to arrive until mid-July.

For now I see what I can do making the other parts of the app, and maybe I could try going through the stages and putting them out for people to test to make sure what I’m writing is valid. I haven’t ever done bluetooth stuff before, but I have worked with protobufs. It looks like I could start with using flutter_blue because it’s cross-platform. I’ll keep you guys apprised and I’ll throw whatever PoCs I write up on github

2 Likes

that sounds great! good luck!

I was suggesting to @geeksville to try Ionic, being a cross-platform web-based framework for app development that uses common technologies like AngularJs and React.

And @leer10 what do you think about Ionic? @anelito has experience with that and I’d be able to help. Do you guys want to have a brief ‘skype’ call to discuss this? Where are you in the world (approximately :smiley: ) so we could find a good time to chat?

1 Like

I admit not to be very experienced with Ionic, I have mainly developed basic apps. Here we will need to leverage the Capacitor module to add custom code for each platform or find a way to use native plugins.

I’m from Southern Europe

I’m in the US west coast. I never coded in JavaScript before so Ionic would be a challenge to write for.

Sadly I haven’t been able to get around to writing anything yet, but I plan tomorrow to write a proof-of-concept to at least read the NodeDB from a device and present it to the user. I’ll definitely have an Android APK build but I’ll also have the code open sourced so that someone with a mac can compile it for iOS to confirm iPhone compatibility.

I haven’t developed anything more than basic apps either, but I’m willing to give this a shot and collaborate.

1 Like

Being a relatively new self-contained framework using a custom programming language (Dart), we should see if within the community there are other developers experienced with Flutter to support you.
The good thing about Ionic is its use of web languages (HTML, CSS and JS) that many of us are confident with.

Looking forward to seeing the iOS app.

1 Like

OMG that sounds amazing (and quick!). As soon as you have anything (even super rough) up on github I’d love to try it out. Also @jeksys I bet would be willing to take that code and build it for iOS? I suspect we could fairly quickly grow your app so it becomes quite a nice cross platform (Android + iOS) client.

ionic is better more community nd easier for developers

Though I’m in favor of whoever starts coding pick what they want to use. :slightly_smiling_face:. I’ll learn it and help their app.

Hi leer10,
I can provide MacBook pro with iPhone attached via TeamViewer (or anything else) every day 08:00 - 16:00 (UTC +1)

1 Like

It’s not about that, going straight to coding in this case can do more harm than good. We should consider how many within the community can help with app development (not testing) and whether we have the expertise to bring it to a functional state without requiring external input.

1 Like

I am very interested to switch to another app development to support iOS.

I see the tons of commits from @geeksville to fix the bluetooth issues to support phone with Android 5 to Android 10. I can test with Android 6 and Android 10, my fear is to not be able to help fixing issues happening for iOS phones.

It gaves us an opportunity to keep the things simple and find a way to give the devs a better feedback system for bug fixing.

1 Like

Agree. And such feedback is useful. But fundamentally if someone says they are willing to start coding a new app and they want to use technology A vs approximately equivalent technology B:

(Personally) I’m going to help them in either case. Because it is rare for people to step up at that level and it gives me an excuse to learn something new.

And by popularity it seems like flutter is doing quite well (higher than ionic and going up - and ionic seems trending the opposite direction)

https://trends.google.com/trends/explore?q=%2Fg%2F11f03_rzbg,%2Fg%2F1q6l_n0n0

Interesting. I assumed React native would be higher but going off of Google trends it looks like its somewhere in the middle.

1 Like

Actually flutter is backed by Google :wink:

Anyway whatever technology works, it’s fine as long as it solves the problem of having a multi-platform app.
From my personal side I can develop the skeleton in Ionic but the implementation of Bluetooth and mesh protocols is something I’ve never done.

1 Like

Hey sorry guys I haven’t said anything since then. I haven’t been able to get started yet but I was getting back in the hang of Flutter last night by finishing a feature I had long forgotten about. Just to temper expectations: for now I’m just wanting to make an app that does the first stage to show in theory that it will work. It isn’t gonna be written to handle the usecases of the Meshtastic app, at least not for now.

The biggest challenge is that I’m gonna be writing this blind and working just off the protocol, python implementation, and API notes that geeksville has thankfully written. I can’t guarantee when I’ll be done, but I’ll keep you all posted.

Edit: I’ve started writing the app. Right now it doesn’t do much: just searches for BLE devices and highlights those that match Meshtastic’s service ID.

I won’t bother putting out test APKs until I get some Meshtastic-specific functionality implemented.