Need help at start: Text messages receiving at and sending from self written python program

Hello,

I hope, this category is correct. If not, please tell me or move this to the correct place.

I have written a python (version 3.15) program, that creates events, of which I would like to get informed, even if not close. (In further future I would like to be able to send answers and maybe interchange images or even do a kind of video-calls. Those are not that important for now, but one of the reasons, why I try Jami and not something less complex.)

My system is for now LinuxMint 22.1 “Xia”, but it all should run later on an RaspberryPi 4b+ (8GB, current Rasbian OS with GUI).

I already installed and run jamid (found it with d-feet as “cx.ring.Ring” at the dbus).
As far as I understand (and that may be not so far at all), jamid should know, whose messages it should receive or send. How do I give that information to jamid? If I understood it wrong: How does it work?

I downloaded jami-daemon-master as zip (I do not want to use git in this case, because I want to prevent accidentally damaging anything) and got jamictrl/controller.py to “run” (F5 in VisualStudio Code) without error (means all imports seem to work).

Thanks for all, who read all that and please excuse, if the text is hard to understand: English is not my native language, but I assume, it is the language with the absolute largest number of people reading and therefore potentially answering.

Best regards
Tonteria

In “cx.ring.Ring.ConfigurationManager” you can use “sendMessage”.

First parameter is “account id” then “conversationId”

For account id, you need first to create a new Jami account. Check with d-feet, you can check all methods available.

For conv_id you need a conversation first.

To do it, you can play with startConversation/addConversationMember

Or acceptConversationRequest/getConversationsRequests first

Then once you have a conversation with an account, you can use sendMessage

you can also use sendTextMessage which does’nt need a conversation…
I use that feature via a wrapper for d-bus: jami-cli/jami-dbus.py at main · jchdel/jami-cli · GitHub

(would rather not as it’s a pre-swarm/deprecated API) and not synced across devices.

I did an old wrapper (unmaintained for 5/6 years, but should still work for basic conv)

GitHub - AmarOk1412/jami-cli: Jami client for terminal · GitHub ; with the dbus wrapper GitHub - AmarOk1412/jami-rs: crate for communicating with jami-daemon through dbus · GitHub

Thanks a lot for your help!
I in fact got messages sent from a Python app to the Jami app at my mobile phone and receive text messages in python sent from the mobile phone. :smiley:
Thanks you so much!

(Next I’ll try to send a file/image from python to mobile phone, but that’s an other story :slight_smile:)