Topics

ubitx_20.ino does not compile, anybody else encounter this? #ubitx #ubitx-help #arduino #firmware


freefuel@...
 

Has anyone else encountered a failure to compile the Arduino Sketch for the ubitx? I am getting an error code for some type of return in the menu portion of the code. 

-Justin N2TOH 


Gary Anderson
 

When hacking up for ARM, I found some functions defined as int, but did not return a value.
I changed to void. I would imagine it depends on your compiler or options passed to the compiler.

I'm using Arduino 1.85 
Arduino AVR v 1.6.21
Arduino SAMD v1.6.18
on a windows 10 machine.


void menuBand(int btn){ // was int but no return AG5TX
void menuCWSpeed(int btn){ // was int but no return AG5TX

Regards,
Gary
Ag5TX


freefuel@...
 

Gary,

1) I sourced a different version of the source that has CAT features and the stripped down Si5351a library and it seems to compile fine.  
2) I first want to backup the code on the Raduino as a precautionary measure.
3) how the heck to you solder the header pins to the NANO board with it already installed?
4) what started all this is a desire to test the frequency limits of the uBITX board. I'm interested in playing on 2 Meters. 

-Justin N2TOH 


M Garza <mgarza896@...>
 

Justin,
You are making things harder than they need to be.  You can always download the factory software from here:  https://github.com/afarhan/ubitx.  
Compile and install again.  Not a big deal & no soldering needed.

Hope this helps,

Marco - KG5PRT


On Thu, May 10, 2018 at 8:42 PM, <freefuel@...> wrote:
Gary,

1) I sourced a different version of the source that has CAT features and the stripped down Si5351a library and it seems to compile fine.  
2) I first want to backup the code on the Raduino as a precautionary measure.
3) how the heck to you solder the header pins to the NANO board with it already installed?
4) what started all this is a desire to test the frequency limits of the uBITX board. I'm interested in playing on 2 Meters. 

-Justin N2TOH 



M Garza <mgarza896@...>
 

Justin,
I just downloaded the zip file, unpacked it and double-clicked on the ubitx_20.ino file.  The IDE opened and I compiled it with no issues.
Make sure you have the Etherkit SI5351 (v2.0.1 or higher) library installed.  I have the version listed and it compiles for me.

Hope this helps,

Marco - KG5PRT

On Fri, May 11, 2018 at 12:35 AM, M Garza <mgarza896@...> wrote:
Justin,
You are making things harder than they need to be.  You can always download the factory software from here:  https://github.com/afarhan/ubitx.  
Compile and install again.  Not a big deal & no soldering needed.

Hope this helps,

Marco - KG5PRT


On Thu, May 10, 2018 at 8:42 PM, <freefuel@...> wrote:
Gary,

1) I sourced a different version of the source that has CAT features and the stripped down Si5351a library and it seems to compile fine.  
2) I first want to backup the code on the Raduino as a precautionary measure.
3) how the heck to you solder the header pins to the NANO board with it already installed?
4) what started all this is a desire to test the frequency limits of the uBITX board. I'm interested in playing on 2 Meters. 

-Justin N2TOH 




Gary Anderson
 

The code from https://github.com/afarhan/ubitx uses Jerry's much lighter code to control the SI5351.  (thanks Jerry)

What you probably do want to back-up is the data from the EEPROM. 
I don't know if some values are set by calibration at the factory, or if they are universal.  I assume some NOT universal, since the c-code doesn't set default values if not programmed.
I bet someone reading this post could provide that insight / confirmation.
I wanted to know what mine had anyways, maybe save myself from unnecessary extra work.
You could write a sketch to print out the EEPROM data.  But since Ian KD8CEC has already provided an EEPROM data manager, I used his kindly provided application.
Of course to use Ian's EEPROM data manager, you first need to upload his sketch to your Arduino. I used CEC_V1.063
Ian uses additional EEPROM space in his code for additional settings.  Factory used EEPROM addresses remain the same.

For my board:
MASTER_CAL 171500
USB_CAL 11995250
The rest of the values either get set in the c-code to default values if not already in the EEPROM/ out of range, or don't appear to be used.

Here's my hacking code snippet:

#ifndef NO_EEPROM // use address
   #define MASTER_CAL 0
   #define LSB_CAL 4
   #define USB_CAL 8
   #define SIDE_TONE 12
   //these are ids of the vfos as well as their offset into the eeprom storage, don't change these 'magic' values
   #define VFO_A 16
   #define VFO_B 20
   #define CW_SIDETONE 24
   #define CW_SPEED 28
#else // use values
   #define MASTER_CAL 171500 // as read by uBitx manager
   #define LSB_CAL 0         // ?not used?
   #define USB_CAL 11995250  // as read by uBitx manager
   #define SIDE_TONE 0       // ?not used?
   #define VFO_A 7150000     // default value from orig code
   #define VFO_B 14200000    // default value from orig code
   #define CW_SIDETONE 800   // default value from orig code
   #define CW_SPEED 100      // default value from orig code
#endif

Regards,
Gary
AG5TX





freefuel@...
 

ah Thank you Marco, I will make sure I have that library installed. that may be the reason I keep getting compile errors for the original code. 

-Justin N2TOH 


freefuel@...
 

This is the error I get when trying to compile the original code. 

Arduino: 1.8.6 Hourly Build 2018/05/03 04:12 (Mac OS X), Board: "Arduino Nano, ATmega328P"
 
Build options changed, rebuilding all
/Users/user/Downloads/ubitx-master/ubitx_20/ubitx_menu.ino: In function 'int menuBand(int)':
ubitx_menu:26:5: error: expected primary-expression before 'return'
 *   return;
     ^
/Users/user/Downloads/ubitx-master/ubitx_20/ubitx_menu.ino: In function 'int menuCWSpeed(int)':
ubitx_menu:211:7: error: expected primary-expression before 'return'
 *     return;
       ^
exit status 1
expected primary-expression before 'return'
 
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


-Justin N2TOH 


Gary Anderson
 

Hi Justin.  I must have been too vague in my original answer, to be helpful.

...  I found some functions defined as int, but did not return a value.  I changed to void......
void menuBand(int btn){ // was int but no return AG5TX
void menuCWSpeed(int btn){ // was int but no return AG5TX

Thanks for including your compile errors.
Let's look at the compiler error message
/Users/user/Downloads/ubitx-master/ubitx_20/ubitx_menu.ino: In function 'int menuBand(int)':
/Users/user/Downloads/ubitx-master/ubitx_20/ubitx_menu.ino: In function 'int menuCWSpeed(int)':

this tell us that the function is still declared as an "init",
but the function doesn't return a value so the compiler is not happy.

Both of these functions are in the ubitx_menu.ino file, can be found / edited in the ubitx_menu tab in the Arduino IDE

Change:
int menuBand(int btn){      to      void menuBand(int btn){
int menuCWSpeed(int btn){    to   void menuCWSpeed(int btn){

This should fix your problem.
Regards,
Gary
Ag5TX