Date   
Re: Easy, Inexpensive Cooling Fan, Excelway Case

Lee
 

I got from eBay a 40mm fan,$1.33, filter/fan guard, $1.43, and a temperature controlled fan controller, $3.58.  At room temperature the fan turns very slow.  You have to put your ear up to it to hear it.  




--
Lee - N9LO  "I Void Warranties"

 

Re: Hijacked: C vs C++

Jerry Gaffke
 

I'm convinced that strcpy() and strncpy() do exactly as described in the documentation.
Either one could be written in 2 or 3 lines of code, there's not much going on.
    http://man7.org/linux/man-pages/man3/strncpy.3.html

And am confident alloc(), malloc(), and free() should work fine as well,
though there's hardly enough RAM in a Nano to bother.
If you do try using these, expect the unexpected when they collide with the stack.
Again, the code to implement these is quite trivial.

Those C++ calls?
Maybe somebody else cares.
I've got enough other stuff in the queue already to fill what few neurons I have left.
Memory allocation issues apply to domains well beyond that of gcc.

The moderately interesting thing here is that locations in RAM for global variables
are not necessarily allocated in the order we might have expected. 
This is also true of things like structures and unions.

Jerry, KE7ER




On Thu, Jul 5, 2018 at 08:59 am, Arv Evans wrote:
Might be interesting to dump the machine code resulting from that to see exactly what the
compiler is doing with strncpy versus strcpy. 

Wonder if anyone has tried alloc(), malloc(), and free() with the Arduino IDE?
What about new(), and delete() for C++ ?

THANKS #off_topic

Robert Ogburn
 

I feel honored to be a part of this community.  
Thanks to all who participate and share.
N5LXK Coahoma Texas
DM92ih

Re: Hijacked: C vs C++

Arv Evans
 

Jerry and Jack

Might be interesting to dump the machine code resulting from that to see exactly what the
compiler is doing with strncpy versus strcpy. 

Wonder if anyone has tried alloc(), malloc(), and free() with the Arduino IDE?
Arv
_._


On Thu, Jul 5, 2018 at 9:49 AM Jerry Gaffke via Groups.Io <jgaffke=yahoo.com@groups.io> wrote:
I doubt this code:  "strncpy(temp, "12345", 5);" is storing a null anywhere.
You just happen to have had a handy zero somewhere in RAM to terminate it.
And the handy zero may or may not be from the "int val=0;"  .


I tried this under Ubuntu with gcc 4.8.4:

#################################
#include <stdio.h>
#include <string.h>
char bufa[6];
char z;
char bufb[4];
main() {
   strncpy(bufa, "hello", 6);
   z = 'Z';
   strncpy(bufb, "abcdefgh", 4);
   printf("%s %c %s \n", bufa, z, bufb);
}
########################################

That program gives the following output:     hello Z abcdhello 
 
Conclusions I draw from this:
    strncpy() works exactly as documented, it is copying over the 4 letters "abcd" and no terminating null character
    bufa[] follows (does not precede!) bufb[] in memory, and z is off somewhere else entirely.

The strncpy() function is much safer than strcpy() so long as the bytecount you give it agrees with the buffer size.
This is an excellent opportunity to use a #define:

#define BUFBSZ  4
char bufb[BUFBSZ];
   strncpy(bufb, "abcdefgh", BUFBSZ);

The fact that reading the string back goes beyond the end of the buffer allocated 
is not nearly so dangerous as having an overflow when writing.

All bets are off regarding exactly how the compiler is going to allocate RAM.
The Arduino IDE is also using gcc, so I'd expect similar results when programming a Nano.

Jerry, KE7ER


On Thu, Jul 5, 2018 at 06:20 am, Jack Purdum wrote:
That's not necessarily bulletproof, either, but a step in the right direction. Try this:
 
void setup() {

  char temp[5];
  int val = 0;
  Serial.begin(115200);
  while (!Serial);                // Necessary on some faster Arduinos, like the Due

  strncpy(temp, "12345", 5);
  Serial.print("temp = ");
  Serial.print(temp);
  Serial.print("# val = ");
  Serial.println(val);
}

void loop() {
}
 
It prints out "12345". The fact that it prints out the entire string means the string termination character is stored...where? The documentation for strncpy() states:
 
    No null-character is implicitly appended at the end of destination if source is longer than num. Thus, in this case, destination shall not be considered
    a null terminated C string (reading it as such would overflow).
 
Moral: The strn*() function don't guarantee  protection against buffer overflow. It simply means you're thinking about it.
 
Jack, W8TEE
 
. . .

Re: Hijacked: C vs C++

Jerry Gaffke
 

I doubt this code:  "strncpy(temp, "12345", 5);" is storing a null anywhere.
You just happen to have had a handy zero somewhere in RAM to terminate it.
And the handy zero may or may not be from the "int val=0;"  .


I tried this under Ubuntu with gcc 4.8.4:

#################################
#include <stdio.h>
#include <string.h>
char bufa[6];
char z;
char bufb[4];
main() {
   strncpy(bufa, "hello", 6);
   z = 'Z';
   strncpy(bufb, "abcdefgh", 4);
   printf("%s %c %s \n", bufa, z, bufb);
}
########################################

That program gives the following output:     hello Z abcdhello 
 
Conclusions I draw from this:
    strncpy() works exactly as documented, it is copying over the 4 letters "abcd" and no terminating null character
    bufa[] follows (does not precede!) bufb[] in memory, and z is off somewhere else entirely.

The strncpy() function is much safer than strcpy() so long as the bytecount you give it agrees with the buffer size.
This is an excellent opportunity to use a #define:

#define BUFBSZ  4
char bufb[BUFBSZ];
   strncpy(bufb, "abcdefgh", BUFBSZ);

The fact that reading the string back goes beyond the end of the buffer allocated 
is not nearly so dangerous as having an overflow when writing.

All bets are off regarding exactly how the compiler is going to allocate RAM.
The Arduino IDE is also using gcc, so I'd expect similar results when programming a Nano.

Jerry, KE7ER


On Thu, Jul 5, 2018 at 06:20 am, Jack Purdum wrote:
That's not necessarily bulletproof, either, but a step in the right direction. Try this:
 
void setup() {

  char temp[5];
  int val = 0;
  Serial.begin(115200);
  while (!Serial);                // Necessary on some faster Arduinos, like the Due

  strncpy(temp, "12345", 5);
  Serial.print("temp = ");
  Serial.print(temp);
  Serial.print("# val = ");
  Serial.println(val);
}

void loop() {
}
 
It prints out "12345". The fact that it prints out the entire string means the string termination character is stored...where? The documentation for strncpy() states:
 
    No null-character is implicitly appended at the end of destination if source is longer than num. Thus, in this case, destination shall not be considered
    a null terminated C string (reading it as such would overflow).
 
Moral: The strn*() function don't guarantee  protection against buffer overflow. It simply means you're thinking about it.
 
Jack, W8TEE
 
. . .

Re: Known issues on uBITX r4 #ubitx

Russ KG0BK
 

Agreed. My uBitx when set at 12.6 volts draws about 2.4 amps.

Re: Nextion display bezel

Art Olson
 

Gary

I selected PETG. looks great

73
Art N2AJO

On Jul 5, 2018, at 8:22 AM, Gary Hanson <grhanson@...> wrote:

Art Olson,

When ordering a bezel for the Nextion display, I noticed that 3D Hubs offered 8 different types of plastic options. I wondered what you used?


Gary Hanson

Re: Analog Smeter #smeter

JEAN-LUC F6HOY
 

Thanks for good adress.
 A little bit more expensive than from China (i am not a Prime member). And no shipping to France... Snif...
73

Re: Easy, Inexpensive Cooling Fan, Excelway Case

Gary Anderson
 

Thanks Mike for highlighting my misunderstanding about how CW is implemented on the uBITX!
I should have reviewed the source code / schematics before posting, pretty obvious when I look at it :)
.. the difference between energizing the "TX" and the "CW-KEY"

Best Regards,
Gary

Re: Bitx40 75KHz Spurious, How to solve it. #bitx40

Skip Davis
 

Great work Akira, thanks for the pictures.

Skip Davis, NC9O

On Jul 5, 2018, at 05:12, jj1epe@... wrote:

Akira

Re: Completed my QCX #ubitx

Art Olson
 

Judd

Great job. I added a button also. Easier to access menu. Where did you get your folding kickstand 

Art- N2AJO 


On Jul 5, 2018, at 8:55 AM, pat griffin <patgriffin@...> wrote:

Nice job.

Also, I see you are using the S meter and v 1.094 firmware as am I. Can you tell me the range in uBitx Manager you are seeing for the s-meter readings and if you are using the AGC circuit?

Thanks,

Pat AA4PG



From: BITX20@groups.io <BITX20@groups.io> on behalf of WD8WV <juddie.d.burgess@...>
Sent: Thursday, July 5, 2018 6:27:38 AM
To: BITX20@groups.io
Subject: Re: [BITX20] Completed my QCX #ubitx
 
Updated picture.

I added a momentary button just right if the VFO to access the menu options so I wouldn’t have to push the VFO, which I still can.  Also added a folding kickstand so when on the bench the front is elevated.
--
Judd, WD8WV

Re: Hijacked: C vs C++

Jack, W8TEE
 

That's not necessarily bulletproof, either, but a step in the right direction. Try this:

void setup() {

  char temp[5];
  int val = 0;
  Serial.begin(115200);
  while (!Serial);                // Necessary on some faster Arduinos, like the Due

  strncpy(temp, "12345", 5);
  Serial.print("temp = ");
  Serial.print(temp);
  Serial.print("# val = ");
  Serial.println(val);
}

void loop() {
}

It prints out "12345". The fact that it prints out the entire string means the string termination character is stored...where? The documentation for strncpy() states:

    No null-character is implicitly appended at the end of destination if source is longer than num. Thus, in this case, destination shall not be considered
    a null terminated C string (reading it as such would overflow).

Moral: The strn*() function don't guarantee  protection against buffer overflow. It simply means you're thinking about it.

Jack, W8TEE

On Thursday, July 5, 2018, 8:56:00 AM EDT, Brian Bowling <bowlingb@...> wrote:


How about making your programming safer and more robust?  Strcat() and strcpy() can be found at the root of so many buffer overflows. If you must use them at least use the 'n' versions strncpy() and strncat(). 

Brian

Re: Hijacked: C vs C++

Brian Bowling
 

How about making your programming safer and more robust?  Strcat() and strcpy() can be found at the root of so many buffer overflows. If you must use them at least use the 'n' versions strncpy() and strncat(). 

Brian

Re: Completed my QCX #ubitx

pat griffin
 

Nice job.

Also, I see you are using the S meter and v 1.094 firmware as am I. Can you tell me the range in uBitx Manager you are seeing for the s-meter readings and if you are using the AGC circuit?

Thanks,

Pat AA4PG


Pat Griffin
http://www.cahabatechnology.com/aa4pg.html


From: BITX20@groups.io <BITX20@groups.io> on behalf of WD8WV <juddie.d.burgess@...>
Sent: Thursday, July 5, 2018 6:27:38 AM
To: BITX20@groups.io
Subject: Re: [BITX20] Completed my QCX #ubitx
 
Updated picture.

I added a momentary button just right if the VFO to access the menu options so I wouldn’t have to push the VFO, which I still can.  Also added a folding kickstand so when on the bench the front is elevated.
--
Judd, WD8WV

Re: Completed my QCX #ubitx

Jack, W8TEE
 

Very nice!

Jack, W8TEE

On Thursday, July 5, 2018, 8:27:52 AM EDT, WD8WV <juddie.d.burgess@...> wrote:


Updated picture.

I added a momentary button just right if the VFO to access the menu options so I wouldn’t have to push the VFO, which I still can.  Also added a folding kickstand so when on the bench the front is elevated.
--
Judd, WD8WV

Re: Analog Smeter #smeter

Dennis Zabawa
 

Re: Completed my QCX #ubitx

WD8WV
 

Updated picture.

I added a momentary button just right if the VFO to access the menu options so I wouldn’t have to push the VFO, which I still can.  Also added a folding kickstand so when on the bench the front is elevated.
--
Judd, WD8WV

Re: Completed my QCX #ubitx

WD8WV
 

It is a 2.8 Nextion screen.  Thanks!
--
Judd, WD8WV

Nextion display bezel

Gary Hanson
 

Art Olson,

When ordering a bezel for the Nextion display, I noticed that 3D Hubs offered 8 different types of plastic options. I wondered what you used?


Gary Hanson

Re: Analog Smeter #smeter

w4rjp
 

Jean-Luc,

Thanks for sharing your BitX modifications, especially the Analog S meter. I collect D'Arsonval meters and like the retro look for my radios.

73, Bob W4RJP