Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- BITX20
- Messages
Search
Re: zbitx, compiler optimizations
#zbitx
¿ªÔÆÌåÓý
OK, I guess I should read that thread. I think the i2c communication must be excessive in general. ?It makes audible noise (everybody¡¯s complaining about ¡°chugging"), but I¡¯ve also found that when I have a USB ethernet adapter attached, communication there makes noise too. ?(Of course, the electrical design could be better, but I don¡¯t yet know how to pinpoint why that is happening.). (To me it sometimes sounds like hard drive seeking noises. ?;-) ?One obvious solution to do less communication is using notifications/signals: each field should notify when it has changed (only when the stored value really changed), and that should trigger the updates: those that go to the GTK UI, i2c UI update commands, and/or some network protocols. ?In Qt one uses signals: ? But I think gtk/glib has something like that too. ?? leads to?? : yep that looks like what we need. For 9p I just tried an explicit callback first (and I¡¯m not calling it from enough places yet): void notify_field_changed(const char *field_id, const char *old, const char *newval); The implementation of this function could take care of notifying the various UIs and network protocols. ?But probably it should rather emit a signal: each ¡°client¡± should subscribe for notifications. ??is something that just about everybody has to do at some point... Sbitx/zbitx is doing too much polling and timer-based refresh instead, and that is creating a lot of inefficiency. ?Especially with the excessive string comparison and conversion going on. The network protocol is important to me because I want to decouple the GUI from the radio daemon anyway. ?This daemon will eventually need to avoid using gtk/gdk at all: pure C for the core functionality. ?(Why does zbitx have to run X11 and a GTK UI under the condition that nobody is looking at it? ?Sometimes HDMI is connected, sometimes not. ?We only have 512MB, and startup time is noticeable too.) ?9p is gonna be great for that, eventually, probably. ?I have a working client on Plan 9 now, just rather buggy and incomplete compared to the GTK one. ?I just got a waterfall added to it, without taking much bandwidth (because I only send the latest line of samples at a time; too bad it¡¯s only about 440 actual pixels, despite the memory allocated to hold 1024 * history size). And later I will do a Qt client with the same protocol, for all the other platforms. ?That one can have fancier features. |
Re: zBITX Crashes - Suspect Memory Leak
#zbitx
thanks Jody,
I'll wait for your fix, but I was asking for a copy of 3.021 on an iso or img file format to test your sbitx_gtk.c file.
Idk if theres a ver 3.021 on the official github and if theres 1, idk how to compile to a fresh raspian OS.?
72 de KP4MI? |
Re: zBitx +-2 MHz transmit spurs?
Has any more work been done on finding a way to reduce or eliminate the transmit spurs that some people have found generated by their zBitx? ? The spurs appears to be the intermodulation or mixing of two of the Si5351 clock generator outputs, and can be a few MHz apart, thus not eliminated by the output filters. ?I don't want to connect my zBitx to an antenna if it's generating non-compliant levels of interference well outside the ham bands.
73, Ron, n6ywu |
Re: zBITX Crashes - Suspect Memory Leak
#zbitx
On Thu, May 15, 2025 at 04:56 PM, miguel medina wrote:
Miguel,
?
My version 3.021 sbitx_gtk.c will not run with your version 3.052 system.
?
I will be posting one for version 3.052 based on my latest discovery.?
?
I identifies a quick fix for version 3.052.
?
72,
Jody - K3JZD? ? ? |
Re: zbitx, compiler optimizations
#zbitx
Check my thread about a zBITX Memory Leak.? ?I concluded that the i2cbb.c program in sBitx version 3.052 being used in the xBITX was being swamped with send requests, resulting in a huge number of bus contentions, disconnects, and reconnects.? Odds that has contributed to the large time spent in what has been identified here as 'ic2_delay'.? ? I also identified the root cause of the huge number of send requests that are swamping the ic2 bus handling functions.? ?
?
I also think that the RasPi Zero used in the zBITX has enough horsepower to do the job.? Back when I was doing sales support for custom computerized control systems, and potential customer had spec'ed that they wanted the CPU usage to be 75% maximum, I always asked what they will do with the other 25%.? Sure, we could limit it to that, but why slow down the system for an artificial constraint.
?
Just my opinion.
?
72,
Jody - K3JZD |
Re: zBITX Crashes - Suspect Memory Leak
#zbitx
?
?
Great work, Jody. A quick fix may be to redirect the
Output to /dev/null - see the link
?
https://www.ubuntumint.com/redirect-output-in-linux/ |
Re: zBITX Crashes - Suspect Memory Leak
#zbitx
¿ªÔÆÌåÓýExcellent, Jody!! ?This is incredibly good detective work.A correction, I don¡¯t have a Z bit X, what I have is an SBitx and it seems thoroughly stable On May 15, 2025, at 20:27, Jody - K3JZD via groups.io <k3jzd.jody@...> wrote:
|
Re: zBITX Crashes - Suspect Memory Leak
#zbitx
OK - I have it figured out.? ?It was not a traditional "Memory Leak".? However it was a 'Memory Eater" (a subtle difference)? ?It only ate Memory during sending CW.? It was not a CPU resource issue - there is plenty of CPU to run manual CW with the zBITX ( I can't speak for any other mode ).
?
I had been saying that I have been running my zBITX in Receive Mode.? If I had done exactly that, then mine would have run for hours and hours, much as Gordon's zBITX does.? ?In reality, I have been sending a little CW from time to time, just to check and see if it is still healthy and responsive.? So, for me, it has been maybe 90-95% listening and 5-10% sending CW.
?
Whenever you power up your zBITX, a script called start.sh automatically runs.? ?I'm no linux guru, so don't shoot me if I do not describe this properly.? As I understand it, that script then starts up the sBitx program in a new shell.? Anything that the sBitx program writes out to the console (stdio) is written to this new shell.? ?What was happening was that a program (? i2cbb.c? ) was madly writing error messages to this shell.? But it only did that whenever a CW key was being pressed.? ?So whenever sending CW, this shell kept growing and growing until it eventually ate all of the memory.? The sBitx program did not 'crash', it just eventually became totally unresponsive.? In fact the entire Pi Zero became so sluggish that it took it 15 minutes to produce a directory listing.
?
This ic2bb.c program was writing out messages when (1) it tried to get control of the I2C bus, but could not because the I2C bus was already busy, and (2) whenever it got so backed up with the rush of incoming requests for the I2C bus that it aborted and reconnected.? This? ic2bb.c? program was not changed during the upgrade from version 3.021 to 3.052.? But in version 3.052 it is being called 'a whole lot more'.?
?
I have made an initial fix.? I have tested my initial fix by running my zBITX for the last 4 hours, while periodically sending some CW, and watching the memory usage.? ?What was my initial fix?? ?I commented out all of the messages that I2cbb.c was writing out to this shell, causing it to grow to an astronomical size.
?
So why now in version 3.052 and not in version 3.021?? The root cause was adding in the Interrupts (IRQs) for the manual CW Mode.? ?I see two things that caused the? i2Cbb.c functions to become overwhelmed :? The new IRQs are now being generated on 'Key Contact Closed' and 'Key Contact Open'.? Only Key Contact Closed is needed.? ?And the IRQ processing function is is not debouncing the Key Contact Closed (or Key Contact Opened).? ?What you may think is one Contact Closure generating one Interrupt, is really one Contact Closure generating tens to hundreds of Interrupts. Even though I have inhibited the messages that were causing the memory eating problem, this massive influx of unnecessary interrupts is still occurring and is still overwhelming the functions handling the I2C bus, which is causing unnecessary instability in the device.? ?
?
So,? I will be going back into the version 3.052 sbitx_gtk.c, and making these IRC related changes.? Once I have finished that and have tested it, I will post my new i2cbb.c program and my new sbitx_gtk.c program.
?
If you are inclined to do a quick fix for your i2cbb.c program yourself, just go into it and comment out every? printf()? that is in there.? Then do a? ./build,? power down and power back up.
?
72,
Jody - K3JZD? ? ??
?
?
?? |
Re: zBITX Crashes - Suspect Memory Leak
#zbitx
¿ªÔÆÌåÓý... I admire your tenacious perseverance.
My zBitx will remain off until there is a definitive, functioning
image.
I don't understand anything about programming...
?
73/55 , Jens / HB9JOI
?
+++
?
? From: Jody - K3JZD via groups.io
Sent: Thursday, May 15, 2025 5:56 PM
Subject: Re: [BITX20] zBITX Crashes - Suspect Memory Leak
#zbitx ?
Ron : I will have to spend some time with the code snippet that you
highlighted - I do not have any experience at all with the gtk library.
?
Gordon : I thought that mine had crashed with version 3.021.? But I
was doing so many things working with it then, any of those things that I was
doing could have caused my version 3.021 to crash.?? So, maybe what I
am remembering was self-induced.? This is good info though.? Always
suspect the last change that you made whenever problems surface is the golden
rule.
?
Today I got lucky.? I had my unit running beside me while I was doing
some other things.? Mostly it was just sitting there in Receive
Mode.?? But I was sending some Straight Key CW once in a while to make
sure that it was still responsive.?? I had a SSH login.? After
about 1.5 hours, my Receiver noise got sporadic.? Sending CW got very
choppy - it was totally unusable.?? My SSH login was sluggish. but
still usable.? I ran HTOP.
?
What I found supported my Memory Leak theory.? See the
attached.??? sbitx runs from the start.sh script.?? I
highlighted that line.? 73.8% of the memory consumed.?? Swap
Space maxed out.? Total Memory very close to being maxed out.? As the
system choked, my SSH connection became super sluggish.?? I got HTOP
to run again, but it took about 15 minutes to come up and rarely
updated.?? Memory consumption looked pretty much the same - I guess
the RasPi OS keeps some memory in reserve.?? So I guess the zBITX
RasPi is not totally crashing - it is just becoming very unresponsive and from
the outside it looks like it crashed.
?
So, I guess it is time to do Diffs on all of the changes made in the files
that were changed last month to create version 3.052.? Mostly it was adding
the input pin IRQs and changing the program control structure to give manual CW
priority.? But some changes were also made to support some problems that
had been reported whenever using FT8 and other digital modes.
?
While I have other stuff on my plate, this problem seems to keep grabbing
my attention.? So. I will try to fit in some more time to look at it.?
In the mean time, it you have version 3.052 installed, just power down / power
up your zBITX every 30 minutes or so.
?
72,
Jody - K3JZD???
?
?
|
Re: zBITX Crashes - Suspect Memory Leak
#zbitx
Jody,
do you have an image of ver 3.021 that you can share?
I will like to try your sbitx_gtk.c file.? |
Re: Sbitx high swr on a 1 to 1 antenna
I would begin by checking? the antenna connection solder connections with both a magnifying glass and ohm meter. Compare with the schematic and check for faulty cracked connections or parts. If the solder is not shiny, but is dull, it is suspect. Check each band transmitting into a 50 ohm dummy load. If some bands are okay, with others not, you can narrow things down. On Thu, May 15, 2025, 1:34 PM W1WCI via <timothy.macdonald=[email protected]> wrote:
|
Re: Sbitx high swr on a 1 to 1 antenna
¿ªÔÆÌåÓýJust substituted my uBitX for the Sbitx, worked perfectly, both radio and the out board meter showing power and 1:1 match with the antenna. ?The Sbitx still shows high swr on the radio and the meter. This suggests to me that the issue is to be solved in the radio. Sent from me and my iPad On May 15, 2025, at 12:53?PM, Jim via groups.io <jlckansas@...> wrote:
|
Re: Sbitx high swr on a 1 to 1 antenna
How dry is it?? ?Could some moisture got into someplace from radio to antenna?
Has anything been undone before this happened or the coax itself been flexed too much?
Have you ran a continuity check for different parts that go from the simple on place on up to the whole as much as possible?
Does you antenna switch get used often? it might be wearing a bit.
?
Thank you
Jim
KE0VVU
? |
to navigate to use esc to dismiss