Coder Social home page Coder Social logo

sa818's Introduction

SA818 Programming

Before programming the SA818 module, make sure you consult the band plan for your country and transmit on a frequency you are allowed to use.

Intallation

The easiest way to install is program is to use the command pip. Pip will automatically take care of installing the dependencies.

$ sudo pip install sa818

You can also clone this repository and use the setup.py script with the following command. You will have to install the python package pyserial manually. To install dependencies, refer to the manual of your operating system.

$ git clone https://github.com/0x9900/SA818.git
$ sudo python3 setup.py install

Example

[root@allstar ~]# sa818 version
SA818: INFO: Firmware version: V4.2

[root@allstar ~]# sa818 radio --frequency 145.230 --offset -.6 --ctcss 100
SA818: INFO: +DMOSETGROUP:0, BW: Wide, Frequency (RX: 145.2300 / TX: 144.6300), CTCSS (TX: 100.0 / RX: 100.0), squelch: 4, OK

[root@allstar ~]# sa818 volume --level 5
SA818: INFO: +DMOSETVOLUME:0 Volume level: 5, OK

If you use an FTDI dongle to program the SA828 module the USB port can be specified with the --port argument

[root@allstar ~]# sa818 --port /dev/ttyAMA0 volume --level 5
SA818: INFO: +DMOSETVOLUME:0 Volume level: 5

It is possible to specify a different CTCSS or DCS code for transmit and receive by separating the two codes by a comma (no spaces). For example, --ctcss 100,88.5 will set the CTCSS 100Hz for transmit and 88.5Hz for receive.

Usage

This program has for sections:

  • radio: Program the radio's frequency, tone and squelch level
  • volume: Set the volume level
  • filters: Turn on or off the [pre/de]-emphasis and as well as the high and low pass filter
  • version: display the firmware version of the SA818 module
usage: sa818 [-h] [--debug] [--port PORT]
                [--speed {300,1200,2400,4800,9600,19200,38400,57600,115200}]
                {radio,volume,filters,version} ...

generate configuration for switch port

positional arguments:
  {radio,volume,filters,version}
    radio               Program the radio (frequency/tome/squelch)
    volume              Set the volume level
    filters             Enable/Disable filters
    version             Show the firmware version of the SA818

options:
  -h, --help            show this help message and exit
  --debug
  --port PORT           Serial port [default: linux console port]
  --speed {300,1200,2400,4800,9600,19200,38400,57600,115200}
                        Connection speed

Radio

usage: sa818 radio [-h] [--bw {0,1}] --frequency FREQUENCY
                      [--offset OFFSET] [--squelch SQUELCH]
                      [--ctcss CTCSS | --dcs DCS] [--tail TAIL]

options:
  -h, --help            show this help message and exit
  --bw {0,1}            Bandwidth 0=NARROW (12.5KHz), 1=WIDE (25KHx) [default:
                        WIDE]
  --frequency FREQUENCY
                        Receive frequency
  --offset OFFSET       Offset in MHz, 0 for no offset [default: 0.0]
  --squelch SQUELCH     Squelch value (0 to 8) [default: 4]
  --ctcss CTCSS         CTCSS (PL Tone) 0 for no CTCSS [default: None]
  --dcs DCS             DCS code must be the number followed by [N normal] or
                        [I inverse] [default: None]
  --tail TAIL           Close CTCSS Tail Tone (Open/Close)

Volume

usage: sa818 volume [-h] [--level LEVEL]

options:
  -h, --help     show this help message and exit
  --level LEVEL  Volume value (1 to 8) [default: 4]

Filters

usage: sa818 filters [-h] --emphasis EMPHASIS --highpass HIGHPASS --lowpass
                        LOWPASS

options:
  -h, --help           show this help message and exit
  --emphasis EMPHASIS  [Pr/De]-emphasis (Enable/Disable)
  --highpass HIGHPASS  High pass filter (Enable/Disable)
  --lowpass LOWPASS    Low pass filters (Enable/Disable)

CTCSS codes (PL Tones)

67.0, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4, 88.5, 91.5, 94.8, 97.4,
100.0, 103.5, 107.2, 110.9, 114.8, 118.8, 123.0, 127.3, 131.8, 136.5,
141.3, 146.2, 151.4, 156.7, 162.2, 167.9, 173.8, 179.9, 186.2, 192.8,
203.5, 210.7, 218.1, 225.7, 233.6, 241.8, 250.3

DCS Codes

DCS codes must be followed by N or I for Normal or Inverse:

Example: 047I

023, 025, 026, 031, 032, 036, 043, 047, 051, 053, 054, 065, 071, 072,
073, 074, 114, 115, 116, 125, 131, 132, 134, 143, 152, 155, 156, 162,
165, 172, 174, 205, 223, 226, 243, 244, 245, 251, 261, 263, 265, 271,
306, 311, 315, 331, 343, 346, 351, 364, 365, 371, 411, 412, 413, 423,
431, 432, 445, 464, 465, 466, 503, 506, 516, 532, 546, 565, 606, 612,
624, 627, 631, 632, 654, 662, 664, 703, 712, 723, 731, 732, 734, 743,
754

sa818's People

Contributors

0x9900 avatar charlieh0tel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sa818's Issues

Suggestion/feature request

Ever consider using an I2S audio solution so you can feed audio direct to the gpio on the pi instead of the USB method? See https://github.com/mytechguyri/i2s_audio_phat.git

Then one other improvement... While i love the SA818 modules... they're a bit under powered... they typically don't put out enough power to drive an amp at all, so using them for APRS, while it works (works with the I2S audio above quite well) its just too low powered... BUT, NiceRF also makes the SA868 module... pin and code compatible with the SA818, but its a 2 watt module (actually 1.5W in real world) but that's enough to drive an amp... so it could make a great little digital modes hat... and i think if you look at the i2s_audio_hat, that's on the pi zero form factor, and there are big chunks of board real estate taken up by audio connectors and a microphone, which wouldn't be necessary in a a PIRIF type application... Use an IPX antenna connector, and I'd bet you could fit the i2s audio and the SA868 on a pi zero form factor board... solar powered remote APRS digipeater? piece of cake zero, hat, battery, solar panel in a weather proof enclosure.

I was actually going to design this myself, but pcb design is not my area of expertise... and you've got everything nearly done already with your pirim design... it makes more sense to collaborate to make a better wheel than to re-invent it.

73
WA1OKB

Set Filters and yesno arg

Hi,

I have a question about the FILTERS setup in SA818 using this program

In the code, the "yesno" procedure corresponds to YES 1 and NO 0
https://github.com/0x9900/SA818/blob/main/sa818.py#L249

by setting filters options

sa818 filtes --empahasis yes --highpass yes --lowpass yes

the parameters are described

--emphasis EMPHASIS Enable [Pr/De]-emphasis (yes/no) [default: no]
--highpass HIGHPASS Enable high pass filter (yes/no) [default: no]
--lowpass LOWPASS Enable low pass filters (yes/no) [default: no]

sent commands to SA818 with used "yes" will be

AT_SETFILTER = 1,1,1

so value 1 corresponds to "bypass" so isn't it enabled???

Perhaps I misunderstand the term "bypass"

Request: Support setting wide/narrow bandwidth

Is it possible to add a command line argument for setting the radio bandwidth along with the frequency?
It looks like the script currently sets the wide bandwidth in all cases.

My testing shows a ~2 dB improvement in sensitivity when the narrow filters are used for narrow band transmissions (12 dB SINAD, 1 kHz/2.2 kHz dev, CCITT filters).
This is on the SA818-S (VHF) FW 1.1

And thanks for making this, it's saved me a ton of time!

The latest version problems with programming

Hi,

After upgrade to latest version 0.2.3 has problems, when we try for example set volume level produce error

sa818 --port /dev/ttyUSB0 volume --level 8

SA818 set volume error

similar problem with filters

SA818 set filter error

Version 0.2.2 works OK

AttributeError: 'Namespace' object has no attribute 'func'

pi@pirim:~/src/SA818.ch $ ./sa818.py 
Traceback (most recent call last):
  File "./sa818.py", line 342, in <module>
    main()
  File "./sa818.py", line 332, in main
    if opts.func == 'version':
AttributeError: 'Namespace' object has no attribute 'func'
pi@pirim:~/src/SA818.ch $ 

I don't see this on x86_64 ubuntu. So .... ??

Pi: Package: python3 Version: 3.7.3-1
Ubuntu: python3 Version: 3.8.2-0ubuntu2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.