Problem compiling PHSNA_VB.ino


jimandmargery@...
 

Hi, 

I guess this must be operator error(s), but I'm struggling with this. 

Using Arduino 1.6.6 with the .ino files downloaded from Windows PHSNA, rev 1.6 dated March 31.  I read the previous posts on this, the tone.h library has been installed, and appears to have been corrected. 

This is a sample of the errors i get: 

Define MORSE 1

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void setup()':
PHSNA_VB:422: error: 'morse_setup' was not declared in this scope
  morse_setup(); // IF MORSE IS USED
              ^
/home/jim/PHSNA_VB/Morse.ino: At global scope:
Morse:51: error: redefinition of 'unsigned int pitch'
 unsigned int pitch = 600; // local peak for CEM-1201(50)

etc etc..

Define MORSE 0

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void loop()':
PHSNA_VB:456: error: 'morse_rf' was not declared in this scope
  morse_rf = 1; // turn on rf sending
  ^
PHSNA_VB:457: error: 'morse_spkr' was not declared in this scope
  morse_spkr = 0; // turn on audio morse sending

etc...

Same result on my desktop PC running Windows 10, and this laptop running Ubuntu. 

Appreciate any help to straighten me out. 

73

Jim - G3ZQC


Nick Kennedy
 

Hi Jim,

The tone.h library isn't required because PHSNA doesn't do Morse in audio - it does it in RF by keying the DDS on and off.

It sounds like you may not have the source file Morse.ino in the same folder as PHSNA_VB.ino.  Because that's where the missing functions your errors speak of are located.

73-

Nick, WA5BDU


On Fri, Dec 11, 2015 at 5:06 AM, jimandmargery@... [PHSNA] <PHSNA@...> wrote:
 

Hi, 

I guess this must be operator error(s), but I'm struggling with this. 

Using Arduino 1.6.6 with the .ino files downloaded from Windows PHSNA, rev 1.6 dated March 31.  I read the previous posts on this, the tone.h library has been installed, and appears to have been corrected. 

This is a sample of the errors i get: 

Define MORSE 1

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void setup()':
PHSNA_VB:422: error: 'morse_setup' was not declared in this scope
  morse_setup(); // IF MORSE IS USED
              ^
/home/jim/PHSNA_VB/Morse.ino: At global scope:
Morse:51: error: redefinition of 'unsigned int pitch'
 unsigned int pitch = 600; // local peak for CEM-1201(50)

etc etc..

Define MORSE 0

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void loop()':
PHSNA_VB:456: error: 'morse_rf' was not declared in this scope
  morse_rf = 1; // turn on rf sending
  ^
PHSNA_VB:457: error: 'morse_spkr' was not declared in this scope
  morse_spkr = 0; // turn on audio morse sending

etc...

Same result on my desktop PC running Windows 10, and this laptop running Ubuntu. 

Appreciate any help to straighten me out. 

73

Jim - G3ZQC



K5ESS
 

Make sure the case of the letters in the variable names match those where the variable is defined.  I’ve forgotten to capitalize some letters and gotten the “ ‘  ‘ was not declared in this scope “ error.  May not be the problem.  Just a suggestion.

Mike K5ESS  

 

From: PHSNA@... [mailto:PHSNA@...]
Sent: Friday, December 11, 2015 5:07 AM
To: PHSNA@...
Subject: [PHSNA] Problem compiling PHSNA_VB.ino

 

 

Hi, 

I guess this must be operator error(s), but I'm struggling with this. 

Using Arduino 1.6.6 with the .ino files downloaded from Windows PHSNA, rev 1.6 dated March 31.  I read the previous posts on this, the tone.h library has been installed, and appears to have been corrected. 

This is a sample of the errors i get: 

Define MORSE 1

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void setup()':
PHSNA_VB:422: error: 'morse_setup' was not declared in this scope
  morse_setup(); // IF MORSE IS USED
              ^
/home/jim/PHSNA_VB/Morse.ino: At global scope:
Morse:51: error: redefinition of 'unsigned int pitch'
 unsigned int pitch = 600; // local peak for CEM-1201(50)

etc etc..

Define MORSE 0

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void loop()':
PHSNA_VB:456: error: 'morse_rf' was not declared in this scope
  morse_rf = 1; // turn on rf sending
  ^
PHSNA_VB:457: error: 'morse_spkr' was not declared in this scope
  morse_spkr = 0; // turn on audio morse sending

etc...

Same result on my desktop PC running Windows 10, and this laptop running Ubuntu. 

Appreciate any help to straighten me out. 

73

Jim - G3ZQC


Jim Smith <jimandmargery@...>
 

Hi Mike and Nick, 
Thanks for your responses. 
Mike I did a 'find' for the missing variables ignoring case, and didn't find them in morse.ino. 
Nick - the #include Tone.h is commented out in PHSNA_VB.ino, but still there in Morse.ino.  Which is why I added it.  Both ino files are in the same directory.  The variables it seems to be complaining about; morse_rf and morse_spkr are only declared in the conditional assembly - MORSE - which I set to zero.  morse_setup() doesn't exist in my copy of Morse.ino. 

73

Jim - G3ZQC

On 11 December 2015 at 14:41, Nick Kennedy kennnick@... [PHSNA] <PHSNA@...> wrote:
 

Hi Jim,

The tone.h library isn't required because PHSNA doesn't do Morse in audio - it does it in RF by keying the DDS on and off.

It sounds like you may not have the source file Morse.ino in the same folder as PHSNA_VB.ino.  Because that's where the missing functions your errors speak of are located.

73-

Nick, WA5BDU


On Fri, Dec 11, 2015 at 5:06 AM, jimandmargery@... [PHSNA] <PHSNA@...> wrote:
 

Hi, 

I guess this must be operator error(s), but I'm struggling with this. 

Using Arduino 1.6.6 with the .ino files downloaded from Windows PHSNA, rev 1.6 dated March 31.  I read the previous posts on this, the tone.h library has been installed, and appears to have been corrected. 

This is a sample of the errors i get: 

Define MORSE 1

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void setup()':
PHSNA_VB:422: error: 'morse_setup' was not declared in this scope
  morse_setup(); // IF MORSE IS USED
              ^
/home/jim/PHSNA_VB/Morse.ino: At global scope:
Morse:51: error: redefinition of 'unsigned int pitch'
 unsigned int pitch = 600; // local peak for CEM-1201(50)

etc etc..

Define MORSE 0

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void loop()':
PHSNA_VB:456: error: 'morse_rf' was not declared in this scope
  morse_rf = 1; // turn on rf sending
  ^
PHSNA_VB:457: error: 'morse_spkr' was not declared in this scope
  morse_spkr = 0; // turn on audio morse sending

etc...

Same result on my desktop PC running Windows 10, and this laptop running Ubuntu. 

Appreciate any help to straighten me out. 

73

Jim - G3ZQC




Nick Kennedy
 

Jim,

I downloaded the latest from the Yahoo group to make sure we are looking at the same files.  It looks like you have the wrong version of Morse.ino.  Based on what you said, I just checked the one I just got from the group and it does not have an include for tone.h and it does have morse_setup().

You should find the two files in the Windows PHSNA folder of the group.

73-

Nick, WA5BDU

On Fri, Dec 11, 2015 at 10:42 AM, Jim Smith jimandmargery@... [PHSNA] <PHSNA@...> wrote:
 

Hi Mike and Nick, 
Thanks for your responses. 
Mike I did a 'find' for the missing variables ignoring case, and didn't find them in morse.ino. 
Nick - the #include Tone.h is commented out in PHSNA_VB.ino, but still there in Morse.ino.  Which is why I added it.  Both ino files are in the same directory.  The variables it seems to be complaining about; morse_rf and morse_spkr are only declared in the conditional assembly - MORSE - which I set to zero.  morse_setup() doesn't exist in my copy of Morse.ino. 

73

Jim - G3ZQC

On 11 December 2015 at 14:41, Nick Kennedy kennnick@... [PHSNA] <PHSNA@...> wrote:
 

Hi Jim,

The tone.h library isn't required because PHSNA doesn't do Morse in audio - it does it in RF by keying the DDS on and off.

It sounds like you may not have the source file Morse.ino in the same folder as PHSNA_VB.ino.  Because that's where the missing functions your errors speak of are located.

73-

Nick, WA5BDU


On Fri, Dec 11, 2015 at 5:06 AM, jimandmargery@... [PHSNA] <PHSNA@...> wrote:
 

Hi, 

I guess this must be operator error(s), but I'm struggling with this. 

Using Arduino 1.6.6 with the .ino files downloaded from Windows PHSNA, rev 1.6 dated March 31.  I read the previous posts on this, the tone.h library has been installed, and appears to have been corrected. 

This is a sample of the errors i get: 

Define MORSE 1

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void setup()':
PHSNA_VB:422: error: 'morse_setup' was not declared in this scope
  morse_setup(); // IF MORSE IS USED
              ^
/home/jim/PHSNA_VB/Morse.ino: At global scope:
Morse:51: error: redefinition of 'unsigned int pitch'
 unsigned int pitch = 600; // local peak for CEM-1201(50)

etc etc..

Define MORSE 0

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void loop()':
PHSNA_VB:456: error: 'morse_rf' was not declared in this scope
  morse_rf = 1; // turn on rf sending
  ^
PHSNA_VB:457: error: 'morse_spkr' was not declared in this scope
  morse_spkr = 0; // turn on audio morse sending

etc...

Same result on my desktop PC running Windows 10, and this laptop running Ubuntu. 

Appreciate any help to straighten me out. 

73

Jim - G3ZQC





Jim Smith <jimandmargery@...>
 

Nick, 

Re(re)downloaded the files from Windows PHSNA folder, and this time no '#include Tone.h', and it compiled fine.  Don't understand what happened there. 

Thanks again. 

73

Jim - G3ZQC

On 11 December 2015 at 17:08, Nick Kennedy kennnick@... [PHSNA] <PHSNA@...> wrote:
 

Jim,

I downloaded the latest from the Yahoo group to make sure we are looking at the same files.  It looks like you have the wrong version of Morse.ino.  Based on what you said, I just checked the one I just got from the group and it does not have an include for tone.h and it does have morse_setup().

You should find the two files in the Windows PHSNA folder of the group.

73-

Nick, WA5BDU

On Fri, Dec 11, 2015 at 10:42 AM, Jim Smith jimandmargery@... [PHSNA] <PHSNA@...> wrote:
 

Hi Mike and Nick, 
Thanks for your responses. 
Mike I did a 'find' for the missing variables ignoring case, and didn't find them in morse.ino. 
Nick - the #include Tone.h is commented out in PHSNA_VB.ino, but still there in Morse.ino.  Which is why I added it.  Both ino files are in the same directory.  The variables it seems to be complaining about; morse_rf and morse_spkr are only declared in the conditional assembly - MORSE - which I set to zero.  morse_setup() doesn't exist in my copy of Morse.ino. 

73

Jim - G3ZQC

On 11 December 2015 at 14:41, Nick Kennedy kennnick@... [PHSNA] <PHSNA@...> wrote:
 

Hi Jim,

The tone.h library isn't required because PHSNA doesn't do Morse in audio - it does it in RF by keying the DDS on and off.

It sounds like you may not have the source file Morse.ino in the same folder as PHSNA_VB.ino.  Because that's where the missing functions your errors speak of are located.

73-

Nick, WA5BDU


On Fri, Dec 11, 2015 at 5:06 AM, jimandmargery@... [PHSNA] <PHSNA@...> wrote:
 

Hi, 

I guess this must be operator error(s), but I'm struggling with this. 

Using Arduino 1.6.6 with the .ino files downloaded from Windows PHSNA, rev 1.6 dated March 31.  I read the previous posts on this, the tone.h library has been installed, and appears to have been corrected. 

This is a sample of the errors i get: 

Define MORSE 1

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void setup()':
PHSNA_VB:422: error: 'morse_setup' was not declared in this scope
  morse_setup(); // IF MORSE IS USED
              ^
/home/jim/PHSNA_VB/Morse.ino: At global scope:
Morse:51: error: redefinition of 'unsigned int pitch'
 unsigned int pitch = 600; // local peak for CEM-1201(50)

etc etc..

Define MORSE 0

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void loop()':
PHSNA_VB:456: error: 'morse_rf' was not declared in this scope
  morse_rf = 1; // turn on rf sending
  ^
PHSNA_VB:457: error: 'morse_spkr' was not declared in this scope
  morse_spkr = 0; // turn on audio morse sending

etc...

Same result on my desktop PC running Windows 10, and this laptop running Ubuntu. 

Appreciate any help to straighten me out. 

73

Jim - G3ZQC






anglerhamming
 

Nick,
I'm getting the PHSNA set up (finally). LPM, SNA and Measurement receiver all built. I'm trying to get the PHSNA.exe to work. I've changed the PHSNA_VB.ino to use the AD9850, but I can't get the file to compile or load. It has the error as "can't find tone.h". Interestingly, with the parameters file set to the one that Jim provided for the AD9850, the PHSNA.exe file does start up with 7.040 and AD9850

Looking back at the messages, you now have the Morse function enabled in the .ino file in the latest version in the Files section. From where does the program get the tone.h header file?

I have the Arduino Uno Rev3 as COM3, and I've confirmed that it is not bricked. I checked that with a USB View-derivative program that runs in XP.  Initially I built the SNA with a "Funduino" Rev 3 clone with the same result, so I swapped in the Arduino Rev 3 board just to check. The PHSNA.exe application does not recognize the COM3 port, and it freezes when I change it to COM3 in the drop down. I'm running Windows XP on an old Dell Dimension 2200 workstation with 512MB RAM, the only XP machine I have.

Do I need to comment out all references to the Morse.ino in the PHSNA_VB.ino? Is something else causing the communication error? This is my first time using an Arduino, obviously.

By the way, I've changed my Yahoo ID from "Kilocyles" to the rather cumbersome one that I have now, following the massive hack.

Tnx,
Ted, KX4OM


anglerhamming
 

Okay, back to basics. I'm going to use Term232.exe and instructions for loading for loading the code that are in the "how_to_compile_&_program.txt" file that is in some of the earlier folders in the Files section.

Ted, KX4OM


Nick Kennedy
 

Hi All,

I'm off babysitting my grand-daughter (with grandma) this weekend and don't have the resources handy to try to answer the question. I remember all the "tone.h" and "morse" stuff from before, but not the details.

I'll try a compile when I get home (Tuesday).  I've upgraded to Windows 10 also and don't think I've tried a compile on it yet.

73-

Nick, WA5BDU


On Dec 11, 2015 5:06 AM, "jimandmargery@... [PHSNA]" <PHSNA@...> wrote:
 

Hi, 

I guess this must be operator error(s), but I'm struggling with this. 

Using Arduino 1.6.6 with the .ino files downloaded from Windows PHSNA, rev 1.6 dated March 31.  I read the previous posts on this, the tone.h library has been installed, and appears to have been corrected. 

This is a sample of the errors i get: 

Define MORSE 1

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void setup()':
PHSNA_VB:422: error: 'morse_setup' was not declared in this scope
  morse_setup(); // IF MORSE IS USED
              ^
/home/jim/PHSNA_VB/Morse.ino: At global scope:
Morse:51: error: redefinition of 'unsigned int pitch'
 unsigned int pitch = 600; // local peak for CEM-1201(50)

etc etc..

Define MORSE 0

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void loop()':
PHSNA_VB:456: error: 'morse_rf' was not declared in this scope
  morse_rf = 1; // turn on rf sending
  ^
PHSNA_VB:457: error: 'morse_spkr' was not declared in this scope
  morse_spkr = 0; // turn on audio morse sending

etc...

Same result on my desktop PC running Windows 10, and this laptop running Ubuntu. 

Appreciate any help to straighten me out. 

73

Jim - G3ZQC


Marcus Gustafsson
 

You could try my cleaned up version of the Arduino code available in the SA5PMG_software folder.
/Marcus, SA5PMG


Steve Arntz <km5ht@...>
 

Nick;
    I am using windows 10.  I have PHSNA_VB.INO and MORSE.INO in the same folder and just verified that it compiles ok.  I am using an Arduino Nano also.  I don’t remember jumping through any special hoops to get it to compile, but that was a while ago.
 
73 Steve, KM5HT


Nick Kennedy
 

OK I'm back home and, I've been looking at the code and trying to remember why I still have a file called "Morse.ino" in the project.

Originally, I had a small speaker in the box with the Arduino and DDS so the program could send audible error codes and so forth in Morse. It was mostly just for me.

Eventually, I removed that feature and got rid of Morse.ino.  When I did that common problems with the library file tone.h went away since it was no longer being called.

Later, I decided to add a feature to the Windows PHSNA program that would allow it to command the Arduino hardware to send a message in Morse via the RF output. This feature is still active. I added the file Morse.ino back to the project, but got rid of the parts that were used to send Morse via a local speaker and added functions (to both files) to allow sending Morse in RF by turning the DDS output ON and OFF.

There are still some bits of active code that were related to the speaker Morse function, but they aren't called and won't result in a search for tone.h.

So possibly you don't have the latest source code.

Here's what my note on my 3/31/2015 change to the PHSNA_VB.ino code said:

// Revision 1.6 of 3/31/2015 -- Users having trouble building the file because library
// tone.h can't be found.  I don't know why, but we really don't use that library with 
// PHSNA, so I'm taking it out as well as all calls to tone() functions.

I did a "verify compile" with the Arduino IDE using Windows 10 today and didn't get any errors. However to be 100% honest, I have made a few changes since 3/31/2015 that haven't been released yet. So MY code isn't totally identical to that on the site. If you download again and still have the problem, I'll need to download from the site too, and see I get a good compile.

73,

Nick, WA5BDU



On Fri, Dec 11, 2015 at 5:06 AM, jimandmargery@... [PHSNA] <PHSNA@...> wrote:
 

Hi, 

I guess this must be operator error(s), but I'm struggling with this. 

Using Arduino 1.6.6 with the .ino files downloaded from Windows PHSNA, rev 1.6 dated March 31.  I read the previous posts on this, the tone.h library has been installed, and appears to have been corrected. 

This is a sample of the errors i get: 

Define MORSE 1

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void setup()':
PHSNA_VB:422: error: 'morse_setup' was not declared in this scope
  morse_setup(); // IF MORSE IS USED
              ^
/home/jim/PHSNA_VB/Morse.ino: At global scope:
Morse:51: error: redefinition of 'unsigned int pitch'
 unsigned int pitch = 600; // local peak for CEM-1201(50)

etc etc..

Define MORSE 0

/home/jim/PHSNA_VB/PHSNA_VB.ino: In function 'void loop()':
PHSNA_VB:456: error: 'morse_rf' was not declared in this scope
  morse_rf = 1; // turn on rf sending
  ^
PHSNA_VB:457: error: 'morse_spkr' was not declared in this scope
  morse_spkr = 0; // turn on audio morse sending

etc...

Same result on my desktop PC running Windows 10, and this laptop running Ubuntu. 

Appreciate any help to straighten me out. 

73

Jim - G3ZQC



anglerhamming
 

Nick,
Okay, thanks. Good news here. I got the Arduino code to compile and load earlier this afternoon, using an earlier version of the code, the one previous to the current version. I also found out with portfinder.exe that the Arduino is now connected to Com4, not Com3 as it indicated in the XP Device Manager on Friday. Today, the PHSNA.exe would still not run (hung up; I had to kill the process with task manager) until I reenabled Com1, which is the Dell's actual serial port, which I had disabled during troubleshooting on Friday. After that, the executable started up fine and recognized Com4. It looks to be I had too many variables in my setup when I tried it initially on Friday.

The problem I'm now troubleshooting is low output, -20 dBm into the new log power meter. I've calibrated with the CMOS -10 dBm oscillator and the VE7BPO sine oscillator down to -70 dBm with my step attenuator. The readings of the new LPM also concur with my original LPM from Wes' article that I built several years ago, which I also modified earlier this year per the PHSNA spec to be able to get direct dBm readouts on the meter scale (added pots, and used Jim Tonne's Meter Basic program). I've already corrected one cold solder joint on T1 at the junction of the 2 bifilar windings that created intermittent output less than -20 dBm. I'm proceeding with standard troubleshooting and component verification, and it's also possible that the 2N5109 is a fake; I can't recall how long I've had that particular one or where I got it. The DDS is a Type 1, and I've removed the onboard filter components and jumpered it per Jim's instructions.

Using the RF output at it's currently low level -20 dBm connected to my Heathkit counter ( The "counter out" connection is too low to drive the counter at this point), I can run the frequency up and down with the PHSNA.exe program, adjust the steps, and I've looked at the the parameters via the program. You did a fine job with the software development for this project, Nick.

I finished building the XTAL test board earlier last week, and I'm looking forward to using it with the PHSNA.

73,
Ted, KX4OM


anglerhamming
 

The -20 dBm output (as read by my LPMs) issue is fixed. When I do a Reset from the PHSNA.exe software, the ouput drops to background level, and then jumps up to -8 dBm as read on the LPM, which is what I wanted. The Counter output now works as well.

While trying to recheck the setting of AREF, which runs the power up and down as interpreted by the SNA, I managed to pop the LM317 with the test leads. I removed it, and I'll replace it tomorrow. The power level as viewed in the software is different (higher) from the raw feed to the LPM. As I recall, that has been explained in the notes from Jim, I believe. Probably the default Parameters.txt values affect that as well.

Ted, KX4OM


EB4APL
 

Hi Ted,

The default Parameters.txt file is useful as a proof that the system is working, but you need to calibrate both the detector and the frequency response. Detector calibration is performed by the PHSNA Windows program using an external signal generator or a signal source of know power and a step attenuator. For the frequency response calibration you need to bridge the PHSNA  generator output to the detector input and sweep the whole frequency band. The program allows to record the values to a Excel compatible file and then use Excel to draw a graph, fit it to a 5th degree polynomial and obtain the coefficients.   These coefficients must be entered into your Parameters file.  There are detailed instructions in the documentation.

73 de Ignacio, EB4APL


El 15/11/2016 a las 23:46, anglerhamming@... [PHSNA] escribió:
 

The -20 dBm output (as read by my LPMs) issue is fixed. When I do a Reset from the PHSNA.exe software, the ouput drops to background level, and then jumps up to -8 dBm as read on the LPM, which is what I wanted. The Counter output now works as well.

While trying to recheck the setting of AREF, which runs the power up and down as interpreted by the SNA, I managed to pop the LM317 with the test leads. I removed it, and I'll replace it tomorrow. The power level as viewed in the software is different (higher) from the raw feed to the LPM. As I recall, that has been explained in the notes from Jim, I believe. Probably the default Parameters.txt values affect that as well.

Ted, KX4OM





Avast logo

El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
www.avast.com



anglerhamming
 

Hi Ignacio,
Yes, I am in the testing of basic functionality (and repair!) phase now. I just collected all of the information on performing the calibration over the frequency range and put it in one folder on a USB stick, which I am about to take down to the basement lab. One of the reasons that I am using my old Dell workstation in the lab/hamshack for the PHSNA is that it is the only computer that I have with Excel. All of my other ones have LibreOffice, and I didn't want to spend the time figuring out the differences between Excel and Calc for these calculations for curve fitting and the polynomials.

I calibrated my LPM at 10 MHz and -10 dBm, and I am considering that as the maximum calibrated input, although my meter scale goes from -80 to +10 dBm. I adjusted the DC output to the SNA for the fraction of 5 VDC at the -10 dBm point.

Tnx,
Ted, KX4OM