Python3 cli app to bridge SMS/MMS to matrix/riot.im
#10
(01-31-2021, 01:57 PM)pacman99 Wrote:
(01-19-2021, 10:16 AM)FutureBucket Wrote: Hey, I saw that. I'm excited to see what you come up with!  If you need help or anything, let me know!

I actually took your idea of contacts and implemented it in mine Smile  

What you see on my gitlab account is all the programming I've done in my life (so be kind. haha). I'm sure there's lots of better ways to write some of the code I have there too but it works. I've been running my script on a nexus5/Ubuntu Touch for almost 2 years and had next to no problems. It's nice to leave it at home and get a data simcard out of country and still be able to text friends and family.

Ohh awesome! I'm glad some of my code was useful. Yeah my contacts code isn't amazing, but it works. And don't worry I'm not that great either, your code is pretty well written, probably better than some of my additions anyway.

I actually ran into this one issue with the script and I wonder if you have experienced it. I use systemd to manage it and whenever the phone resumes from suspend the matrix sync thread just hangs. Its really weird there are no log messages or anything but the sync thread just stops logging new syncs. So I can't send the bridge messages anymore. I think I've narrowed it down to the thread fails at any point when theres no wifi. But every network connection is under a try except block, so I'm not sure whats wrong.

I'm sorry, I've never experienced the problem you're having. My use case is different. My script is running on a Nexus5 with Ubuntu Touch that I NEVER touch. It's plugged in 24/7 and stays at home. I use a second device (android) that has the elements app I use for texting. Also, I have a cron job that restarts UT every night around 3AM because UbuntuTouch, at least on the Nexus5, doesn't close their file connections to the MMSes. If you leave it on for weeks I'll have thousands of open file handles to deleted files.

On the other hand, I'm almost 100% sure that I don't handle the threads correctly. I don't think any errors or anything will show if one of the threads die, it just stop and not say anything, which sounds like what you're experiencing.  I would have a look at how I start the treads and maybe try and restart them if they fail? or figure out how to catch a failure?? I don't know how to do this.

I am working on something else that has threads too so maybe I'll read about it and see if I can figure it out.


Quick edit: actually, I think I know what your problem is. Did you apply this patch to matrix-python-sdk?

https://github.com/matrix-org/matrix-pyt...d53ed0a62f

You can test this, make sure the script is running, disable wifi AND cell data. wait a couple minutes then enable data again. if the matrix sync doesn't work its because the sdk just wait forever for the original sync to complete. That patch will kill the failed connection after X seconds and start a new one.
  Reply


Messages In This Thread
RE: Python3 cli app to bridge SMS/MMS to matrix/riot.im - by FutureBucket - 02-01-2021, 09:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Python3 - GPIO - controlling LED's etc bonce 1 2,203 06-06-2021, 09:43 AM
Last Post: bonce
  Python3 Bridge SMS/MMS to Matrix using Modem Manager and MMSD FutureBucket 3 4,116 02-10-2021, 08:09 PM
Last Post: kop316
  AV call with Matrix Dmytro 0 2,057 07-30-2020, 03:23 AM
Last Post: Dmytro
  Riot Web support Dmytro 1 2,192 06-20-2020, 01:42 PM
Last Post: Dmytro

Forum Jump:


Users browsing this thread: 1 Guest(s)