LLM welcome messages are sent to the wrong channel when antispam is disabled #113

Closed
opened 2026-10-05 01:23:19 +02:00 by adam · 10 comments
Owner

I run antispam = False and respond_by_dm_only = False. The way this evaluates causes the welcome message and query time message to be sent to channel 0 (undef?) instead of the DM the request originated from. I think the conditional might have to be reworked slightly to handle the DM origin.

https://github.com/SpudGunMan/meshing-around/blob/1f85fe784200d9e23776da77116ecd7ca7d2cb0e/mesh_bot.py#L661-L666
https://github.com/SpudGunMan/meshing-around/blob/1f85fe784200d9e23776da77116ecd7ca7d2cb0e/mesh_bot.py#L694

2025-11-07 10:42:53,625 |     INFO | Device:1 Channel:0 SendingChannel: MeshBot, here for you like a friend who is not. Try sending: ping @foo or, cmd
2025-11-07 10:42:56,427 |     INFO | Device:1 Channel:0 SendingChannel: Please wait, response could take 30+ seconds. Fund the SysOp's GPU budget!
2025-11-07 10:42:59,228 |    DEBUG | System: LLM Query: Using Ollama API for LLM query LLM test From:1645723615
2025-11-07 10:43:41,331 |  WARNING | System: LLM Query: Response exceeded 450 characters, requesting truncation
2025-11-07 10:43:57,140 |    DEBUG | System: Splitting #chunks: 2, Total length: 190
2025-11-07 10:43:57,141 |     INFO | Device:1 Chunker1/2 Sending DM: Okay, I'm ready to be your LLM test! I'll be looking for potential issues, challenges, and areas for improvement in your prompts and responses. Please provide To: Sense Card
2025-11-07 10:44:00,043 |     INFO | Device:1 Chunker2/2 Sending DM: as much information as possible. To: Sense Card
2025-11-07 10:44:02,945 |    DEBUG | System: LLM: Found 1645723615 in location table
2025-11-07 10:44:02,946 |     INFO | Device:1 Channel:0 SendingChannel: Average query time is: 57 seconds
I run antispam = False and respond_by_dm_only = False. The way this evaluates causes the welcome message and query time message to be sent to channel 0 (undef?) instead of the DM the request originated from. I think the conditional might have to be reworked slightly to handle the DM origin. https://github.com/SpudGunMan/meshing-around/blob/1f85fe784200d9e23776da77116ecd7ca7d2cb0e/mesh_bot.py#L661-L666 https://github.com/SpudGunMan/meshing-around/blob/1f85fe784200d9e23776da77116ecd7ca7d2cb0e/mesh_bot.py#L694 ``` 2025-11-07 10:42:53,625 | INFO | Device:1 Channel:0 SendingChannel: MeshBot, here for you like a friend who is not. Try sending: ping @foo or, cmd 2025-11-07 10:42:56,427 | INFO | Device:1 Channel:0 SendingChannel: Please wait, response could take 30+ seconds. Fund the SysOp's GPU budget! 2025-11-07 10:42:59,228 | DEBUG | System: LLM Query: Using Ollama API for LLM query LLM test From:1645723615 2025-11-07 10:43:41,331 | WARNING | System: LLM Query: Response exceeded 450 characters, requesting truncation 2025-11-07 10:43:57,140 | DEBUG | System: Splitting #chunks: 2, Total length: 190 2025-11-07 10:43:57,141 | INFO | Device:1 Chunker1/2 Sending DM: Okay, I'm ready to be your LLM test! I'll be looking for potential issues, challenges, and areas for improvement in your prompts and responses. Please provide To: Sense Card 2025-11-07 10:44:00,043 | INFO | Device:1 Chunker2/2 Sending DM: as much information as possible. To: Sense Card 2025-11-07 10:44:02,945 | DEBUG | System: LLM: Found 1645723615 in location table 2025-11-07 10:44:02,946 | INFO | Device:1 Channel:0 SendingChannel: Average query time is: 57 seconds ``` <!-- github-sync-id:3600939689 -->
adam closed this issue 2026-10-05 01:23:19 +02:00
Author
Owner

can you describe the setup? I cant seem to replicate - are you using UDP? https://github.com/SpudGunMan/meshing-around/issues/196

can you describe the setup? I cant seem to replicate - are you using UDP? https://github.com/SpudGunMan/meshing-around/issues/196 <!-- github-comment-id:3505727089 -->
Author
Owner

Yup, looks like that is it.

After adding some debug logging:

        if not any(node['nodeID'] == message_from_id and node['welcome'] == True for node in seenNodes):
            logger.debug(f"channel number: {channel_number}")
            logger.debug(f"message_from_id: {message_from_id}")
            logger.debug(f"deviceID: {deviceID}")
            logger.debug(f"public channel: {publicChannel}")
            logger.debug(f"antispam: {my_settings.antiSpam}")
            logger.debug(f"useDM: {my_settings.useDMForResponse}")
            if (channel_number == publicChannel and my_settings.antiSpam) or my_settings.useDMForResponse:
                # send via DM
                logger.debug("sending via DM")
                send_message(my_settings.welcome_message, channel_number, message_from_id, deviceID)
            else:

I can see it has the channel set to 0:

2025-11-08 07:41:35,539 |    DEBUG | channel number: 0
2025-11-08 07:41:35,540 |    DEBUG | message_from_id: 1625743651
2025-11-08 07:41:35,541 |    DEBUG | deviceID: 1
2025-11-08 07:41:35,541 |    DEBUG | public channel: 0
2025-11-08 07:41:35,541 |    DEBUG | antispam: False
2025-11-08 07:41:35,541 |    DEBUG | useDM: False
2025-11-08 07:41:35,541 |    DEBUG | sending via channel

I thought this was a simpler issue 😄

Yup, looks like that is it. After adding some debug logging: ``` if not any(node['nodeID'] == message_from_id and node['welcome'] == True for node in seenNodes): logger.debug(f"channel number: {channel_number}") logger.debug(f"message_from_id: {message_from_id}") logger.debug(f"deviceID: {deviceID}") logger.debug(f"public channel: {publicChannel}") logger.debug(f"antispam: {my_settings.antiSpam}") logger.debug(f"useDM: {my_settings.useDMForResponse}") if (channel_number == publicChannel and my_settings.antiSpam) or my_settings.useDMForResponse: # send via DM logger.debug("sending via DM") send_message(my_settings.welcome_message, channel_number, message_from_id, deviceID) else: ``` I can see it has the channel set to 0: ``` 2025-11-08 07:41:35,539 | DEBUG | channel number: 0 2025-11-08 07:41:35,540 | DEBUG | message_from_id: 1625743651 2025-11-08 07:41:35,541 | DEBUG | deviceID: 1 2025-11-08 07:41:35,541 | DEBUG | public channel: 0 2025-11-08 07:41:35,541 | DEBUG | antispam: False 2025-11-08 07:41:35,541 | DEBUG | useDM: False 2025-11-08 07:41:35,541 | DEBUG | sending via channel ``` I thought this was a simpler issue 😄 <!-- github-comment-id:3506545142 -->
Author
Owner

Regarding the setup, I'm using a WisMesh Ethernet MQTT Gateway with PoE, connected via tcp. I was actually quite surprised you could connect over to the network as I heard on multiple sources that it was a limited driver for MQTT only. Perhaps the functionality was added down the road. It works great for me though, a single ethernet run in the attic to the device for power, mqtt, and meshbot running on a server (literally anywhere, not in the hot attic especially) with no need for a USB cable or bluetooth.

Regarding the setup, I'm using a WisMesh Ethernet MQTT Gateway with PoE, connected via tcp. I was actually quite surprised you could connect over to the network as I heard on multiple sources that it was a limited driver for MQTT only. Perhaps the functionality was added down the road. It works great for me though, a single ethernet run in the attic to the device for power, mqtt, and meshbot running on a server (literally anywhere, not in the hot attic especially) with no need for a USB cable or bluetooth. <!-- github-comment-id:3506547868 -->
Author
Owner

ok so to recap you do think this was induced by the UDP/MQTT issue?

( I have a fix coming down the line with hot hot off the press API functions but I gotta work it in still have some bones to fix this just not running engine yet)

ok so to recap you do think this was induced by the UDP/MQTT issue? ( I have a fix coming down the line with hot hot off the press API functions but I gotta work it in still have some bones to fix this just not running engine yet) <!-- github-comment-id:3506819762 -->
Author
Owner

I did toss a patch in which might be related in LLM and welcome by changing the values you showed here, lmk either way

I did toss a patch in which might be related in LLM and welcome by changing the values you showed here, lmk either way <!-- github-comment-id:3508876129 -->
Author
Owner

I had a second to pull down the latest, but no change in behavior.

The reason it's going to the channel instead of the DM is obvious to me given the conditional:

if (channel_number == publicChannel [true] and my_settings.antiSpam [false]) or my_settings.useDMForResponse [false]:

So in the other issue you linked they said:

all inbound messages are being seen as "Channel:0":

Which according to my debug output, it's recording the DM as channel 0. So that was my takeaway, but if that is incorrect then I'm not sure. I'll have some more time later this week to poke at it some more.

I had a second to pull down the latest, but no change in behavior. The reason it's going to the channel instead of the DM is obvious to me given the conditional: > if (channel_number == publicChannel [**true**] and my_settings.antiSpam [**false**]) or my_settings.useDMForResponse [**false**]: So in the other issue you linked they said: > all inbound messages are being seen as "Channel:0": Which according to my debug output, it's recording the DM as channel 0. So that was my takeaway, but if that is incorrect then I'm not sure. I'll have some more time later this week to poke at it some more. <!-- github-comment-id:3513285905 -->
Author
Owner

I'm not sure I understand the issue now you forced it into a channel and got it?

If you don't care about spam or public rather than change python set the public channel to like 9 which isn't a thing

I'm not sure I understand the issue now you forced it into a channel and got it? If you don't care about spam or public rather than change python set the public channel to like 9 which isn't a thing <!-- github-comment-id:3523158218 -->
Author
Owner

There was also a .14 firmware update for legacy DM fix I'm going to close this for patches on firmware and patches here

There was also a .14 firmware update for legacy DM fix I'm going to close this for patches on firmware and patches here <!-- github-comment-id:3525987374 -->
Author
Owner

That's fine, thanks! I just patched out the messages since they don't provide any useful information anyway.

That's fine, thanks! I just patched out the messages since they don't provide any useful information anyway. <!-- github-comment-id:3527498369 -->
Author
Owner

Interesting, what's the use case - would it be worth an option.ini?

Interesting, what's the use case - would it be worth an option.ini? <!-- github-comment-id:3529580250 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/meshing-around#113