Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

COM320 Voice Modem


IslandMan Apr 22, 2013 10:15 AM

I have a client who is using the COM320 to call out lake level alarms. He now wants to be able to set a new alarm level over the phone. I was just wondering if anyone had some code examples of this.
Thanks,
Dave


DumbleJum Sep 18, 2024 07:02 AM

To set a new alarm level over the phone using the COM320, you can typically implement a system that listens for DTMF tones (the tones generated when pressing keys on a phone) and then processes those inputs to set the alarm level. Below is a basic example of how you might structure the code:

 

import serial

# Initialize serial communication with the COM320
ser = serial.Serial('COM_PORT', baudrate=9600, timeout=1)

def set_alarm_level(new_level):
    command = f'SET_ALARM_LEVEL {new_level}\n'
    ser.write(command.encode())

def listen_for_dtmf():
    while True:
        if ser.in_waiting > 0:
            dtmf_input = ser.read(1)  # Read one byte (DTMF tone)
            process_input(dtmf_input)

def process_input(dtmf_input):
    try:
        level = int(dtmf_input.decode())
        if 0 <= level <= 100:  # Assuming alarm levels are between 0 and 100
            set_alarm_level(level)
            print(f'Alarm level set to: {level}')
        else:
            print('Invalid level. Please enter a number between 0 and 100.')
    except ValueError:
        print('Invalid input. Please enter a numeric value.')

if __name__ == "__main__":
    listen_for_dtmf()Fnaf

 


Liza25 Jan 23, 2025 05:37 AM

It sounds like a great project! To set a new alarm level over the phone with the COM320, you’ll likely need to utilize the device's remote configuration capabilities, which should be accessible via a specific protocol or API. While I don’t have specific code examples on hand, I recommend checking the COM320 documentation for remote configuration commands or network control features that would allow you to modify settings like alarm thresholds remotely.

import serial

# Initialize serial communication with the COM320
ser = serial.Serial('COM_PORT', baudrate=9600, timeout=1)

def set_alarm_level(new_level):
    command = f'SET_ALARM_LEVEL {new_level}\n'
    ser.write(command.encode())

def listen_for_dtmf():
    while True:
        if ser.in_waiting > 0:
            dtmf_input = ser.read(1)  # Read one byte (DTMF tone)
            process_input(dtmf_input)

def process_input(dtmf_input):
    try:
        level = int(dtmf_input.decode())
        if 0 <= level <= 100:  # Assuming alarm levels are between 0 and 100
            set_alarm_level(level)
            print(f'Alarm level set to: {level}')
        else:
            print('Invalid level. Please enter a number between 0 and 100.')
    except ValueError:
        print('Invalid input. Please enter a numeric value.')

if __name__ == "__main__":
    listen_for_dtmf()

mikehalloween Nov 4, 2025 12:21 AM

This is a really helpful project, especially the Python code example! Using remote configuration capabilities to adjust alarm levels on the COM320 via DTMF tones is a clever approach. 

 

import serial

# Initialize serial communication with the COM320
ser = serial.Serial('COM_PORT', baudrate=9600, timeout=1)

def set_alarm_level(new_level):
    command = f'SET_ALARM_LEVEL {new_level}\n'
    ser.write(command.encode())

def listen_for_dtmf():
    while True:
        if ser.in_waiting > 0:
            dtmf_input = ser.read(1)  # Read one byte (DTMF tone)
            process_input(dtmf_input)

def process_input(dtmf_input):
    try:
        level = int(dtmf_input.decode())
        if 0 <= level <= 100:  # Assuming alarm levels are between 0 and 100
            set_alarm_level(level)
            print(f'Alarm level set to: {level}')
        else:
            print('Invalid level. Please enter a number between 0 and 100.')
    except ValueError:
        print('Invalid input. Please enter a numeric value.')

if __name__ == "__main__":
    listen_for_dtmf()
[url=https://aiimage.org]AI Image[/url]

 


hoangcho Dec 14, 2025 05:47 AM

I'm just testing to see if it works effectively. Hopefully everything is as good as you say, and I'll be back here soon to update you on the actual results.

import serial

# Initialize serial communication with the COM320
ser = serial.Serial('COM_PORT', baudrate=9600, timeout=1)

def set_alarm_level(new_level):
    command = f'SET_ALARM_LEVEL {new_level}\n'
    ser.write(command.encode())

def listen_for_dtmf():
    while True:
        if ser.in_waiting > 0:
            dtmf_input = ser.read(1)  # Read one byte (DTMF tone)
            process_input(dtmf_input)

def process_input(dtmf_input):
    try:
        level = int(dtmf_input.decode())
        if 0 <= level <= 100:  # Assuming alarm levels are between 0 and 100
            set_alarm_level(level)
            print(f'Alarm level set to: {level}')
        else:
            print('Invalid level. Please enter a number between 0 and 100.')
    except ValueError:
        print('Invalid input. Please enter a numeric value.')

if __name__ == "__main__":
    listen_for_dtmf()fnaf
Log in or register to post/reply in the forum.