GithubHelp home page GithubHelp logo

etherkit / jtencode Goto Github PK

View Code? Open in Web Editor NEW
97.0 15.0 32.0 361 KB

JT65/JT9/JT4/WSPR/FSQ Encoder Library for Arduino

License: GNU General Public License v3.0

C++ 57.58% C 42.42%
wspr arduino fsq jt65 jt9 jt4 ft8

jtencode's Introduction

JT65/JT9/JT4/FT8/WSPR/FSQ Encoder Library for Arduino

This library very simply generates a set of channel symbols for JT65, JT9, JT4, FT8, or WSPR based on the user providing a properly formatted Type 6 message for JT65, JT9, or JT4 (which is 13 valid characters), Type 0.0 or 0.5 message for FT8 (v2.0.0 protocol) or a Type 1, Type 2, or Type 3 message for WSPR. It will also generate an arbitrary FSQ message of up to 200 characters in both directed and non-directed format. When paired with a synthesizer that can output frequencies in fine, phase-continuous tuning steps (such as the Si5351), then a beacon or telemetry transmitter can be created which can change the transmitted characters as needed from the Arduino.

Please feel free to use the issues feature of GitHub if you run into problems or have suggestions for important features to implement.

Thanks For Your Support!

If you would like to support my library development efforts, I would ask that you please consider sending a one-time PayPal tip or subscribe to me on SubscribeStar for an ongoing contribution.. Thank you!

Hardware Requirements and Setup

This library has been written for the Arduino platform and has been successfully tested on the Arduino Uno, an Uno clone, an Arduino Zero clone, and a NodeMCU. Since the library itself does not access the hardware, there is no reason it should not run on any Arduino model of recent vintage as long as it has at least 2 kB of RAM.

How To Install

The best way to install the library is via the Arduino Library Manager, which is available if you are using Arduino IDE version 1.6.2 or greater. To install it this way, simply go to the menu Sketch > Include Library > Manage Libraries..., and then in the search box at the upper-right, type "Etherkit JTEncode". Click on the entry in the list below, then click on the provided "Install" button. By installing the library this way, you will always have notifications of future library updates, and can easily switch between library versions.

If you need to or would like to install the library in the old way, then you can download a copy of the library in a ZIP file. Download a ZIP file of the library from the GitHub repository by going to this page and clicking the "Source code (zip)" link under the latest release. Finally, open the Arduino IDE, select menu Sketch > Import Library... > Add Library..., and select the ZIP that you just downloaded.

RAM Usage

Most of the encoding functions need to manipulate multiple arrays of symbols in RAM at the same time, and therefore are quite RAM intensive. Care has been taken to put as much data into program memory as is possible, but the encoding functions still can cause problems with the low RAM microcontrollers such as the ATmegaxx8 series. If you are using these, then please be sure to call them only once when a transmit buffer needs to be created or changed, and call them separately of other subroutine calls. When using other microcontrollers that have more RAM, such as most of the ARM ICs, this won't be as much of a problem. If you see unusual freezes, that almost certainly indicates a RAM shortage.

WSPR Messages

JTEncode includes support for all three WSPR message types. A brief listing of the three types is given below:

Message Type Fields Example
Type 1 Callsign, Grid (4 digit), Power NT7S CN85 30
Type 2 Callsign with prefix or suffix, Power NT7S/P 30
Type 3 Callsign Hash, Grid (6 digit), Power <NT7S> CN85NM 30

Most WSPR messages are type 1, however sometimes type 2 and 3 messages are needed. Type 2 messages allow you to send a callsign with a prefix of up to three characters, a suffix of a single character, or a suffix consisting of two numerical digits. Type 3 messages are typically used in conjunction with type 2 messages since type 2 messages don't include a grid locator. The type 3 message sends a 15-bit hash of the included callsign, along with a 6 digit grid locator and the power.

Type 2 messages can be sent in JTEncode simply by including the slashed prefix or suffix in the callsign field. A type 3 message can be sent by enclosing a callsign with angle brackets (as seen in the example above).

Example

There is a simple example that is placed in your examples menu under JTEncode. Open this to see how to incorporate this library with your code. The example provided with with the library is meant to be used in conjunction with the Etherkit Si5351A Breakout Board, although it could be modified to use with other synthesizers which meet the technical requirements of the JT65/JT9/JT4/WSPR/FSQ modes.

To run this example, be sure to download the Si5351Arduino library and follow the instructions there to connect the Si5351A Breakout Board to your Arduino. In order to trigger transmissions, you will also need to connect a momentary pushbutton from pin 12 of the Arduino to ground.

The example sketch itself is fairly straightforward. JT65, JT9, JT4, FT8, WSPR, and FSQ modes are modulated in same way: phase-continuous multiple-frequency shift keying (MFSK). The message to be transmitted is passed to the JTEncode method corresponding to the desired mode, along with a pointer to an array which holds the returned channel symbols. When the pushbutton is pushed, the sketch then transmits each channel symbol sequentially as an offset from the base frequency given in the sketch define section.

An instance of the JTEncode object is created:

JTEncode jtencode;

On sketch startup, the mode parameters are set based on which mode is currently selected (by the DEFAULT_MODE define):

// Set the proper frequency, tone spacing, symbol count, and
// tone delay depending on mode
switch(cur_mode)
{
case MODE_JT9:
  freq = JT9_DEFAULT_FREQ;
  symbol_count = JT9_SYMBOL_COUNT; // From the library defines
  tone_spacing = JT9_TONE_SPACING;
  tone_delay = JT9_DELAY;
  break;
case MODE_JT65:
  freq = JT65_DEFAULT_FREQ;
  symbol_count = JT65_SYMBOL_COUNT; // From the library defines
  tone_spacing = JT65_TONE_SPACING;
  tone_delay = JT65_DELAY;
  break;
case MODE_JT4:
  freq = JT4_DEFAULT_FREQ;
  symbol_count = JT4_SYMBOL_COUNT; // From the library defines
  tone_spacing = JT4_TONE_SPACING;
  tone_delay = JT4_DELAY;
  break;
case MODE_WSPR:
  freq = WSPR_DEFAULT_FREQ;
  symbol_count = WSPR_SYMBOL_COUNT; // From the library defines
  tone_spacing = WSPR_TONE_SPACING;
  tone_delay = WSPR_DELAY;
  break;
case MODE_FT8:
  freq = FT8_DEFAULT_FREQ;
  symbol_count = FT8_SYMBOL_COUNT; // From the library defines
  tone_spacing = FT8_TONE_SPACING;
  tone_delay = FT8_DELAY;
  break;
case MODE_FSQ_2:
  freq = FSQ_DEFAULT_FREQ;
  tone_spacing = FSQ_TONE_SPACING;
  tone_delay = FSQ_2_DELAY;
  break;
case MODE_FSQ_3:
  freq = FSQ_DEFAULT_FREQ;
  tone_spacing = FSQ_TONE_SPACING;
  tone_delay = FSQ_3_DELAY;
  break;
case MODE_FSQ_4_5:
  freq = FSQ_DEFAULT_FREQ;
  tone_spacing = FSQ_TONE_SPACING;
  tone_delay = FSQ_4_5_DELAY;
  break;
case MODE_FSQ_6:
  freq = FSQ_DEFAULT_FREQ;
  tone_spacing = FSQ_TONE_SPACING;
  tone_delay = FSQ_6_DELAY;
  break;
}

Note that the number of channel symbols for each mode is defined in the library, so you can use those defines to initialize your own symbol array sizes.

Before transmit, the proper class method is chosen based on the desired mode, then the transmit symbol buffer and the other mode information is set:

// Set the proper frequency and timer CTC depending on mode
switch(cur_mode)
{
case MODE_JT9:
  jtencode.jt9_encode(message, tx_buffer);
  break;
case MODE_JT65:
  jtencode.jt65_encode(message, tx_buffer);
  break;
case MODE_JT4:
  jtencode.jt4_encode(message, tx_buffer);
  break;
case MODE_WSPR:
  jtencode.wspr_encode(call, loc, dbm, tx_buffer);
  break;
case MODE_FT8:
  jtencode.ft_encode(message, tx_buffer);
  break;
case MODE_FSQ_2:
case MODE_FSQ_3:
case MODE_FSQ_4_5:
case MODE_FSQ_6:
  jtencode.fsq_dir_encode(call, "n0call", " ", "hello world", tx_buffer);
  break;
}

As mentioned above, it is best if the message encoding functions are called only when needed, in its own subroutine.

Once the channel symbols have been generated, it is a simple matter of transmitting them in sequence, each the correct amount of time:

// Now transmit the channel symbols
for(i = 0; i < symbol_count; i++)
{
    si5351.set_freq((freq * 100) + (tx_buffer[i] * tone_spacing), SI5351_CLK0);
    delay(tone_delay);
}

Public Methods

jt65_encode()

/*
 * jt65_encode(const char * message, uint8_t * symbols)
 *
 * Takes an arbitrary message of up to 13 allowable characters and returns
 * a channel symbol table.
 *
 * message - Plaintext Type 6 message.
 * symbols - Array of channel symbols to transmit returned by the method.
 *  Ensure that you pass a uint8_t array of at least size JT65_SYMBOL_COUNT to the method.
 *
 */

jt9_encode()

/*
 * jt9_encode(const char * message, uint8_t * symbols)
 *
 * Takes an arbitrary message of up to 13 allowable characters and returns
 * a channel symbol table.
 *
 * message - Plaintext Type 6 message.
 * symbols - Array of channel symbols to transmit returned by the method.
 *  Ensure that you pass a uint8_t array of at least size JT9_SYMBOL_COUNT to the method.
 *
 */

jt4_encode()

/*
 * jt4_encode(const char * message, uint8_t * symbols)
 *
 * Takes an arbitrary message of up to 13 allowable characters and returns
 * a channel symbol table.
 *
 * message - Plaintext Type 6 message.
 * symbols - Array of channel symbols to transmit returned by the method.
 *  Ensure that you pass a uint8_t array of at least size JT9_SYMBOL_COUNT to the method.
 *
 */

wspr_encode()

/*
 * wspr_encode(const char * call, const char * loc, const uint8_t dbm, uint8_t * symbols)
 *
 * Takes a callsign, grid locator, and power level and returns a WSPR symbol
 * table for a Type 1, 2, or 3 message.
 *
 * call - Callsign (12 characters maximum).
 * loc - Maidenhead grid locator (6 characters maximum).
 * dbm - Output power in dBm.
 * symbols - Array of channel symbols to transmit returned by the method.
 *  Ensure that you pass a uint8_t array of at least size WSPR_SYMBOL_COUNT to the method.
 *
 */

ft8_encode()

/*
 * ft8_encode(const char * message, uint8_t * symbols)
 *
 * Takes an arbitrary message of up to 13 allowable characters or a telemetry message
 * of up to 18 hexadecimal digit (in string format) and returns a channel symbol table.
 * Encoded for the FT8 protocol used in WSJT-X v2.0 and beyond (79 channel symbols).
 *
 * message - Type 0.0 free text message or Type 0.5 telemetry message.
 * symbols - Array of channel symbols to transmit returned by the method.
 *  Ensure that you pass a uint8_t array of at least size FT8_SYMBOL_COUNT to the method.
 *
 */

fsq_encode()

/*
 * fsq_encode(const char * from_call, const char * message, uint8_t * symbols)
 *
 * Takes an arbitrary message and returns a FSQ channel symbol table.
 *
 * from_call - Callsign of issuing station (maximum size: 20)
 * message - Null-terminated message string, no greater than 130 chars in length
 * symbols - Array of channel symbols to transmit returned by the method.
 *  Ensure that you pass a uint8_t array of at least the size of the message
 *  plus 5 characters to the method. Terminated in 0xFF.
 *
 */

fsq_dir_encode()

/*
* fsq_dir_encode(const char * from_call, const char * to_call, const char cmd, const char * message, uint8_t * symbols)
*
* Takes an arbitrary message and returns a FSQ channel symbol table.
*
* from_call - Callsign from which message is directed (maximum size: 20)
* to_call - Callsign to which message is directed (maximum size: 20)
* cmd - Directed command
* message - Null-terminated message string, no greater than 100 chars in length
* symbols - Array of channel symbols to transmit returned by the method.
*  Ensure that you pass a uint8_t array of at least the size of the message
*  plus 5 characters to the method. Terminated in 0xFF.
*
*/

latlon_to_grid()

/*
 * latlon_to_grid(float lat, float lon, char* ret_grid)
 *
 * Takes a station latitude and longitude provided in decimal degrees format and
 * returns a string with the 6-digit Maidenhead grid designator.
 *
 * lat - Latitude in decimal degrees format.
 * lon - Longitude in decimal degrees format.
 * ret_grid - Derived Maidenhead grid square. A pointer to a character array of
 *   at least 7 bytes must be provided here for the function return value.
 *
 */

Tokens

Here are the defines, structs, and enumerations you will find handy to use with the library.

Defines:

JT65_SYMBOL_COUNT, JT9_SYMBOL_COUNT, JT4_SYMBOL_COUNT, WSPR_SYMBOL_COUNT, FT8_SYMBOL_COUNT

Acknowledgements

Many thanks to Joe Taylor K1JT for his innovative work in amateur radio. We are lucky to have him. The algorithms in this program were derived from the source code in the WSJT-X suite of applications. Also, many thanks for Andy Talbot G4JNT for his paper on the WSPR coding protocol, which helped me to understand the WSPR encoding process, which in turn helped me to understand the related JT protocols.

Also, a big thank you to Murray Greenman, ZL1BPU for working allowing me to pick his brain regarding his neat new mode FSQ.

Changelog

  • v1.3.1

    • Added latitude/longitude to Maidenhead grid convenience function
  • v1.3.0

    • WSPR Type 2 and Type 3 message capability added
  • v1.2.1

    • Fix keywords.txt
  • v1.2.0

    • Add support for FT8 protocol (79 symbol version introduced December 2018)
  • v1.1.3

    • Add support for ESP8266
    • Fix WSPR regression in last release
  • v1.1.2

    • Fix buffer bug in jt_message_prep() that caused messages of 11 chars to lock up the processor
    • Made a handful of changes to make the library more friendly to ATmegaxx8 processors
    • Rewrote example sketch to be generically compatible with most Arduino platforms
  • v1.1.1

    • Update example sketch for Si5351Arduino v2.0.0
  • v1.1.0

    • Added FSQ
  • v1.0.1

    • Fixed a bug in jt65_interleave() that was causing a buffer overrun.
  • v1.0.0

    • Initial Release

Arduino Lint Status

arduino-lint Actions Status

License

JTEncode 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.

JTEncode 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. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with JTEncode. If not, see http://www.gnu.org/licenses/.

jtencode's People

Contributors

nt7s avatar per1234 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jtencode's Issues

Tone spacing and frequency scaling error + only FT8 working on 2m/6m

I have managed to get FT8 on 2m/6m to work but I have to have FT8_TONE_SPACING as 62.5 instead of 625, and FT8_DEFAULT_FREQ set to 14417400UL if I want 144.174mhz as an example.

It seems the scaling in both is off for some reason. No issues using any other Si5351A examples I find on the internet, including GPS frequency corrected versions using 2.5mhz output etc.

Also all the other modes don't seem to work, I can see the signal looks ok on the waterfall on the receiver, but I suspect the timing or frequency spacing is not quite right and I assume it must be related to the scaling issue above.

I'm using an Arduino Uno, and the only modifications are setting the mode and having to change the scaling factor and frequency - has anyone seen this issue too or have any ideas for troubleshooting?

Add CW Mode

Is it possible for you to add CW mode? It could be very easy...

Please help trying your library

Hi there!
Since the demo does not seems to work for me, i've started with a blank project and copied part of your code into mine.

Can someone explain me why it hangs on

si5351.set_freq((freq * 100) + (tx_buffer[i] * tone_spacing), SI5351_CLK0); // HANGS HERE!!!!!!!!!!

The code is located here:

http://pastebin.com/QzXLnbCK

Many many thanks!

Add CW mode

Hi!
Please, ,, can you add CW mode?
Many thanks!

Decode the received message

Hello,

First of, I would like to thank you for this great library, it works amazingly well.
My question is, is it possible to decode the received signal using an Arduino. For the project I'm working on I need to be able to send and receive the signal with an Arduino using the JT65 protocol.

Hang on jtencode

Please, i'm very frustrated now...
I've started a very little project from your demo (that seems TO ME to not being working).
The problem is when i use the function

jtencode.jt65_encode(message, tx_buffer);

It seems to stop my arduino

My code is here:

http://pastebin.com/X7bz84JB

The offending line is the n. 61

If I uncomment that line, the program/arduino hangs, instead if i comment that line everything works (ok...no jt65 good message, but i can see the carriers on the spectrum of my sdr).

PLEASE, any help is very appreciated!

Add CW mode

Hi!
It would be great if you can add CW mode (wanna build a sort of multimode beacon with your library).

Greeting Mike iu5hes

Saving some more memory - solutions

Hi

Great library, thank you for all your work.

A few ways to save more memory - I saved 562 bytes of flash and 530 bytes of flash with these changes through suggestions made to me:

Moved the tables from jt65_merge_sync_vector, jt9_merge_sync_vector, jt4_merge_sync_vector and wspr_sync_vector all to PROGMEM and read back via pgm_read_byte(wspr_sync_vector +i) etc.

In ft8_merge_sync_vector moved costas7x7 and graymap to PROGMEM. Then memcpy_P and pgm_read_byte(&graymap[idx]) to read them back:

`void JTEncode::ft8_merge_sync_vector(uint8_t* symbols, uint8_t* output)
{
static const uint8_t PROGMEM costas7x7[7] = {3, 1, 4, 0, 6, 5, 2};
static const uint8_t PROGMEM graymap[8] = {0, 1, 3, 2, 5, 6, 4, 7};
uint8_t i, j, k, idx;

// Insert Costas sync arrays
memcpy_P(output, costas7x7, 7);
memcpy_P(output + 36, costas7x7, 7);
memcpy_P(output + FT8_SYMBOL_COUNT - 7, costas7x7, 7);

k = 6;
for(j = 0; j < 58; ++j) // 58 data symbols
{
i = 3 * j;
++k;
if(j == 29)
{
k += 7;
}
idx = symbols[i] * 4 + symbols[i + 1] * 2 + symbols[i + 2];
output[k] = pgm_read_byte(&graymap[idx]);
}
}`

If you would rather a pull request I can do that.

Thanks very much
Kevin

Bug in FT8 Telemetry mode and an easy fix. (Atmel tool chain and possibly others)

There is a bug in the FT8 telemetry mode code.

In JTEncode.cpp line 887 the line: snprintf(temp_msg, 19, "%*s", 18, c18); sets temp_msg to a zero length string. This causes the variable "message" further down in the code to have a zero 1st byte and corrupts the telemetry message.

Replace the snprintf call with the following: snprintf(temp_msg, 19, "%18s", c18);

I am running the code on an Arduno Pro Mini (Atmel chip) and it appears that the %*s formatter is not functioning correctly on this tool chain. Since the length is hard coded, the simpler %18s will work.

73s de KJ6FO

FT8 on 144MHz.

Hello Jason,
Playing with Si5351JTDemo ( using <si5351.h> v. 2.1.4 and <JTEncode.h> v.1.2.1 ) I met the following problem - transmiting of FT8 (also on JT4) text on 144MHz is interrupted on every new tone, breaks and starts of transmition occures everytime frequency has changed. It's looks like Si5351 could not locks the frequencies. This problem is missing on HF, 50 and 70MHz. I've tried with different chips and reference frequencies ( 25MHz, 26MHz and 27Mhz) but without any luck. Any suggestion ?
Thank you very much for your great support to the HAM community !
Best regards,
Georgi LZ1ZP

Project is missing COPYING file at top level

Hi,
It looks like this might be a GPL v3 project based on the header file license block.

  1. If so, if likely should have a COPYING file with the text of the GPL v3 in it
  2. The Readme.md file should be updated to contain a license section.

thanks!

variable callsigin: length correct?

I read through the code because I had an other problem and searched for all occurences of strcpy, strncpy, ..

I see the following problem with callsign, defined in JTEncode.h:
char callsign[12];

We know, compound calls in wspr type2 messages are 12 bytes long: <DL9/DL9SAU>, plus the terminating \0.

JTEncode.cpp does:
strncpy(callsign, call, 12);
-> No buffer overflow, but the copied 12 bytes long string is not terminated.
The operation further down,
char* slash_avail = strchr(callsign, (int)'/');
may search for '/' beyond end of char[] callsign (if user had a wrong input). Same for
char* bracket_avail = strchr(callsign, (int)'>');

Fix:
I see no reason to keep char callsign 12 bytes long.
-> Define in JTEncode.h
char callsign[13];
should solve the hypothetical problem.

String overflow in jt_message_prep

Hi! I noticed today that in jt_message_prep, the code that pads a short string (less than 13 characters) with spaces overwrites the terminating null byte (undesirable).

This

  if(len < 13)
  {
    for(i = len; i <= 13; i++)
    {
      message[i] = ' ';
    }
  }

could be simply

  for(i = len; i < 13; i++)
  {
    message[i] = ' ';
  }

(Note 'i <= 13' changed to 'i < 13')

WSPR Callsign with one char prefix failed.

Hello,
I did have some trouble with a one char prefix in the wspr callsign (F/PE0FKO), it was not received by the wspr systems.
Did check the code for the JTEncode::wspr_encode() function and found the problem in JTEncode::wspr_bit_packing(). There, in the function line 1000, the 3 and 2 char prefix is handled, only the one char prefix is not!
I fixed the code with some extra if statement for the 1 char prefix and it works (for me ;-)), maybe you update the repo for that.
73, Fred, pe0fko

Incompatibility with TinyGPSPlus?

Hi!
Yes...it's me again...but this time i think the problem is very hard to investigate...
The library and my project worked ok till now...but...
If i simply add

TinyGPSPlus gpsext;

The jtencode.jt65_encode(message, tx_buffer); doesn't work anymore

If i remove the TinyGPSPlus declaration (i've only added the declaration!!!! and the #include <TinyGPS++.h>) everythings works ok.

Leaving the #include <TinyGPS++.h> and not declaring the gpsext object, it works ok.

I've NO idea how to investigate this strange thing...the examples examples of TiniGPS++ works ok, the jtencode works ok.....but when i use the 2 libraryes in the same project jt65_encode(message, tx_buffer); hangs somewhere

Crash when message is 11 characters

If message[] is exactly 11 characters, as in the example sketch, the library does not work. See a shorter example sketch below. This sketch should simply output a single tone, and many lines of "tone change" to the serial monitor. Instead, "tone change" prints once, and the sketch stops.

Changing message[] to some other string that is not 11 characters results in the sketch reaching completion.

#include <si5351.h>
#include <Wire.h>
#include <JTEncode.h>

Si5351 si5351;
JTEncode jtencode;

char message[] = "abababababa";
uint8_t tx_buffer[255];

unsigned long baseFreq;

void encode(){
  uint8_t i;
  memset(tx_buffer, 0, 255);
  jtencode.jt9_encode(message, tx_buffer);

  si5351.output_enable(SI5351_CLK0, 1);

  for(i = 0; i < JT9_SYMBOL_COUNT; i++){
    Serial.println("tone change");
    uint8_t test = tx_buffer[i];
    si5351.set_freq(708080000ULL, SI5351_CLK0);
    delay(580);
  }
  si5351.output_enable(SI5351_CLK0, 0);
}


void setup() {
  Serial.begin(9600);
  baseFreq = 708080000ULL;

  si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
  si5351.set_freq(baseFreq, SI5351_CLK0);
  si5351.output_enable(SI5351_CLK0, 0);
  si5351.update_status();
}

void loop() {
  delay(1000);
  Serial.println("Calling encode();");
  encode();
  Serial.println("Returned from encode();");
}

wspr_encode destroying data in RAM

Hi,

when using jtencode as shown in the example, data from the calling routine gets lost as soon as wspr_merge_sync_vectors is called. Which is funny as it does not do anything dangerous and the needed 255 bytes should fit in the remaining 800 bytes pretty well.

Please tell me how I can help you debug stuff.

ESP32 compiler sees errors

When compiling for ESP32-S2 I get fatal errors. I get the same errors with another microcontroller (M0), but it compiles successfully because they get treated as Warnings. (pasted below)
I suspect this has something to do with compiler settings, but are these anything you have fixed in the meanwhile? Any suggestions? By the way, I am only using this to encode WSPR packets.
Marty - KB4MG

c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\nhash.c: In function 'nhash':
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\nhash.c:225:21: error: variable 'k8' set but not used [-Werror=unused-but-set-variable]
const uint8_t k8;
^~
cc1.exe: some warnings being treated as errors
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\JTEncode.cpp: In member function 'void JTEncode::fsq_encode(const char
, const char*, uint8_t*)':
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\JTEncode.cpp:251:35: error: unused variable 'tone' [-Werror=unused-variable]
uint8_t i, fch, vcode1, vcode2, tone;
^~~~
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\JTEncode.cpp: In member function 'void JTEncode::fsq_dir_encode(const char*, const char*, char, const char*, uint8_t*)':
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\JTEncode.cpp:338:35: error: unused variable 'tone' [-Werror=unused-variable]
uint8_t i, fch, vcode1, vcode2, tone, from_call_crc;
^~~~
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\JTEncode.cpp: In member function 'void JTEncode::ft8_encode(const char*, uint8_t*)':
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\JTEncode.cpp:426:11: error: unused variable 'i' [-Werror=unused-variable]
uint8_t i;
^
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\JTEncode.cpp: In member function 'void JTEncode::ft8_bit_packing(char*, uint8_t*)':
c:\Users\Marty\Documents\Arduino\libraries\JTEncode\src\JTEncode.cpp:1122:28: error: 'i0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
memmove(c18, message, i0 + 1);
~~~^~~
cc1plus.exe: some warnings being treated as errors_

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.