public:radio:radio_database:ic-m710
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| public:radio:radio_database:ic-m710 [29/05/23 17:21 BST] – john | public:radio:radio_database:ic-m710 [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | < | ||
| - | |||
| - | |||
| - | ====== IC-M710 ====== | ||
| - | |||
| - | |||
| - | |||
| - | ===== Repairs / Mods ===== | ||
| - | |||
| - | |||
| - | === 2023 : No Transmit Output Power. === | ||
| - | | ||
| - | |||
| - | * Receive functions normally | ||
| - | * trace to - pre-drive TX buffer amp transistor - Q1 Main PCB | ||
| - | * No Drive to PA from Main Board | ||
| - | * TX signal present at base of Q1 but no signal at collector | ||
| - | * Q1 2SC4673 sourced from eBay [[https:// | ||
| - | * 07/02/23 : Replaced Q1 and full transmit power restored. | ||
| - | |||
| - | {{: | ||
| - | |||
| - | {{: | ||
| - | |||
| - | {{: | ||
| - | ===== Remote Control ===== | ||
| - | |||
| - | Python module for [[https:// | ||
| - | |||
| - | Some functions aren't needed for receive only, and should be removed (ptt_on ptt_off etc.). This module originally came from another project (not " | ||
| - | |||
| - | |||
| - | ++++ m710.py code | | ||
| - | |||
| - | <file python m710.py> | ||
| - | ''' | ||
| - | Python NMEA Radio Functions module for Icom IC-M710 Marine HF SSB Transceiver | ||
| - | |||
| - | Copyright (C) 2015 John Pumford-Green | ||
| - | |||
| - | This program is free software: you can redistribute it and/or modify | ||
| - | it under the terms of the GNU General Public License as published by | ||
| - | the Free Software Foundation, either version 3 of the License, or | ||
| - | (at your option) any later version. | ||
| - | |||
| - | This program is distributed in the hope that it will be useful, | ||
| - | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| - | GNU General Public License for more details. | ||
| - | |||
| - | You should have received a copy of the GNU General Public License | ||
| - | along with this program. | ||
| - | ''' | ||
| - | |||
| - | # serial port for Icom IC-M710 Rig Control | ||
| - | |||
| - | import serial | ||
| - | import threading | ||
| - | import time | ||
| - | version = " | ||
| - | |||
| - | sport = '/ | ||
| - | sbaud = 4800 | ||
| - | |||
| - | #ser = serial.Serial(sport, | ||
| - | lock = threading.Lock() | ||
| - | |||
| - | # NMEA Codes | ||
| - | preamble = " | ||
| - | controller = " | ||
| - | radio = " | ||
| - | cr = " | ||
| - | lf = " | ||
| - | |||
| - | |||
| - | # Commands are sent as NMEA private sentences: | ||
| - | # | ||
| - | # $PICOA, | ||
| - | # | ||
| - | # where HH is the 2 digit ECC value below: | ||
| - | # | ||
| - | # The protocol document states that for messages FROM the controller TO the radio | ||
| - | # the ECC bytes are optional, and may be omitted. This appears to be false information, | ||
| - | # the ECC bytes seem to be necessary. | ||
| - | # | ||
| - | # The ECC checksum, is a two-digit hex value found by XORing the hex values of the characters | ||
| - | # between " | ||
| - | # | ||
| - | # The first part of the message is always: | ||
| - | # " | ||
| - | # we then XOR this with each character' | ||
| - | # and convert the result to a 2-digit hex value | ||
| - | # | ||
| - | |||
| - | class m710(object): | ||
| - | def __init__(self, | ||
| - | self.ser = serial.Serial(sport, | ||
| - | self.model = model | ||
| - | print " | ||
| - | |||
| - | |||
| - | def get_ecc(self, | ||
| - | ecc = 112 | ||
| - | for c in command: | ||
| - | ecc = ord(c) ^ ecc | ||
| - | hecc = ' | ||
| - | | ||
| - | return hecc | ||
| - | |||
| - | # we must force the radio into " | ||
| - | def remote_on(self): | ||
| - | command = " | ||
| - | ecc = self.get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | return | ||
| - | else: | ||
| - | return self.remote_on() | ||
| - | | ||
| - | | ||
| - | |||
| - | # we can leave the radio in " | ||
| - | # but we must close the " | ||
| - | # restored after Remote mode is closed. | ||
| - | def remote_off(self): | ||
| - | command = " | ||
| - | ecc = self.get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | # | ||
| - | return | ||
| - | else: | ||
| - | return self.remote_off() | ||
| - | | ||
| - | |||
| - | def ptt_on(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return | ||
| - | else: | ||
| - | return ptt_on() | ||
| - | |||
| - | def ptt_off(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return | ||
| - | else: | ||
| - | return ptt_off() | ||
| - | |||
| - | |||
| - | |||
| - | def get_freq(self): | ||
| - | fkhz = self.get_rxfreq() | ||
| - | #fkhz = " | ||
| - | return fkhz | ||
| - | |||
| - | def set_freq(self, | ||
| - | | ||
| - | self.set_rxfreq(freq) | ||
| - | self.set_txfreq(freq) | ||
| - | return "Set freq success" | ||
| - | | ||
| - | def get_rxfreq(self): | ||
| - | command = " | ||
| - | ecc = self.get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | list = result.split("," | ||
| - | f = list[4].split(" | ||
| - | fkhz = " | ||
| - | return fkhz | ||
| - | else: | ||
| - | return self.get_rxfreq() | ||
| - | | ||
| - | | ||
| - | def get_txfreq(self): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | list = result.split("," | ||
| - | f = list[4].split(" | ||
| - | fkhz = " | ||
| - | return fkhz | ||
| - | else: | ||
| - | return self.get_txfreq() | ||
| - | | ||
| - | |||
| - | def get_mode(self): | ||
| - | command = " | ||
| - | ecc = self.get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | list = result.split("," | ||
| - | mode = list[4].split(" | ||
| - | return mode | ||
| - | else: | ||
| - | return self.get_mode() | ||
| - | | ||
| - | |||
| - | |||
| - | def set_mode(self, | ||
| - | mode = mode.upper() | ||
| - | command = " | ||
| - | ecc = self.get_ecc(command) | ||
| - | | ||
| - | sendStr = preamble +controller+"," | ||
| - | print "in set_mode with ", sendStr | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return self.set_mode(mode) | ||
| - | |||
| - | | ||
| - | def set_rxfreq(self, | ||
| - | | ||
| - | fmhz = float(freq) / 1000 | ||
| - | f = str(fmhz) | ||
| - | | ||
| - | command = " | ||
| - | ecc = self.get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return self.set_rxfreq(freq) | ||
| - | | ||
| - | | ||
| - | def set_txfreq(self, | ||
| - | | ||
| - | fmhz = float(freq) / 1000 | ||
| - | f = str(fmhz) | ||
| - | | ||
| - | command = " | ||
| - | ecc = self.get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return self.set_txfreq(freq) | ||
| - | |||
| - | def get_txpower(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | list = result.split("," | ||
| - | power = list[4].split(" | ||
| - | return power | ||
| - | else: | ||
| - | return get_txpower() | ||
| - | |||
| - | def set_txpower(p): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return set_txpower(p) | ||
| - | |||
| - | def get_smeter(self): | ||
| - | command = " | ||
| - | ecc = self.get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = self.tx_rx(sendStr) | ||
| - | if result: | ||
| - | list = result.split("," | ||
| - | smeter = list[4].split(" | ||
| - | return smeter | ||
| - | else: | ||
| - | return self.get_smeter() | ||
| - | |||
| - | def speaker_on(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return speaker_on() | ||
| - | | ||
| - | | ||
| - | def speaker_off(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return speaker_off() | ||
| - | |||
| - | def sql_on(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return sql_on() | ||
| - | |||
| - | def sql_off(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return sql_off() | ||
| - | |||
| - | def nb_on(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return nb_on() | ||
| - | |||
| - | def nb_off(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return nb_off() | ||
| - | | ||
| - | def dim_on(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return dim_on() | ||
| - | |||
| - | def dim_off(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return dim_off() | ||
| - | | ||
| - | def agc_on(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return agc_on() | ||
| - | |||
| - | def agc_off(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return agc_off() | ||
| - | |||
| - | def get_vol(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | list = result.split("," | ||
| - | vol = list[4].split(" | ||
| - | return vol | ||
| - | else: | ||
| - | return get_vol() | ||
| - | | ||
| - | | ||
| - | |||
| - | def set_vol(v): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return set_vol(v) | ||
| - | |||
| - | def get_rfg(): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble+controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | list = result.split("," | ||
| - | rf = list[4].split(" | ||
| - | return rf | ||
| - | else: | ||
| - | return get_rfg() | ||
| - | | ||
| - | def get_att(self): | ||
| - | return | ||
| - | | ||
| - | def get_pre(self): | ||
| - | return | ||
| - | |||
| - | def set_rfg(v): | ||
| - | command = " | ||
| - | ecc = get_ecc(command) | ||
| - | sendStr = preamble +controller+"," | ||
| - | result = tx_rx(sendStr) | ||
| - | if result: | ||
| - | return result | ||
| - | else: | ||
| - | return set_rfg(v) | ||
| - | |||
| - | # The message FROM the radio may be corrupted so we do a check on the received ECC versus our calculated cECC | ||
| - | # from the received characters - which are everything AFTER the " | ||
| - | # | ||
| - | # starting the ECC calculation at message[1] ignores the " | ||
| - | # character' | ||
| - | # into a two-digit hex value. This is then compared to the received (rECC) value from the radio' | ||
| - | # If they match the message is acceptable and check_ecc() returns True to tx_rx(), | ||
| - | # otherwise check_ecc() function returns " | ||
| - | # the True/False value is tested in tx_rx(). | ||
| - | # If True then tx_rx() returns the incoming string to the calling function | ||
| - | # otherwise it returns " | ||
| - | # The calling function then checkS the boolean state of the returned value. | ||
| - | # If True (ie it has the radio' | ||
| - | # is sent back to the client. | ||
| - | # If False the function calls itself again, and attempts to get an error-free reply from the radio, via tx_rx() | ||
| - | |||
| - | def check_ecc(self, | ||
| - | i = 1 | ||
| - | cecc = 0 | ||
| - | | ||
| - | while i < len(message): | ||
| - | cecc = ord(message[i]) ^ cecc | ||
| - | i += 1 | ||
| - | | ||
| - | cecc = ' | ||
| - | | ||
| - | if cecc == recc: | ||
| - | return True | ||
| - | else: | ||
| - | return False | ||
| - | | ||
| - | def tx_rx(self, | ||
| - | print "in tx_rx, sendStr = " , sendStr | ||
| - | lock.acquire() | ||
| - | | ||
| - | self.ser.write(sendStr) | ||
| - | time.sleep(0.1) | ||
| - | result = self.ser.readline() | ||
| - | |||
| - | print result | ||
| - | reply = result.split(" | ||
| - | ecc = reply[1][0: | ||
| - | message = reply[0] | ||
| - | lock.release() | ||
| - | | ||
| - | if self.check_ecc(message, | ||
| - | return result | ||
| - | else: | ||
| - | return False | ||
| - | | ||
| - | | ||
| - | |||
| - | |||
| - | |||
| - | # | ||
| - | | ||
| - | </ | ||
| - | |||
| - | ++++ | ||
| - | |||
| - | ===== Documentation ===== | ||
| - | |||
| - | * {{ : | ||
| - | * {{ : | ||
| - | * {{ : | ||
| - | |||
| - | ==== Page Info ==== | ||
| - | |||
| - | Page created Tue May 24 23:59:35 2022 by John Pumford-Green | ||
| - | |||
| - | Page last updated: ~~LASTMOD~~ | ||
| - | |||
| - | ==== tags ==== | ||
| - | |||
| - | {{tag> | ||
| - | |||
public/radio/radio_database/ic-m710.1685377288.txt.gz · Last modified: (external edit)
