Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed requirements for TK #2

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
__pycache__
MOPPLog.txt
.DS_Store
venv/
.vercel
8 changes: 0 additions & 8 deletions Dockerfile

This file was deleted.

215 changes: 0 additions & 215 deletions MOPP_Chat_server.py

This file was deleted.

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ Besides the serial interface, you will need a soundcard for the tones and a netw

## software installation

### OSX
+ `brew install python-tk`
Maybe you want to use a virtual python environment?
```
python3 -m venv venv
source ./venv/bin/activate
pip3 install -r requirements.txt
```

### docker server installation
+ `docker build . -t mopp_chat_server`
+ `docker run --rm -it -p 7373:7373/udp mopp_chat_server`
Expand All @@ -39,18 +48,9 @@ Besides the serial interface, you will need a soundcard for the tones and a netw

(Note: if you prefer a single executeable file, skip this section and refer to the binary release packages section)

SigBit runs on python3 and requires the following non-standard libraries:

- pyserial
- sounddevice
- appdirs
- numpy

The easiest way to obtain them is via pip3 install:

on linux/osx run in a shell:

pip3 install pyserial sounddevice appdirs numpy
pip3 install -r requirements.txt


On linux you also need to add your user to the group _dialout_ to grant permission to use the serial port.
Expand Down
2 changes: 1 addition & 1 deletion appconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, appname, author, version = None):
first_serial_port = serial.tools.list_ports.comports()[0][0]

self.config['DEFAULT'] = {
'server_url' : 'morse.spdns.org',
'server_url' : '49.12.102.144',
'server_port' : '7373',
'keyer_speed' : '18',
'serial_port' : first_serial_port,
Expand Down
10 changes: 0 additions & 10 deletions docker-compose.yml

This file was deleted.

8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

__version__= "0.1"

DEBUG=0
DEBUG=1
LOG=0

def debug(s):
Expand Down Expand Up @@ -64,7 +64,11 @@ def debug(s):
print("Send morse code ':qrt' to disconnect before exiting client.")
print("Use Ctrl + C to exit.")
print("-"*60)


print ("Try to connect")
trx.sendto(trx.encode_buffer(encode("hi"), buzzer.wpm), (server_url,server_port))
print ("Done")

while KeyboardInterrupt:
try:
buffer = keyer.process_iambic()
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ pyserial
sounddevice
appdirs
numpy
tk
4 changes: 2 additions & 2 deletions trx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from math import ceil
from util import morse, zfill, ljust

DEBUG=0
DEBUG=1
def debug(s):
if DEBUG:
print(s)
Expand All @@ -34,7 +34,7 @@ def sendto(self, data, url):
self.sock.sendto(data,url)
except:
debug("tx error")
self.buzzer.play_text("txerror")
#self.buzzer.play_text("txerror")

def recv(self):
data=None
Expand Down