Keyboard Shortcuts
Likes
Search
CAT control of the bitx frequency
Gordon Gibby
¿ªÔÆÌåÓýI would really like to be able to computer control the frequency of a bitx RADUINO -- this would potentially allow one of these rigs to be a WINLINK server [and it might need an amplifier, yeah, I know!]? but even more so, I believe I can use the RADUINO
to control older Heathkits and turn them into computer controllable rigs that are basically impervious to EMP.
I suspect that either someone has already done this, or many of you could do it much faster than I, but I have managed now to make the Raduino appear to be a Yaesu FT857d and respond to WINLINK frequency commands on 80 and 40 meter bands, issued at 9600
baud 8N1 via the usb port....??
It actually only took a small amount of code.? The problem was that I'm a simple doc & electrical engineer, and "packet binary coded decimal" representation of frequencies is not something I've ever thought much about before.....much less how to decode that
back into an Unsigned Long....so that added several hours + some compiler flakiness that might have been caused by me putting in all kinds of incorrect castings.? ?
I do not (yet) know how to deal with any "un-syncing" of five-byte words between computer and Raduino (a problem to be investigated on another day) but I'm just? "tickled pink"? that now I can pick a station in WINLINK EXPRESS?and bingo....the Raduino move
to the correct frequency.? ? ?RMS_EXPRESS should work very similarly.??
Cheers,
Gordon
// --------------------------TRY TWO TO DO CAT---------------------------
//? The minimum command we have to listen for is change frequency
//? 5 bytes:? ?MM MK KK HH? 01? ?is the command
//? where MMM are the megaherts? (eg? 01 4
//? and the KKK are the kilohertz? (eg? ?234?
//? so for example? ?01, 42, 345, 56, 01 means
//? change frequency to 14,234.56 kilohertz
void checkSerialData() {
? int packed;?
? int i = Serial.available();
? // Note that the internal buffer on the arduino can hold up to 64 bytes
? ? if (i < 5) return;
?// if you got here then there are at least 5 ints (?bytes?)? waiting: get it.
printLine(1, (char *)"5bytes");
? ? ? ? delay(10);
?
? ? for (i=0; i<5; i++) {
? ? ? ? receivedserial[i] = Serial.read();
? ? ? ? // Serial.read pulls exactly one byte
? ? }
? ? // now chek for the command in the last byte
? ? switch (receivedserial[4]) {
? ? ? ? printLine(1, (char *)"checkCMD");
? ? ? ? delay(10);
? ? ? ? ?
? ? ? ? case 1:
// frequency is in packed BCD; binary coded decimal;
// so left 4 bits give top decimal number 0-9? and right 4 bits give bottom decimal number 0-9
//? ? ? ? case CAT_FREQ_SET:
? ? ? ? ? ? // convert the 4 bytes of numbers (tens of MHz), (hundreds of kHz), (kHz), (tens of hz)
? ? ? ? ? frequency = 0UL;?
? ? ? ? ? packed = receivedserial[0];
? ? ? ? ? frequency =? ? ?10000000UL *? ?(unsigned long) ( ((packed & 0xF0)>>4 )* 10? +? ?(packed & 0x0F) ) ;
? ? ? ? ? packed = receivedserial[1];
? ? ? ? ? frequency = frequency +? 100000UL *? ?(unsigned long) ( ((packed & 0xF0)>>4 )* 10? +? ?(packed & 0x0F));
? ? ? ? ? packed = receivedserial[2];
? ? ? ? ? frequency = frequency + 1000UL *? ?(unsigned long) ( ((packed & 0xF0)>>4 )* 10? +? ?(packed & 0x0F));?
? ? ? ? ? packed = receivedserial[3];
? ? ? ? ? frequency = frequency -40 + 10UL *? (unsigned long) ( ((packed & 0xF0)>>4 )* 10? +? ?(packed & 0x0F));?
? ? ? ? ??
? ? ? ? ? ?
? ? ? ? ? ?setFrequency(frequency);
? ? ? ? ??
? ? ? ? ? ?delay(30);
??
? ? ? ? ? ? ? Serial.write(ACK);
? ? ? ? ? ? break;
? ? ? ?
? ? ? ? default:
? ? ? ? ? ? printLine(1, (char *)"Othercmd");
? ? ? ? ? ? delay(10);
? ? ? ? ? ? Serial.write(ACK);
? ? ? ? ? ? break;
? ? }
}? ???
|
Pavel Milanes Costa
El 05/12/17 a las 02:58, Gordon Gibby escribi¨®:
Have a look at this: An application example here Cheers. -- 73 CO7WT, Pavel. |
Gordon Gibby
YES PAVEL --- I studied your code very carefully and it was the driving force to help me get going what I wanted to do!!!! HUGE HELP and I heartily appreciate and support what you seem to be working on!!!! Your work was priceless to me.
I am doing only a fraction of what you have done! I'm so ignorant that I had difficulty getting your code integrated with what I already had with Allard's version 1.24.....so I had to just kinda write a little subroutine myself. (I'm just a 62 year old doc with a past set of degrees in Electrical Engineering, so still learning all these complicated IDE type things......) Took me 7 hours to make it all work.....I didn't understand the "packed binary coded decimal" that is part of the FT857d frequency notation...... I didn't see a photo of whatever hardware you are working on --- can you show a photo somewhre? Will Ashar Farhan's new multi-band bitx type transceiver help you? Several cuban hams use my WINLINK gateway station to get weather and other information, and I'm delighted to be of any help to our Cuban amateur radio operators. THANKS!!!!! You paved a broad brush that helped me very much....and I hope to see your work go far!!! Gordon ________________________________________ From: [email protected] <[email protected]> on behalf of Pavel Milanes Costa <pavelmc@...> Sent: Tuesday, December 5, 2017 5:22 PM To: [email protected] Subject: Re: [BITX20] CAT control of the bitx frequency El 05/12/17 a las 02:58, Gordon Gibby escribi¨®: Have a look at this: An application example here Cheers. -- 73 CO7WT, Pavel. |
Pavel Milanes Costa
¿ªÔÆÌåÓýThanks for the Kudos Gordon. I'm really on standby now with a huge work load, but I'm ready to help Allard in the version 2.0 of the bix40 code for the raduino or even Farhan with the new multiband bitx, I'm very glad to contribute to the ham community and participate in the creation of great things together. PS: have you see this video? ()
It's a pro Linux TED conference, but the concept of the free
forming communities & exchange of ideas in them is the core in
which the bitx software project has flourished. it's definitely a
must see one... El 05/12/17 a las 17:31, Gordon Gibby
escribi¨®:
YES PAVEL --- I studied your code very carefully and it was the driving force to help me get going what I wanted to do!!!! HUGE HELP and I heartily appreciate and support what you seem to be working on!!!! Your work was priceless to me. You are welcomed, don't hesitate to detect/report bugs, suggest/propose changes, ask question on how it works, etc... I am doing only a fraction of what you have done! I'm so ignorant that I had difficulty getting your code integrated with what I already had with Allard's version 1.24.....so I had to just kinda write a little subroutine myself. The trick in the Allard's code is that he uses blocking delays
here and there to support some functions and that's not compatible
with my lib. To make Allard's bitx40 raduino code to work
flawlessly with that lib, it need to be changed to a non blocking
delays strategy. See, the Arduino is a single thread MCU, when yo make a delay for 500 msecs it stay there doing nothing for +/- 500 msecs... and if in that time lapse a serial call came from the PC and the UART buffer get full, you may break the serial comms, then the software on the PC will tell you that the radio is not responding to commands. Bottom line: it will fail at some point in the actual state of
the code. Simply changing every blocking delay to a non blocking one is doable and it will work (BTDT), but is not "nice" in programing/firmware-space terms, another strategy must be employed there, the 2.0 version must have that on mind. (I'm just a 62 year old doc with a past set of degrees in Electrical Engineering, so still learning all these complicated IDE type things......) Took me 7 hours to make it all work.....I didn't understand the "packed binary coded decimal" that is part of the FT857d frequency notation...... You will be surprised of how many "professionals" are really just dedicated people that took a passion as driving force. I'm an Industrial Engineer that has become a System Administration on Linux and Open Source Software platforms (IT services, enterprise cloud services, etc...) and now a Consultant for government enterprises on that subject to migrate away from Microsoft solutions... Also developing for CHIRP (), and other free projects. And two kids at home with 3 and 6 years each... Here on the list you have a few other examples, you have Allard, Jack Purdum, Jerry Graffke, even Farham itself. I didn't see a photo of whatever hardware you are working on --- can you show a photo somewhre? We are using almost any hardware we can find,? we are mainly re-proposing some old radios from war/marine/commercial surplus as old as from the 70' We are using bitxes to, I have a group of cuban hams that are using the arduino-arcs as a general purpose radio controller adapted to his hardware options, this is my beta-test group that brings me a steady feedback for improvements or fixes. For example we have:
To my count at least 10 to 15 of this radios are working with the sketch, the funny thing is that they are working with different arduinos (Uno, Mini, mini-pro, micro, Mega, etc) and that the reason you may see the sketch breaks it's features and you can enable/disable them on by one. For example the full featured one will run on any ATMega 328 or 2560 MCU (Uno, Mega) but if all you have is a mini with a ATMega 168 (half the firmware space) you can leave out the Memory & CAT features an you are ready to rock. I had a request even from a Argentinian? ham that uses the sketch
for a headless solution (no LCD, no buttons, no rotary: just CAT
control) and that's included too, and it fits on a ATMega8 MCU...
yes... about 6k of size... I personally had a through hole bitx hardware and a Uno, with a homebrewed "raduino" controller... now it's sleeping on the junk box due to a lighting strike on my shack that killed all the radios connected to antennas (Yes, I know, how in the world I may leave and let radios connected to antennas in a tropical island... in summer) Murphy has his ways... I lose a new acquired base 2m radio on that strike too :'( That's why I have limited my contributions in recent times to only optimizations, and when some friend with a real raduino can test it for me... without a real hardware to test it's very difficult to get consistency. That happened to me on my start on this group and some of my
contributions failed because my (adapted) hardware has it's own
troubles not related to the real raduinos. Will Ashar Farhan's new multi-band bitx type transceiver help you? Sure, I would love to had my hands on one of those to hack and improve... and contribute to its development. The pictures are nice... kudos to the Farham team. But here from Cuba is difficult, the actual raduino full kit price is about 1.5 month salary for me, paypal is a no go from here due to the American Blockade/Embargo, not to mention that the shipping of the kit is a madness with a jumpy custom and a bad (sad to say, but true) delivery rates of electronic goods. I have not tried DHL shipping to be fare on saying, just regular mail parcels. My only 100 sure option is a friend/know person that travels to Cuba to bring me things that things; for example I won a contest for a Great Scott Gadgets for a HackRF One SDR Transceiver... it's sleeping on USA in a friends home to travel to Cuba for about a year or more... GGGGRRRR... Several cuban hams use my WINLINK gateway station to get weather and other information, and I'm delighted to be of any help to our Cuban amateur radio operators. About WINLINK, yes, I know a few cubans that use that platform, myself included ;) Thanks ! THANKS!!!!! You paved a broad brush that helped me very much....and I hope to see your work go far!!! Thanks Gordon, don't hesitate to ask any thing you need/want to understand. Gordon ________________________________________ From: [email protected] <[email protected]> on behalf of Pavel Milanes Costa <pavelmc@...> Sent: Tuesday, December 5, 2017 5:22 PM To: [email protected] Subject: Re: [BITX20] CAT control of the bitx frequency El 05/12/17 a las 02:58, Gordon Gibby escribi¨®:I suspect that either someone has already done this, or many of you could do it much faster than I, but I have managed now to make the Raduino appear to be a Yaesu FT857d and respond to WINLINK frequency commands on 80 and 40 meter bands, issued at 9600 baud 8N1 via the usb port....Have a look at this: An application example here Cheers. -- 73 CO7WT, Pavel. -- 73 CO7WT, Pavel. |
guys, i have implemented a very minimal version of CAT in the ubitx. it works with fldigi, but it doesnt work with WSJTX. the reason. here is what is happening: The hamlib opens the serial port, which resets the Arduino Nano.? Hamlib immediately sends a command to the Arduino Nano But the Arduino Nano waits a while for the programming commands before executing the sketch code So, the Hamlib times out! Is there a way out of this? - f On Thu, Dec 7, 2017 at 2:03 AM, Dimitar Pavlov via Groups.Io <lz1dpn@...> wrote:
|
Trent Trent
What about the hamlob timeout config On 7 Dec. 2017 4:08 pm, "Ashhar Farhan" <farhanbox@...> wrote:
|
the intial command is being read by the bootloader. it is lost by the arduino and hence the timeout. -f On 7 Dec 2017 11:06 am, "Trent Trent" <vk7hrs@...> wrote:
|
Graham
Without looking closely at what resources are still available for the
toggle quoted message
Show quoted text
nano, one way might be to use software serial on two i/o pins rather than the usb connection of the nano. but keep looking, I have a vague recollection of similar questions being asked and there were some solutions but they might not be too suitable for the arduino neophytes in respect to setting up and programming the nano. I just can't put my finger on an example at the moment. cheers, Graham ve3gtc On 12/7/2017, "Ashhar Farhan" <farhanbox@...> wrote:
guys, |
Pavel Milanes Costa
¿ªÔÆÌåÓýHi Ashar Forhan I have the same problem, I don't have a wsjt here to test by my solution was to increase the timeout and retries count to build a delay bigger than 750 msecs and that will do it, it will keep trying until the real firmware kick in... Another tip, get rid of any blocking delay, you are risking a
full UART buffer and lost of sync with the PC... Been there done
that... Take a look here Ashar: All the package in the form of a lib: See the comments in the readme for this last to know about te bug that is biting you. BTW: I will be happy to contribute to the solution, I'm all ears. 73 CO7WT. El 07/12/17 a las 00:08, Ashhar Farhan
escribi¨®:
-- 73 CO7WT, Pavel. |
Jack Purdum
All: I don't think Hamlib is going to be a viable solution as it is currently implemented. It makes resource assumptions that are simply beyond what can be expected from a Nano. Also, the Serial library that is standard with the Arduino IDE is written in such a way that it blocks while active. Both of these mean that you'd need to modify those libraries to shoehorn them into the Nano in a manner similar to what Allard pulled off. I have also written a "crippled" CAT, but for the X1M and a Nano. Still, to have a small xcvr tied to a PC kinda made it less useful to me, so I gave up on it. The CAT part was written in C# using visual studio, but could probably be ported over to C++ pretty easily. As always, I'd be happy to share that code with anyone who is interested. (It's pretty ugly as I haven't spent much time on it.) Jack, W8TEE From: Graham <planophore@...> To: [email protected] Sent: Thursday, December 7, 2017 7:32 AM Subject: Re: [BITX20] CAT control of the bitx frequency Without looking closely at what resources are still available for the nano, one way might be to use software serial on two i/o pins rather than the usb connection of the nano. but keep looking, I have a vague recollection of similar questions being asked and there were some solutions but they might not be too suitable for the arduino neophytes in respect to setting up and programming the nano.? I just can't put my finger on an example at the moment. cheers, Graham ve3gtc On 12/7/2017, "Ashhar Farhan" <farhanbox@...> wrote: >guys, > >i have implemented a very minimal version of CAT in the ubitx. it works >with fldigi, but it doesnt work with WSJTX. the reason. here is what is >happening: >The hamlib opens the serial port, which resets the Arduino Nano. >Hamlib immediately sends a command to the Arduino Nano >But the Arduino Nano waits a while for the programming commands before >executing the sketch code >So, the Hamlib times out! > >Is there a way out of this? > >- f > >On Thu, Dec 7, 2017 at 2:03 AM, Dimitar Pavlov via Groups.Io < >lz1dpn=[email protected]> wrote: > >> Hi, >> >> Check this links, I think will be interesting for You. >> This arduino source is Yaesu FT-817 transceiver emulator to computer USB >> port (COMx). >> Worked very slow with arduino, but with STM controller will be better. >> >> >> >> Peppermint-VFOsi5351 >> >> Peppermint-VFOsi570 >> <> >> >> >> >> >> 73! >> >> >> > > |
Ashhar, here is information about how the Arduino's are getting reset by?the serial port:?
The DTR line is connected (via a capacitor) to the Arduino reset input (you an see this on the Nano schematic:?). Based on the "Reset" information from above, you should be able to prevent this reset by adding a resistor between "Reset" and +5V - this will however also prevent the Arduino from being programmed automatically, and you will have to trigger a normal reset by pushing the reset button on the Nano board.? Going to a soft serial solution would use up more ports on the Raduino, which are already scarce, so having a hardware option to prevent the Raduino from resetting when the serial port gets initialized would probably be a good idea.? I am dealing?with this?problem right now with an antenna analyzer, and so far?I¡¯ve just added a 3 second delay in the host software, but eventually I will have to modify the hardware (once the software is fairly stable, and I don't have to reprogram?the Arduino every few minutes).? |
Jack Purdum
Graham: You nailed it with: "...but they might not be too suitable for the arduino neophytes in respect to setting up and programming the nano." That's sorta like saying Michael Phelps is a pretty good swimmer.The Nano Pro Mini is the Nano but without any USB pants. Lacking a USB connection onboard makes it a real pain in the butt to program and hardly worth the few pennies saved on the board. For most it means adding an AVR Programming Shield which I quit using years ago. For me, it just wasn't worth the effort. Jack, W8TEE From: Graham <planophore@...> To: [email protected] Sent: Thursday, December 7, 2017 7:32 AM Subject: Re: [BITX20] CAT control of the bitx frequency Without looking closely at what resources are still available for the nano, one way might be to use software serial on two i/o pins rather than the usb connection of the nano. but keep looking, I have a vague recollection of similar questions being asked and there were some solutions but they might not be too suitable for the arduino neophytes in respect to setting up and programming the nano.? I just can't put my finger on an example at the moment. cheers, Graham ve3gtc On 12/7/2017, "Ashhar Farhan" <farhanbox@...> wrote: >guys, > >i have implemented a very minimal version of CAT in the ubitx. it works >with fldigi, but it doesnt work with WSJTX. the reason. here is what is >happening: >The hamlib opens the serial port, which resets the Arduino Nano. >Hamlib immediately sends a command to the Arduino Nano >But the Arduino Nano waits a while for the programming commands before >executing the sketch code >So, the Hamlib times out! > >Is there a way out of this? > >- f > >On Thu, Dec 7, 2017 at 2:03 AM, Dimitar Pavlov via Groups.Io < >lz1dpn=[email protected]> wrote: > >> Hi, >> >> Check this links, I think will be interesting for You. >> This arduino source is Yaesu FT-817 transceiver emulator to computer USB >> port (COMx). >> Worked very slow with arduino, but with STM controller will be better. >> >> >> >> Peppermint-VFOsi5351 >> >> Peppermint-VFOsi570 >> <> >> >> >> >> >> 73! >> >> >> > > |
On Thu, Dec 7, 2017 at 06:23 am, Karl Heinz Kremer, K5KHK wrote:
Ashhar, here is information about how the Arduino's are getting reset by?the serial port:?Most of the "Disabling Auto Reset" discussion was related to Uno's.? If you look at the Nano schematic, you will see that there is already a 1K resistor between "Reset" and +5V (it's connected at the "Reset" pushbutton switch). The DTR output of the USB chip connects to "Reset" thru C4.? Tombstoning C4 should disable the Auto Reset.? Adding an SPST switch between the now open C4 pad and the now unconnected terminal on the tombstoned C4 will allow you to get the Auto Reset back later if you want it.? Switch open - no AutoReset, switch closed - AutoReset enabled. 73, Carl? K0MWC |
John Kemker
Why CAT?? Why not something more human-readable?? We really don't have to save bits with BCD and similar kruft, anymore.? ASCII-based, human-readable should do fine.? It'll make writing drivers for Hamlib, etc. even easier.
Also, the Nano uses the same chip as the Uno, and the Uno is able to handle plenty.? Hamlib should be no problem. -- 73 de W5NNH |
John W5NNH Some of us have already been discussing this off-net.? It seems possible to do direct hamlib-to-BITX code, but having an abstraction layer between probably makes things more flexible.? Making the BITX-Arduino commands more human readable has the advantage of being able to run the BITX from a dumb-terminal, possibly another Arduino with a tiny keyboard and 4-line LCD or Oled display.? The smaller dumb terminal could be useful for field day operations where physical space may be limited. Having the BITX abstraction layer potentially makes it possible to have libraries for CAT, hamlib, or anything else as the command handler.? ?That drawing is modified from the Hamlib site and shows where the translator might fit in the grand scheme of things if following the Hamlib layout. Arv? K7HKL _._ How to design the command interpreter is interesting because the parser can be done in several ways (switch statements, character-by-character tree, etc.).? On Sat, Dec 23, 2017 at 5:17 PM, John Kemker <kemkerj3@...> wrote: Why CAT?? Why not something more human-readable?? We really don't have to save bits with BCD and similar kruft, anymore.? ASCII-based, human-readable should do fine.? It'll make writing drivers for Hamlib, etc. even easier. |
On 24.12.2017 18:07, Arv Evans wrote:
Having the BITX abstraction layer potentially makes it possible tohave libraries for CAT, hamlib, or anything else as the command handler.If bitx CAT commands are not invented new but used some already videspread used commands bitx would be automatically supported in many applications without need to write special drivers. Bitx is simple rig, I guess it is easy to fit all its functions in already existing CAT protocol used by some well established brand. I noticed that generic Kenwood CAT protocol is quite popular. Pedja YT9TP |
Pedja? YT9TP Yes, just using an existing protocol would work but we probably want the interface protocol to grow along with software and hardware additions to the uBITX, BITX-40, and whatever the future holds.? That seems to justify at least looking into having a uniquely BITX protocol.? There is also some pride-of-invention in having our own BITX specific command interface.? This would let PC-side developers work up a software transceiver panel that advertises "uBITX" or what BITX version one might be running.? The PC side of such an interface is interesting because it could include built-in support for a number of the most popular modes (QRSS, WSPR, etc.), or hooks for executing code that supports these modes.? Arv _._ On Sun, Dec 24, 2017 at 11:54 AM, YT9TP - Pedja <yt9tp@...> wrote:
|
Jack Purdum
I did notice that one of Farhan's source files does some CAT work. Jack, W8TEE From: YT9TP - Pedja <yt9tp@...> To: [email protected] Sent: Sunday, December 24, 2017 1:54 PM Subject: Re: [BITX20] CAT control of the bitx frequency On 24.12.2017 18:07, Arv Evans wrote: > Having the BITX abstraction layer potentially makes it possible to have libraries for > CAT, hamlib, or anything else as the command handler. If bitx CAT commands are not invented new but used some already videspread used commands bitx would be automatically supported in many applications without need to write special drivers. Bitx is simple rig, I guess it is easy to fit all its functions in already existing CAT protocol used by some well established brand. I noticed that generic Kenwood CAT protocol is quite popular. Pedja YT9TP |
Gordon Gibby
¿ªÔÆÌåÓýYes, he did the packed binary coded decimal back into ASCII string. ?Or the reverse or something.
I had to Kluge something together to do that to get my minimal implementation of ft857 working. ??
I didn't quite get what radio he was implementing.
To take advantage of existing code in such applications as ALE, whisper, WINLINK, FLDIGI?, it would be nice to implement a widelyo used protocol by a manufacturer who sticks with IDENTICAL protocol across various Riggs?
To make life easy on humans, it would be nice to simply send ASCII strings and decode them. ? The most brilliant code would observe what is coming at it and pick which protocol to implement!
Sort of like how he proposed to run to intermediate frequency Crystal filters in parallel.
If there is any ham radio unit that uses plane ASCII strings to control it, we can implement that one and kill both birds with one stone.
Sent from my iPhone
|