benlink icon indicating copy to clipboard operation
benlink copied to clipboard

Discussion and findings

Open Ylianst opened this issue 11 months ago • 59 comments

Hi. I have two of these radios and I really like this project. In my view, this opens up a lot more options for using these radios. I tried my hand at sending my own commands and have findings & questions.

  • First is the event registrations. I send "EVENT_NOTIFICATION" with a body of 0x01 and it works. I tried a few different values (0x00, 0x02, 0x03, 0x04, 0x0F, 0xFF). So Far, only 0x01 and 0x08 work. I tried sending 2 bytes like 0x0001 and that does not work. I get what looks to be an error response when I try these.
  • I am interesting in getting the channel_id when I receive a DATA_RXD. So far, I have not seen a channel ID in any of my messages. Any idea how to enable this? It looks like the module app does know what channel a data fragment came on.
  • For sending data fragments. I am trying in C# in Windows and not hitting any issues so far. I have not tried long strings of data fragments yet, just single (less then 50 byte) and it's working for me so far.

In general, I am a lot more interesting in the full Bluetooth API than the KISS TNC which is very limiting. So, this is really amazing to see an attempt at documenting this API. This radio is ahead of the game.

Ylianst avatar Jan 17 '25 22:01 Ylianst

Hi @Ylianst , thanks for your interest!

  1. What do you mean about sending "EVENT_NOTIFICATION"? As far as I know, EVENT_NOTIFICATION is only sent from the radio to the client. I've never seen the app send a "EVENT_NOTIFICATION" message to the radio, it only receives them.
  2. Unfortunately I've never seen the app use the channel_id arg on DATA_RXD. The app simply tracks what channel is currently active by listening for HT_STATUS_CHANGED events to keep track of the current active channel. You can do the same in benlink by reading RadioClient.status.curr_ch_id when you receive a DATA_RXD (just realized I didn't expose that property in the RadioClient -- latest commit should fix this)
  3. Yes, that makes sense -- the absolute limit will depend on the MTU of the BLE connection (not sure what the defaults are), but the app breaks up messages into frames about 50 bytes and then queues the fragments. I'll get around to implementing that one of these days, but feel free to submit a PR if you get around to it before me :)

khusmann avatar Jan 18 '25 00:01 khusmann

Thanks @khusmann

  1. Apologies, I meant "REGISTER_NOTIFICATION", not "EVENT_NOTIFICATION". I tried to register a few different ways and using 0x01 is so far, the way to go.
  2. Yes, that makes sense. I have been tracking RadioClient.status.curr_ch_id and it seems to always point to the last channel traffic was received on. Thank you for that. Really, that is why I was testing various REGISTER_NOTIFICATION values, but curr_ch_id solves my problem.
  3. Ok, got it. I want to try sending a very large amount of data between by two radios and see how it behaves. I do wonder how flow control works out over Bluetooth so not to send too much data to the radio. If you have any info on that, it would be great.

Again, this is amazing. Other manufacturers should follow with this Bluetooth API model.

Ylianst avatar Jan 18 '25 01:01 Ylianst

Oh! I did want to ask. There is a lot of DMR related stuff in this API, but my radio UV-Pro obviously does not have DMR. Is there a radio compatible with this API available with DMR? - Thanks.

Ylianst avatar Jan 18 '25 01:01 Ylianst

Apologies, I meant "REGISTER_NOTIFICATION", not "EVENT_NOTIFICATION". I tried to register a few different ways and using 0x01 is so far, the way to go.

Ah yeah, REGISTER_NOTIFICATION is weird -- the app only ever sends is 0x01, and it seems to enable everything... Does 0x08 have any effect?

Ok, got it. I want to try sending a very large amount of data between by two radios and see how it behaves. I do wonder how flow control works out over Bluetooth so not to send too much data to the radio. If you have any info on that, it would be great.

Yeah, long messages are broken into pieces in the same way that they do in received messages -- you get a sequence of fragments ending with a final fragment with the is_final_fragment flag set.

Again, this is amazing. Other manufacturers should follow with this Bluetooth API model.

Thanks! I agree, I'd love to see other manufacturers providing similar bluetooth interfaces that we can hack on. Even better if they just released the API and we didn't have to decode it ourselves...

There is a lot of DMR related stuff in this API, but my radio UV-Pro obviously does not have DMR. Is there a radio compatible with this API available with DMR? - Thanks.

Nope, haven't found a device that supports DMR -- but it's supported by the app, as you can see by my work. If you can figure out which device in the wild does, please lmk! The only devices I'm aware of are listed on the front page:

  • BTech UV-Pro
  • RadioOddity GA-5WB
  • Vero VR-N76 (untested)
  • Vero VR-N7500 (untested)
  • BTech GMRS-Pro (untested)

khusmann avatar Jan 18 '25 03:01 khusmann

So, REGISTER_NOTIFICATION did not send me the same error message with 0x08, but it did not work at all. I get no notifications. So, I did not go any further. 0x01 does seem to be the only value that really works.

For fragments, yes, I assemble them the same way you do. I just did not work to fragmenting yet for outgoing traffic, but I will probably work on that this weekend. I really want to try my hand at larger file transfers and see how fast I can get it. My question was more with outgoing TNC traffic and how flow control works.

I had already searched for all the radios in your list and searched for DMR is all the specification web pages for each radio and came up empty. It's probably an upcoming feature and that is great news.

FYI. Based on your decoding work, I have been working on a Windows app that does APRS/SMS/Terminal... Once it's minimally working, I will push it as open source on GitHub. I went to a HAM meeting a few days back and demoed an early version.

Image

Image

Oh, I also wanted to ask. Any way to get the current GPS location of the radio? - Thanks

Ylianst avatar Jan 18 '25 08:01 Ylianst

So, REGISTER_NOTIFICATION did not send me the same error message with 0x08, but it did not work at all. I get no notifications. So, I did not go any further. 0x01 does seem to be the only value that really works.

Hmmm did 0x00 give an error? Or maybe 0x01 toggles notifications? It seems weird if you can only turn them on and there's no way to turn them back off. The app doesn't give many hints, it just sends 0x01 one time and that's it.

My question was more with outgoing TNC traffic and how flow control works.

Yeah, outgoing TNC traffic is exactly the same as incoming, as far as I've seen.

I really want to try my hand at larger file transfers and see how fast I can get it.

I think speed will be limited by the modulation of the data -- I'd expect the transfer rate to the device to be very fast compared to the packets going over the air.

It's probably an upcoming feature and that is great news.

Hmmm, I'm not so sure... I think it's more likely a radio out there we haven't found yet. But fingers crossed for it being an upcoming feature!

FYI. Based on your decoding work, I have been working on a Windows app that does APRS/SMS/Terminal... Once it's minimally working, I will push it as open source on GitHub.

Very cool! I'd love to see it when you're ready! This is exactly the sort of thing I was hoping benlink would inspire. If you found my work helpful, I'd appreciate if you credit/link back to this project when you publish to help others find it & raise awareness -- similarly, I'd be happy to add a link to your project as well!

Oh, I also wanted to ask. Any way to get the current GPS location of the radio? - Thanks

Not that I've seen! The HT app only sets the position of the radio's GPS via SET_POSITION... it never gets the radio's position, unfortunately... (it's still possible one of the unexplored cmds does this though, lmk if you find anything...)

khusmann avatar Jan 18 '25 21:01 khusmann

For the outbound flow control, since Bluetooth is likely going to go a lot faster than 1200 baud packets, I expect the radio to "push back" and hopefully give me a signal when the buffer is free for more frames. In any case, I will get to this at some point. I need to get all the basic stuff working.

For credits, yes! I will not be shy to promote and link your page. I will send you an about box screenshot so you can give feedback ahead of release. My project would not exist without your work and so, it's on top of the list. I could still enable regular TNC support and probably will, but this integration makes it so much better. I will post back on this.

For GPS location, that is too bad. Unlike phones, laptops do not generally have GPS location and that would be really nice to have. I would add it to the map and could compute distances to other stations, etc. No worries, I will do without for now.

I just spend the last 6 hours+ just building the UI and support for editing channels. It was a huge amount of work, but got it working.

Image

Ylianst avatar Jan 18 '25 22:01 Ylianst

I expect the radio to "push back" and hopefully give me a signal when the buffer is free for more frames.

Exactly. I wonder if you'll get a ReplyStatus with "INSUFFICIENT_RESOURCES", and then a "SUCCESS" when it's ready again -- I'm looking forward to hear the results of your tests!

For credits, yes! I will not be shy to promote and link your page. I will send you an about box screenshot so you can give feedback ahead of release.

Fantastic! Really appreciate it!

For GPS location, that is too bad. Unlike phones, laptops do not generally have GPS location and that would be really nice to have.

I agree!

(As I looked through the messages again I just was reminded there's a CANCEL_NOTIFICATION message -- so that's likely how to turn notifications on and off)

I just spend the last 6 hours+ just building the UI and support for editing channels. It was a huge amount of work, but got it working.

Very cool! I'm super excited to try it out when it's ready!

khusmann avatar Jan 18 '25 22:01 khusmann

I drove 30 minutes today to get within reach of a local BBS and right away starting seeing packets I did not expect. My AX.25 decoder is terrible and needs to be improved. I figured it would be nice to have a packet dump for my own use, but after working on it for a bit I realized this should be a feature of the tool, not something I try to hide. So yes, mini-Wireshark.

On working on this, I realize that adding the channel id on my outbound packets is probably super important. Could it be that is the point of having a Channel ID for fragments? It's not for inbound, it's for outbound.

Seems like I am going to need a more serious AX.25 stack if I am going to do connected sessions. Having the packet trace is going to help a bunch.

Image

Ylianst avatar Jan 19 '25 08:01 Ylianst

@khusmann - About box. Let me know if it's ok with you. I will add similar text to the Github repo.

Image

Ylianst avatar Jan 19 '25 18:01 Ylianst

On working on this, I realize that adding the channel id on my outbound packets is probably super important. Could it be that is the point of having a Channel ID for fragments? It's not for inbound, it's for outbound.

When I first saw the channel ID in the fragment api, I thought it would be used for the digital mode -- so outbound packets could be sent over a the digital channel, and similarly inbound would be noted as such if received from a different channel. But yeah, the official app doesn't do this, as far as I have seen in my captures -- it changes the current channel and changes back, never using the channel_id arg in the fragment either outgoing or incoming.

Have you tried sending fragments with the channel_id set? Even if it works now I probably wouldn't trust it long term because the app doesn't use it so it's a toss up if that code path is actively maintained in the firmware.

Another possibility could be dual channel mode? I haven't looked into the behavior there yet.

About box. Let me know if it's ok with you. I will add similar text to the Github repo.

Looks great! Can you add my callsign (KC3SLD) and point the link directly to the benlink project page? https://github.com/khusmann/benlink Thanks!

khusmann avatar Jan 19 '25 19:01 khusmann

@khusmann Thanks for the info on channel_id, ok, still stuff to explore. I have not tried to use it yet. I released the application on GitHub: https://github.com/Ylianst/HTCommander. I will make the changes to the about box now.

Ok, new version coming up:

Image

Ylianst avatar Jan 19 '25 21:01 Ylianst

@khusmann I invited you as contributor. No obligation to do anything. I only have two UV-Pro radios and so, can't try any other ones. If you have one that is not UV-Pro, please give it a try. Thanks.

Ylianst avatar Jan 19 '25 21:01 Ylianst

Fantastic work! Unfortunately I only have UV-Pro as well -- please let me know if you hear from folks using other radios...

khusmann avatar Jan 20 '25 20:01 khusmann

This looks awesome! Quickly tried it with my UV-PRO and VR-N76, but it the window closes shortly after hitting connect. I'll try some more later this week when I get a chance to.

TheCommsChannel avatar Jan 21 '25 20:01 TheCommsChannel

@khusmann - FYI. I just confirmed that indeed, sending a ChannelId in a HT_SEND_DATA for an outgoing fragment will cause the transmitter to switch frequency to send the data. I am working now on having this tool find the APRS channel and always use it so not to accidentally transmit on a different frequency. I know you said not to do that, but it's too good. I will do it.

I also added a new dialog to guide people if Bluetooth is disabled with a link to open Windows Bluetooth settings. That is coming up.

@TheCommsChannel - If the app created a debug.log file, send it over. That will tell me what happened. It's likely I am reading radio settings I am not expecting just after connect. That will help a ton.

Ylianst avatar Jan 22 '25 04:01 Ylianst

@khusmann Update report. Version 0.3 is out. I now mandate that one of the channels be called "APRS" in order to transmit using the APRS feature. If you don't have such a channel, you get notified with a "Setup" button.

Image

You can edit the channel to fix this, or hit the "Setup" to get it setup for you.

Image

I try to make it as easy as possible, but feedback appreciated. Now, even with a single VFO setup, the radio will always listen to APRS if setup to do so. I don't change that setting yet, but will probably do so in the future. So, you can listen to a non-APRS channel and still receive APRS messages. When you try to respond, it will send back on the APRS channel.

Image

I did mess-up during a net tonight and sent APRS message on the wrong frequency. So, I think this change is absolutely required to stop others from doing the same.

Ylianst avatar Jan 22 '25 07:01 Ylianst

@Ylianst Downloaded 0.3 and did some testing. Let me know if there's anything you want me to try. Thanks!

The following is with the VR-N76 and Windows 11

Try 1:

Paired the radio (FW 0.7.11-32) to the computer. Started HT Commander and clicked Connect. Stuck on Connecting with the following in the Dev Debug window

Looking for compatible radios...
Found VR-N76 - ############
Attempting to connect to radio MAC: ############
Selected device: VR-N76 - ############
Connecting to radio...
Getting radio service...
Getting radio characteristic...
Getting radio information...
Send: 0002000403

Contents of debug.log

ExceptionSink: System.Exception: The attribute requires authentication before it can be read or written. (Exception from HRESULT: 0x80650005)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at InTheHand.Bluetooth.GattCharacteristic.<PlatformWriteValue>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at HTCommander.Radio.<Connect>d__61.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 398
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Try 2:

Updated firmware to 0.8.0-1 and tried again

Looking for compatible radios...
Found VR-N76 - ############
Attempting to connect to radio MAC: ############
Selected device: VR-N76 - ############
Connecting to radio...
Getting radio service...
Getting radio characteristic...
Getting radio information...
Send: 0002000403

Contents of debug.log

ExceptionSink: System.Exception: The attribute requires authentication before it can be read or written. (Exception from HRESULT: 0x80650005)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at InTheHand.Bluetooth.GattCharacteristic.<PlatformWriteValue>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at HTCommander.Radio.<Connect>d__61.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 398
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

The following is with the UV-PRO and Windows 11

Try 1:

Paired the radio (FW 0.7.14-1) to the computer. Started HT Commander and clicked Connect. Program closes shortly after

Contents of debug.log

UnhandledExceptionEventSink: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 280
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 278
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__72.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 557
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
UnhandledExceptionEventSink: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 280
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 278
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__72.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 479
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
UnhandledExceptionEventSink: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 280
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 278
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__72.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 495
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Try 2

Updated firmware to 0.8.0-1 Started HT Commander and clicked Connect. Program closes shortly after

Contents of debug.log

UnhandledExceptionEventSink: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 280
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 278
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__72.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 557
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
UnhandledExceptionEventSink: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 280
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 278
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__72.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 479
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
UnhandledExceptionEventSink: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 280
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 278
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__72.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 495
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

TheCommsChannel avatar Jan 22 '25 14:01 TheCommsChannel

@TheCommsChannel Thanks for the high quality bug reports. Version 0.4 is out. In all cases, firmware version has no impact.

  • For the VR-N76 issue. These radios show up as two Bluetooth devices, a control device and an audio device. If you pair to only the audio, I get an "access denied" since I can't access the controls. Don't make any changes, just run the new 0.4 version, it will guide the user.
  • For your UV-Pro, I am not sure what the problem is, however I updated the crash logs in 0.4 so, if it crashed again. I will get a lot more details.

I posted other updates here. v0.4 has multi-region support, show all channels and more. When you can, let me know what you see this time. Thanks.

Ylianst avatar Jan 23 '25 06:01 Ylianst

@khusmann / @TheCommsChannel If you guys have any info on the BSS protocol, please do send it over.

Ylianst avatar Jan 23 '25 07:01 Ylianst

@Ylianst Sure thing! I only have one device show up during the paring process. Both COM ports show up in device manager however. Would it be possible to have an option to select the COM port in the settings?

Here are my results for v0.4

UV-PRO

Program stayed open a bit longer this time but eventually closed.

debug.log

--- HTCommander Unhandled Exception ---
1/23/2025 6:44:55 AM, Version: 0.4.0.0
Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 281
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 280
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__73.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 579
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Last Events:
1/23/2025 6:44:28 AM - MainForm_Load
1/23/2025 6:44:28 AM - Looking for compatible radios...
1/23/2025 6:44:29 AM - Found UV-PRO - ############
1/23/2025 6:44:38 AM - Attempting to connect to radio MAC: ############
1/23/2025 6:44:38 AM - Selected device: UV-PRO - ############
1/23/2025 6:44:38 AM - Connecting to radio...
1/23/2025 6:44:54 AM - Getting radio service...
1/23/2025 6:44:55 AM - Getting radio characteristic...
1/23/2025 6:44:55 AM - Getting radio information...
1/23/2025 6:44:55 AM - Send: 0002000403
1/23/2025 6:44:55 AM - BTSEND: 0002000403
1/23/2025 6:44:55 AM - Send: 0002000A
1/23/2025 6:44:55 AM - BTSEND: 0002000A
1/23/2025 6:44:55 AM - Send: 000200050004
1/23/2025 6:44:55 AM - BTSEND: 000200050004
1/23/2025 6:44:55 AM - Response: 0002800400060104010080D0681E50
1/23/2025 6:44:55 AM - BTRECV: 0002800400060104010080D0681E50
1/23/2025 6:44:55 AM - Response 'BASIC' / 'GET_DEV_INFO'
1/23/2025 6:44:55 AM - Send: 0002000D00
1/23/2025 6:44:55 AM - BTSEND: 0002000D00
1/23/2025 6:44:55 AM - Send: 0002000601
1/23/2025 6:44:55 AM - BTSEND: 0002000601
1/23/2025 6:44:55 AM - Response: 0002800A00CB03260618003CE0E2FF88200000000000000000
1/23/2025 6:44:55 AM - Send: 0002000D00
1/23/2025 6:44:55 AM - BTRECV: 0002800A00CB03260618003CE0E2FF88200000000000000000
1/23/2025 6:44:55 AM - Response 'BASIC' / 'READ_SETTINGS'
1/23/2025 6:44:55 AM - BTSEND: 0002000D00
1/23/2025 6:44:55 AM - Response: 0002800500000440
1/23/2025 6:44:55 AM - BTRECV: 0002800500000440
1/23/2025 6:44:55 AM - Response 'BASIC' / 'READ_STATUS'




--- HTCommander Unhandled Exception ---
1/23/2025 6:44:55 AM, Version: 0.4.0.0
Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 281
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 280
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__73.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 501
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Last Events:
1/23/2025 6:44:28 AM - MainForm_Load
1/23/2025 6:44:28 AM - Looking for compatible radios...
1/23/2025 6:44:29 AM - Found UV-PRO - ############
1/23/2025 6:44:38 AM - Attempting to connect to radio MAC: ############
1/23/2025 6:44:38 AM - Selected device: UV-PRO - ############
1/23/2025 6:44:38 AM - Connecting to radio...
1/23/2025 6:44:54 AM - Getting radio service...
1/23/2025 6:44:55 AM - Getting radio characteristic...
1/23/2025 6:44:55 AM - Getting radio information...
1/23/2025 6:44:55 AM - Send: 0002000403
1/23/2025 6:44:55 AM - BTSEND: 0002000403
1/23/2025 6:44:55 AM - Send: 0002000A
1/23/2025 6:44:55 AM - BTSEND: 0002000A
1/23/2025 6:44:55 AM - Send: 000200050004
1/23/2025 6:44:55 AM - BTSEND: 000200050004
1/23/2025 6:44:55 AM - Response: 0002800400060104010080D0681E50
1/23/2025 6:44:55 AM - BTRECV: 0002800400060104010080D0681E50
1/23/2025 6:44:55 AM - Response 'BASIC' / 'GET_DEV_INFO'
1/23/2025 6:44:55 AM - Send: 0002000D00
1/23/2025 6:44:55 AM - BTSEND: 0002000D00
1/23/2025 6:44:55 AM - Send: 0002000601
1/23/2025 6:44:55 AM - BTSEND: 0002000601
1/23/2025 6:44:55 AM - Response: 0002800A00CB03260618003CE0E2FF88200000000000000000
1/23/2025 6:44:55 AM - Send: 0002000D00
1/23/2025 6:44:55 AM - BTRECV: 0002800A00CB03260618003CE0E2FF88200000000000000000
1/23/2025 6:44:55 AM - Response 'BASIC' / 'READ_SETTINGS'
1/23/2025 6:44:55 AM - BTSEND: 0002000D00
1/23/2025 6:44:55 AM - Response: 0002800500000440
1/23/2025 6:44:55 AM - BTRECV: 0002800500000440
1/23/2025 6:44:55 AM - Response 'BASIC' / 'READ_STATUS'
1/23/2025 6:44:55 AM - Send: 0002000D01
1/23/2025 6:44:55 AM - BTSEND: 0002000D01
1/23/2025 6:44:55 AM - Response: 0002800D0000089ECD68089ECD6800000000D40000000000000000000000
1/23/2025 6:44:55 AM - BTRECV: 0002800D0000089ECD68089ECD6800000000D40000000000000000000000
1/23/2025 6:44:55 AM - Response 'BASIC' / 'READ_RF_CH'




--- HTCommander Unhandled Exception ---
1/23/2025 6:44:55 AM, Version: 0.4.0.0
Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
   at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
   at HTCommander.MainForm.Radio_InfoUpdate(Radio sender, RadioUpdateNotification msg) in C:\Temp\HTCommander\src\MainForm.cs:line 281
   at HTCommander.Radio.Update(RadioUpdateNotification msg) in C:\Temp\HTCommander\src\radio\Radio.cs:line 280
   at HTCommander.Radio.<Characteristic_CharacteristicValueChanged>d__73.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 517
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Last Events:
1/23/2025 6:44:28 AM - MainForm_Load
1/23/2025 6:44:28 AM - Looking for compatible radios...
1/23/2025 6:44:29 AM - Found UV-PRO - ############
1/23/2025 6:44:38 AM - Attempting to connect to radio MAC: ############
1/23/2025 6:44:38 AM - Selected device: UV-PRO - ############
1/23/2025 6:44:38 AM - Connecting to radio...
1/23/2025 6:44:54 AM - Getting radio service...
1/23/2025 6:44:55 AM - Getting radio characteristic...
1/23/2025 6:44:55 AM - Getting radio information...
1/23/2025 6:44:55 AM - Send: 0002000403
1/23/2025 6:44:55 AM - BTSEND: 0002000403
1/23/2025 6:44:55 AM - Send: 0002000A
1/23/2025 6:44:55 AM - BTSEND: 0002000A
1/23/2025 6:44:55 AM - Send: 000200050004
1/23/2025 6:44:55 AM - BTSEND: 000200050004
1/23/2025 6:44:55 AM - Response: 0002800400060104010080D0681E50
1/23/2025 6:44:55 AM - BTRECV: 0002800400060104010080D0681E50
1/23/2025 6:44:55 AM - Response 'BASIC' / 'GET_DEV_INFO'
1/23/2025 6:44:55 AM - Send: 0002000D00
1/23/2025 6:44:55 AM - BTSEND: 0002000D00
1/23/2025 6:44:55 AM - Send: 0002000601
1/23/2025 6:44:55 AM - BTSEND: 0002000601
1/23/2025 6:44:55 AM - Response: 0002800A00CB03260618003CE0E2FF88200000000000000000
1/23/2025 6:44:55 AM - Send: 0002000D00
1/23/2025 6:44:55 AM - BTRECV: 0002800A00CB03260618003CE0E2FF88200000000000000000
1/23/2025 6:44:55 AM - Response 'BASIC' / 'READ_SETTINGS'
1/23/2025 6:44:55 AM - BTSEND: 0002000D00
1/23/2025 6:44:55 AM - Response: 0002800500000440
1/23/2025 6:44:55 AM - BTRECV: 0002800500000440
1/23/2025 6:44:55 AM - Response 'BASIC' / 'READ_STATUS'
1/23/2025 6:44:55 AM - Send: 0002000D01
1/23/2025 6:44:55 AM - BTSEND: 0002000D01
1/23/2025 6:44:55 AM - Response: 0002800D0000089ECD68089ECD6800000000D40000000000000000000000
1/23/2025 6:44:55 AM - BTRECV: 0002800D0000089ECD68089ECD6800000000D40000000000000000000000
1/23/2025 6:44:55 AM - Response 'BASIC' / 'READ_RF_CH'
1/23/2025 6:44:55 AM - Response: 000200090180010000
1/23/2025 6:44:55 AM - BTRECV: 000200090180010000
1/23/2025 6:44:55 AM - Response 'BASIC' / 'EVENT_NOTIFICATION'

VR-N7500

Says connecting and never goes beyond Send: 0002000A

debug.log

--- HTCommander Exception Sink ---
1/23/2025 7:05:22 AM, Version: 0.4.0.0
Exception:
System.Exception: The attribute requires authentication before it can be read or written. (Exception from HRESULT: 0x80650005)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at InTheHand.Bluetooth.GattCharacteristic.<PlatformWriteValue>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at HTCommander.Radio.<Connect>d__61.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 414
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Last Events:
1/23/2025 7:05:09 AM - MainForm_Load
1/23/2025 7:05:09 AM - Looking for compatible radios...
1/23/2025 7:05:09 AM - Found VR-N7500 - ############
1/23/2025 7:05:09 AM - Found UV-PRO - ############
1/23/2025 7:05:09 AM - Found VR-N76 - ############
1/23/2025 7:05:18 AM - Attempting to connect to radio MAC: ############
1/23/2025 7:05:19 AM - Selected device: VR-N7500 - ############
1/23/2025 7:05:19 AM - Connecting to radio...
1/23/2025 7:05:22 AM - Getting radio service...
1/23/2025 7:05:22 AM - Getting radio characteristic...
1/23/2025 7:05:22 AM - Getting radio information...
1/23/2025 7:05:22 AM - Send: 0002000403
1/23/2025 7:05:22 AM - BTSEND: 0002000403
1/23/2025 7:05:22 AM - Send: 0002000A
1/23/2025 7:05:22 AM - BTSEND: 0002000A

VR-N76

Says connecting and never goes beyond Send: 0002000A

debug.log

--- HTCommander Exception Sink ---
1/23/2025 7:12:40 AM, Version: 0.4.0.0
Exception:
System.Exception: The attribute requires authentication before it can be read or written. (Exception from HRESULT: 0x80650005)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at InTheHand.Bluetooth.GattCharacteristic.<PlatformWriteValue>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at HTCommander.Radio.<Connect>d__61.MoveNext() in C:\Temp\HTCommander\src\radio\Radio.cs:line 414
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Last Events:
1/23/2025 7:12:30 AM - MainForm_Load
1/23/2025 7:12:30 AM - Looking for compatible radios...
1/23/2025 7:12:31 AM - Found VR-N7500 - ############
1/23/2025 7:12:31 AM - Found UV-PRO - ############
1/23/2025 7:12:31 AM - Found VR-N76 - ############
1/23/2025 7:12:37 AM - Attempting to connect to radio MAC: ############
1/23/2025 7:12:37 AM - Selected device: VR-N76 - ############
1/23/2025 7:12:37 AM - Connecting to radio...
1/23/2025 7:12:39 AM - Getting radio service...
1/23/2025 7:12:39 AM - Getting radio characteristic...
1/23/2025 7:12:40 AM - Getting radio information...
1/23/2025 7:12:40 AM - Send: 0002000403
1/23/2025 7:12:40 AM - BTSEND: 0002000403
1/23/2025 7:12:40 AM - Send: 0002000A
1/23/2025 7:12:40 AM - BTSEND: 0002000A

TheCommsChannel avatar Jan 23 '25 12:01 TheCommsChannel

@TheCommsChannel - Version 0.5 is out with a bunch more updates. I overhauled the stack that talks to the radio. For your UV-Pro, I may have a fix for it or the debug log is going to be a lot better. For your VR-N76, you will need to correct the pairing, I have new and more detailed instructions here.

I can't wait to have the basics ironed out, I want to build the more advanced usages.

Ylianst avatar Jan 24 '25 04:01 Ylianst

@khusmann - FYI. In this last version, I did a much better job of queuing up Bluetooth messages and holding until I get proper responses before sending the next one. I did the same as you did and on sending a message, I setup what is my expected response message with some messages having a notification being the response. Anyway, again, good work here. It's improved the reliability of the communication a lot.

Ylianst avatar Jan 24 '25 05:01 Ylianst

Version 0.6 is out, I improved the packet capture feature a lot.

Ylianst avatar Jan 25 '25 09:01 Ylianst

@Ylianst Success! I was able to get the UV-PRO working on 0.5. Not gotten a chance to test 0.6 yet. Still having issues with the VR-N76.

Tried to follow your Bluetooth pairing instructions but I don't have the "Show all devices" option. While researching this, I came across this page that says to set Bluetooth devices discovery to "Advanced", but I don't have this option either. Turns out I'm not alone based on this reddit post Not sure why, but it may be something the Bluetooth on my PC doesn't support.

Back to 0.5 and the UV-PRO. I have a channel named APRS but using 145.525 for testing. While testing this, I noticed that it was transmitting on 144.390 even though it is programmed for 145.525

I'll try the latest updates sometime over the weekend and see if I can get Windows installed on another system to see what Bluetooth settings I get there.

TheCommsChannel avatar Jan 25 '25 13:01 TheCommsChannel

@TheCommsChannel Thank you for the excellent research on Bluetooth. I will take a look at this and see if I can update the pairing instructions. This is certainly a uncommon device type and is getting filtered out by Windows for sure.

When you get a chance, try 0.6 with the VR-N76, I should have even more logs in the debug.log and should spot exactly the issue.

For APRS, that is not something I can explain. My software does not have any frequency coded it in, I use only channel ID's so, very odd. I will work on enabling the terminal feature, once done, you should be able to work both APRS and your BBS at the same time. I will add APRS frame type support in the terminal.

Ylianst avatar Jan 25 '25 21:01 Ylianst

@khusmann @TheCommsChannel HT Commander v0.7 was just released (link). Lots of changes and improvements made. The terminal feature is the main one, it should allow someone to contact a BBS in a proper way. I currently support RAW AX.25 Frames and APRS frames in the terminal. I also have a address book now, to store settings. There are a bunch more improvements all over the place.

If you can give it a run and give me feedback, that would be appreciated.

Image

Image

Ylianst avatar Jan 30 '25 05:01 Ylianst

@Ylianst Got it working great now! When I first started messing with it today, I got the VR-N76 working and couldn't get the UV-PRO to work for some reason. After a good bit of trial and error, I finally figured out how to get things to pair and work consistently using the following steps

1. Go to the Windows Bluetooth Settings
2. Put phone in pairing mode 
3. Add device 
4. Select Bluetooth 
5. Select the radio from list when it appears to pair with it
6. Open up HT Commander 
7. Put phone in pairing mode 
8. Click connect 
9. Select which radio if there's multiple listed
11. Go back to the Bluetooth settings page and wait for the additional Bluetooth device with the server icon to show up in the Windows Bluetooth settings
12. Take phone out of pairing mode
13. Exit HT Commander 
14. Open HT Commander back up
15. Make sure phone isn't in pairing mode, click connect and things should start working

I noticed in the debug screen that once Send: 000200050004 is sent, the additional Bluetooth device with the server icon appears.

Maybe this could be done programmatically within HT Commander as part of a pairing process or sorts?

A few separate notes. Can the SSID requirement be lifted from the address book to allow for use of APRS services?

I've had many comments on my videos with people wanting a way to be able to program their radios without the app so this will be great for them! I know a lot of them are using and are familiar with CHIRP. I think they would like the ability to import a CSV from CHIRP at some point down the road if possible.

Thanks for the great work on this!

TheCommsChannel avatar Jan 31 '25 02:01 TheCommsChannel

@Ylianst fantastic work, love all the updates!

On my end I have full audio support working (send and receive) and will be publishing a new version of benlink soon... stay tuned!

khusmann avatar Jan 31 '25 03:01 khusmann

Oh good find @TheCommsChannel. It had not occurred to me to do that. If I get an access denied error, I could now guide the user to pair the device correctly. Really good find.

  • Maybe this could be done programmatically within HT Commander as part of a pairing process or sorts?

Yes, I will work on that.

  • Can the SSID requirement be lifted from the address book to allow for use of APRS services?

Oh, maybe I understand. AX25 frames always have a SSID (0 to 15), but APRS destination does not have to have it. So, I need to allow sending a callsign with no SSID in the APRS frame. If that is the request, yes, I will do that. By the way, if you ever capture a set of packets, you can select a range of them right click and save that as a separate file. If you send it over (or email me) I can then open it and match the frames. Increases the chances I will get it right.

  • I've had many comments on my videos with people wanting a way to be able to program their radios without the app so this will be great for them! I know a lot of them are using and are familiar with CHIRP. I think they would like the ability to import a CSV from CHIRP at some point down the road if possible.

Yes, I will add channel import/export. I looked at the UV-Pro format and I am working to support that, I have not looked at CHIRP, but I am sure I can look it up and implement it.

Ylianst avatar Jan 31 '25 04:01 Ylianst