Python API setup issues

Making some progress… Messages are sometimes sent via the meshtastic executable but basit pythin has some issues:

pi@pi-nas:~/meshtastic $ python3 experiment.py 
ERROR:root:Node not found for fromId
ERROR:root:Error handling FromRadio, possibly corrupted? 40
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/meshtastic/__init__.py", line 404, in __reader
    self._handleFromRadio(self._rxBuf[HEADER_LEN:])
  File "/home/pi/.local/lib/python3.7/site-packages/meshtastic/__init__.py", line 194, in _handleFromRadio
    self._handlePacketFromRadio(fromRadio.packet)
  File "/home/pi/.local/lib/python3.7/site-packages/meshtastic/__init__.py", line 252, in _handlePacketFromRadio
    self._nodesByNum[asDict["from"]]["position"] = p
KeyError: 40
ERROR:root:Node not found for fromId
ERROR:root:Node not found for fromId
ERROR:root:Error handling FromRadio, possibly corrupted? 40

Python code:

import meshtastic
import time

import meshtastic
interface = meshtastic.StreamInterface() # By default will try to find a meshtastic device, otherwise provide a device path like /dev/ttyUSB0
interface.sendText("hello mesh") # or sendData to send binary data, see documentations for other options.

for i in range(20):
        interface.sendText("hello mesh "+str(i)) # or sendData to send binary data, see documentations for other options.
        time.sleep(30)