Hi everyone. I’ve come across the news of the v2.0 launch - congrats to the team
I decided to upgrade my two tbeams to firmwareVersion “2.0.0.d5e2b70b-d” and wrote the following code to see if have had progress on the multi channel capabilities for the system.
I seem to be able to create new channels, set their psk values, etc. But when I try to message on any other channel than 0 I get no traffic except for this cryptic message
Received: {‘from’: 3304581912, ‘to’: 3304581912, ‘channel’: 1, ‘decoded’: {‘portnum’: ‘ROUTING_APP’, ‘payload’: b’\x18\x04’, ‘requestId’: 1115327080, ‘routing’: {‘errorReason’: ‘NO_INTERFACE’, ‘raw’: error_reason: NO_INTERFACE
}}, ‘id’: 1576636852, ‘priority’: ‘ACK’, ‘raw’: from: 3304581912
to: 3304581912
channel: 1
decoded {
portnum: ROUTING_APP
payload: “\030\004”
request_id: 1115327080
}
id: 1576636852
priority: ACK
, ‘fromId’: ‘!c4f7eb18’, ‘toId’: ‘!c4f7eb18’}
I could not find much info on this so I was wondering if someone could maybe give me a little hand and point me to the right direction? Here’s the code I’ve used to send / receive messages
import meshtastic
import meshtastic.serial_interface
import time
import datetimefrom meshtastic import portnums_pb2, channel_pb2, config_pb2
from pubsub import pub
def onReceive(packet, interface): # called when a packet arrives
print(f"Received: {packet}")def onConnection(interface, topic=pub.AUTO_TOPIC): # called when we (re)connect to the radio
# defaults to broadcast, specify a destination ID if you wish
#interface.sendText(“Acordei!”)# set preset if interface.localNode.localConfig.lora.modem_preset != config_pb2.Config.LoRaConfig.ModemPreset.LONG_FAST: interface.localNode.localConfig.lora.modem_preset = config_pb2.Config.LoRaConfig.ModemPreset.LONG_FAST interface.localNode.writeConfig('lora') ch0_settings = interface.localNode.channels[0].settings if ch0_settings.name != "channelzero": ch0_settings.psk = b'' ch0_settings.name = "channelzero" interface.localNode.writeChannel(0) print("changed settings ch0!!") ch1_settings = interface.localNode.channels[1].settings if ch1_settings.name != "channel1": ch1_settings.psk = b'' #meshtastic.util.fromPSK("random") ch1_settings.name = "channel1" ch1_settings.downlink_enabled = True ch1_settings.uplink_enabled = True ch1_settings.channel_num = 0 interface.localNode.writeChannel(1) print("changed settings ch1!!")
def onNode(node):
print(f"Node changed: {node}")pub.subscribe(onReceive, “meshtastic.receive”)
pub.subscribe(onConnection, “meshtastic.connection.established”)
pub.subscribe(onNode, “meshtastic.node”)interface = meshtastic.serial_interface.SerialInterface(“/dev/ttyUSB0”) # By default will try to find a meshtastic device, otherwise provide a device path like /dev/ttyUSB0
interface.showInfo()
time.sleep(1)
while True:
whattime = str(datetime.datetime.now())
print (whattime)interface.sendText(whattime, "^all", True, False, None, None, 1) time.sleep(10);