James-P-D/MeshSpeech

text to speech

Opened this issue · 1 comments

I installed Meshspeech on windows 10 with python 3.11.9. Everything is update.

Resolve address and speech to text worked great but text to speech, I have this error when I received a message.

C:\MeshSpeech>python main.py
ERROR:root:Unexpected error in deferred execution <class 'IndexError'>
Traceback (most recent call last):
File "C:\Users\Max\AppData\Local\Programs\Python\Python311\Lib\site-packages\meshtastic\util.py", line 243, in _run
o()
File "C:\Users\Max\AppData\Local\Programs\Python\Python311\Lib\site-packages\meshtastic\mesh_interface.py", line 1040, in
lambda: pub.sendMessage(topic, packet=asDict, interface=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Max\AppData\Local\Programs\Python\Python311\Lib\site-packages\pubsub\core\publisher.py", line 216, in sendMessage
topicObj.publish(**msgData)
File "C:\Users\Max\AppData\Local\Programs\Python\Python311\Lib\site-packages\pubsub\core\topicobj.py", line 452, in publish
self.__sendMessage(msgData, topicObj, msgDataSubset)
File "C:\Users\Max\AppData\Local\Programs\Python\Python311\Lib\site-packages\pubsub\core\topicobj.py", line 482, in __sendMessage
listener(data, self, allData)
File "C:\Users\Max\AppData\Local\Programs\Python\Python311\Lib\site-packages\pubsub\core\listener.py", line 237, in call
cb(**kwargs)
File "C:\MeshSpeech\main.py", line 77, in onReceive
f"{sender_node['user']['shortName'][2]} "
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: string index out of range

Ok, i found what is the error. If a meshtastic short name was shorter than 4 chararcters, the error happen.