km4yri / pyfldigi Goto Github PK
View Code? Open in Web Editor NEWPython library to control FLDIGI via XML-RPC
License: GNU General Public License v3.0
Python library to control FLDIGI via XML-RPC
License: GNU General Public License v3.0
As soon as the client object is created, FLDIGI will no longer transmit text entered into the transmit pane or sent from FLAMP on the same machine. If FLDIGI's TxID feature is enabled, the RSID is sent, but no data follows it.
I'm not sure if the root cause lies with pyFldigi or FLDIGI itself, but the issue doesn't appear to affect the same Python script running on Linux. I haven't experienced the issue between FLAMP and FLDIGI on either OS. If FLDIGI were solely at fault, I would expect the same behavior from both pyFldigi and FLAMP.
The problem was observed with FLDIGI 4.1.16, 4.1.18, and 4.1.20 with pyFldigi 0.4 on Python 3.8 on Windows 10 Professional 64-bit, but not Raspberry Pi OS Buster with Python 3.7.
I was having trouble using functions and went back to start over. I found the first issue is that I can not link my code to fldigi. Fldigi will start and stop but will not execute anything in between. The command app.is_running() returns false. Here is the error from python. Windows 10 64 bit. Fldigi-4.1.04.01
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
raise err
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 672, in urlopen
chunked=chunked,
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\rprat\Anaconda3\lib\http\client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\rprat\Anaconda3\lib\http\client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\rprat\Anaconda3\lib\http\client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\rprat\Anaconda3\lib\http\client.py", line 1016, in _send_output
self.send(msg)
File "C:\Users\rprat\Anaconda3\lib\http\client.py", line 956, in send
self.connect()
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\connection.py", line 184, in connect
conn = self._new_conn()
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002810F7C6B00>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rprat\Anaconda3\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "C:\Users\rprat\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=7362): Max retries exceeded with url: // (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002810F7C6B00>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rprat\Anaconda3\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Users\rprat\Anaconda3\lib\site-packages\pyfldigi\client\txmonitor.py", line 170, in run
state = self.clientObj.main.get_trx_state()
File "C:\Users\rprat\Anaconda3\lib\site-packages\pyfldigi\client\main.py", line 287, in get_trx_state
state = str(self.client.main.get_trx_status()).upper()
File "C:\Users\rprat\Anaconda3\lib\xmlrpc\client.py", line 1112, in call
return self.__send(self.__name, args)
File "C:\Users\rprat\Anaconda3\lib\xmlrpc\client.py", line 1452, in __request
verbose=self.__verbose
File "C:\Users\rprat\Anaconda3\lib\site-packages\pyfldigi\client\transport.py", line 39, in request
resp = requests.post(url, data=request_body, headers=headers)
File "C:\Users\rprat\Anaconda3\lib\site-packages\requests\api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Users\rprat\Anaconda3\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\rprat\Anaconda3\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\rprat\Anaconda3\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "C:\Users\rprat\Anaconda3\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7362): Max retries exceeded with url: // (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002810F7C6B00>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
I saw that this can be used for mobile apps, but I can't find any info on how to do it. Would I need to use a remote server?
73 de KJ7RRV
I'm playing around with the idea of writing my own simple protocol and having fldigi as the modem.
The only thing I'm changing is the port that is being provided to the Client instance.
def transmit_protocol_test(fldigi, call_sign, message):
fldigi.modem.name = 'MT63-2KL' # Set the modem to MT63-2000L
fldigi.main.send('ASPP:' + call_sign + ':1639715678:' + message + ':12345678:EOM', timeout=30)
def main():
config = read_config("config.ini")
call_sign = config.get("call", "NOCALL")
beacon_time = int(config.get("beacon", 10)) # Default to 10 minutes if beacon is not specified
fldigi = pyfldigi.Client(port=7363)
fldigi.text.clear_tx()
fldigi.text.clear_rx()
transmit_protocol_test(fldigi=fldigi, call_sign=call_sign, message='This is just a test')
When I have the port=7362
Fldigi transmits the following:
ASPP:NOCALL:1639715678:This is just a test:12345678:EOM
When I have the port=7363
Fldigi transmits the following:
POST // HTTP/1.1
text.clear_tx POST // HTTP/1.1 Host: 127.0.0.1:7363 User-Agent: Python-xmlrpc with Requests (python-requests.org) Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Content-Type: text/xml Content-Length: 113 main.get_trx_status
Host: 127.0.0.1:7363
User-Agent: Python-xmlrpc with Requests (python-requests.org)
Accept-Encoding: gzip, deflate
Accept: /
Connection: keep-alive
Content-Type: text/xml
Content-Length: 107
I'm using two ports so I can have two instances of fldigi tied with a virtual audio cable to test communication locally without a radio.
Not sure why changing the port would do this, poked at the library and nothing stood out to me as of this time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.