OpenGD77 – Hotspot mode

posted in: DMR, GD-77, Ham radio | 75

For the last 6 weeks, I’ve been intensively working on the Hotspot mode as part of the OpenGD77 firmware, and it is now finally with the Beta testers in Australia, Europe and the USA.

Note. Currently firmware seems to be stable but not completely bug free, so I am limiting its use to the Beta testers.

 

 

Hotspot mode converts a Radioddity GD-77, running the OpenGD77 firmware, into a DMR ONLY high power hotspot when its connected to a Raspberry Pi running PiStar.

No other hardware is required, just the RPi and the GD-77

 

In this photo I’m using a Raspberry Pi 3B+, but I’ve also tested with a RPi Zero W and it works just as well.

 

The GD-77 is connected to the RPi via its USB programming cable, and the only change that needs to be made in PiStar, is to change the modem type to any of the “Zumspot” compatible modem types e.g. the “Zumspot Libre”

 

 

One thing however you won’t see unless you modify you copy of PiStar is the “modem” name being displayed in the PiStar dashboard, because PiStar only supports displaying the firmware version for the specific “modems” in the list

I have modified my copy of PiStar to add the OpenGD77 Hotspot, and I presume if enough people eventually use their GD-77’s as hotspots, Andy may add the OpenGD77 Hotspot as a new modem type in PiStar, so that it will display correctly.

 

I’ve done rather shaky video showing the OpenGD77 Hotspot mode working with a Rasperry Pi Zero.

 

For those of you interested in the technical details, please read on..

 

Conceptually both Kai and I assumed that adding Hotspot mode functionality to the OpenGD77 firmware should not be too complicated, because we can access the DMR data from any transmission which the GD-77 receives, and can also transmit and audio and other data via DMR RF.

 

Unfortunately our assumptions about the difficulty in writing Hotspot mode were not correct, and a great deal of new code needed to be added to the OpenGD77 firmware to support Hotspot mode.

 

Before I continue, I think its worthwhile explaining how a normal PiStar hotspot works.

At the core of PiStar is a program called MMDVMHost, which was written my Jonathan G4LKX,  which interfaces the original MMDVM modem hardware, to the Internet servers for DMR and other protocols.

MMDVMHost communicates with the “modem” using its own serial protocol, originally via USB Serial but now more commonly via GPIO serial on a Raspberry Pi to a MMDVM_HS Hat board, aka Jumbospot.

MMDVMHost handles the server connectivity and a loads of other functions, to seamlessly transfer the data, to and from the “modem” board.

 

I had assumed that the data being set between the “modem” hardware and MMDVMHost contained high level DMR data, including the transmitting stations DMR ID number and the Talkgroup number as well as the AMBE compressed audio data bytes.  However, when intercepted some of the serial data being sent between the Raspberry Pi and my duplex hat board, (running in simplex mode), I realised that I was at least partially wrong about how MMDVMHost and MMDVM (or MMDVM_HS) work.

I expected to see data bytes containing my DMR ID (5053238) , as well as bytes containing the Talkgroup I was using (505), but the data between the hotspot board and the RPi did not seem to contain that data at all.

 

After some research, I found out that the data is in the  “On Air” format, and that modem (Hat etc) boards only do minimal processing of the DMR 4FSK data which they receive before sending it to MMDVMHost

 

MMDVMHost then creates a packet of network data, which is a header containing the Source and Destination ID’s etc, followed by the raw “On Air” data.

At the other end of the system, e.g. any hotspots connected to the same Talkgroup; MMDVMHost, sends the On Air portion of the network packet of data to the modem, and the modem basically just remodulates the On Air data to 4FSK and transmits it.

 

The GD-77 hardware however, works completely differently….

The GD-77 has a dedicated IC ( Hongrui HR-C6000)  which performs both the 4FSK demodulation and also completely decodes the DMR “On Air” protocol, so that the CPU in the GD-77 does not need to do this processing.

 

HR-C6000

Note. This is the same IC that is used in radios like the TYT MD-380 etc and I  Baofeng RD-5R and Baofeng DM-1801 etc

Except the MD-380 uses the older version, called the HR-C5000

 

 

Hence the only way to interface the OpenGD77 firmware to MMDVMHost was for the OpenGD77 firmware to generate the “On Air” format data that MMDVMHost and every other hotspot expected to receive.

This would have been an incredibly difficult task, except that MMDVMHost contains all the functionality that I needed to both encode to the “On Air” format and also to decode the “On Air” format, and because MMDVMHost is open source, I was able to incorporate the majority of its DMR processing functionality, into the OpenGD77 firmware.

 

Unfortunately, even though MMDVMHost contained all the necessary functionality, MMDVMHost does not use the functionality in the way that I needed to. For example,  It normally decodes the “On Air” data, rather than encoding it, so I had to work out which bits of MMDVMHost I needed to encorporate in the OpenGD77 firmware and also how to use those parts, to do almost the reverse of what they normally do.

And just to complicate things, MMDVMHost is written in the C++ language in an Object Orientated way, whereas the OpenGD77 firmware uses the C programming language which does not support Objects or a number of other features of C++, like function overloading which MMDVMHost makes use of.

So all the source code files needed to be “ported” from C++ to C by making changes to around 50% of the code.

Consequentially, it took me 3 or 4 weeks to find the parts of the functionality in MMDVMHost which I needed to port, and to port them and integrate them into the OpenGD77 firmware.

Additionally, I had to implement the functionality to communicate via MMDVHost’s serial protocol, as well as integrate the new functionality into the existing OpenGD77 Tx and Rx functionality.

Needless to say this was quite a complex task, but after 50 hours of work, I was able to receive network data from MMDVMHost and get the GD-77 to transmit it via RF.

It took me another week to write the functionality so that the received RF DMR signal was sent to MMDVHost, and yet another week to add some missing functionality like Private Calling, and also the transmission of Talker Alias data when received from MMDVMHost as embedded data in the Voice audio frames.

 

Various versions of the firmware have been with the Beta testers for about a week, and they are still uncovering a few bugs, so currently I don’t feel its stable enough for general release. However I plan to make it part of the OpenGD77 firmware in the fullness of time.

 

BTW.

If anyone has some specific questions, please post comments, as I have glossed over a lot of the complex technical details of how I made this work, as that would probably be incredibly tedious and also take many hours to document 😉

75 Responses

  1. Justin Korpal
    |

    Roger, I have the firmware loaded on the radio, Do I need to do anything in the radio menus to start the hotspot, or will it start as soon as I rebook with the radio connected?

  2. Roger Clark
    |

    The radio now detects when it is being sent commands by MMDVMHost / PiStar and will automatically enter Hotspot mode

    See the video on YouTube

  3. Heinz DO3MY
    |

    hope we get a german manuel for the Hotspot Mode in the future and a hareware list 🙂 Thx for all the work

  4. Roger Clark
    |

    Someone else would need to do a German manual, because I don’t speak German

  5. Mike, DL2MF
    |

    I will provide a german radio asap, but currently there are a lot of improvements/changes.

  6. Roger Clark
    |

    I’ve almost finished adding a section about Hotspot mode.

    I’ll publish an updated version at the weekend.

    There will also be some other changes as I’m adding Talker Alias transmission as an option, and Colin G4EML has been adding some DMR mode control functionality, which will probably need changes to the UI.

  7. W8SDR
    |

    Roger, I am a 50+ year ham. You are to be commended for the brilliant work you are that you are providing to this project. I just want to thank you for your dedication and efforts. You are a true role model for Amatuer Radio. God Bless You!

  8. Roger Clark
    |

    LOL

    I’m in my 50’s.

    You don’t need to be young to develop software 😉

  9. EA3BIL Rafa_RGB
    |

    Roger,

    I agree W8SDR comment, I’m also over 50…

    Your example is a great model of Hamradio.

    Keep doing man !!

    73’Rafa.

  10. Anonymous
    |

    hi Roger, one question. In my case, when long time pass, in HT display can see “hotspot waiting for pistar” and system not work. Is normal that. I working last firmware and raspi 3 (non 3+). Pistar has update.

  11. Roger Clark
    |

    What version are you running.

    Originally, Hotspot mode needed to be manually entered from the menu, but it now automatically detects.

    If you are running a version released in the last 2 weeks it will auto detect, but this means that the OpenGD77 firmware has probably rebooted but PiStar does not know, and PiStar then sent a command , but not enough information for the Hotspot to work completely

  12. Bill Darvill
    |

    Hello Roger, fantastic job very well done. Thanks from myself in gratitude for what you have achieved. Slightly off field but I have one of the GD 77S radio’s, in time do you think this might be included in your project?
    Cheers
    Bill

  13. Roger Clark
    |

    People keep asking about the 77S

    I don’t have a schematic or that radio, so can’t port the code even if I have time.

    Writing this firmware is very time consuming, and I currently I am the only person on the project.

  14. S56VDK
    |

    Hello! I am totaly newbie with raspberry. Can you explain me what do i need to do after i burn image with latest pi-star on it and pi-star dashboard configuration…

  15. EA3BIL Rafa_RGB
    |

    About the message “hotspot waiting for pistar”.

    I noticed it shows when pressing “RED” button during HS mode operation.

    To have it “back to HS Mode”, you only need to go to CONFIG page on PiStar and CLICK “Apply Changes” button,
    NO CHANGES need to be done, only Click “Apply Changes”.

    This makes PiStar to roll over modem config (not rebooting, nor powercycling the PiStar software or Raspi) and sending the “requests” to the modem.
    OpenGD77 will “listen” those requests and automatically enter into HotSpot Mode. ( TADA!!! )

    I hope that helps!!

    When time enought available… I will produce some manual for this great FW.

  16. Roger Clark
    |

    This seems to be a quirk with the version of MMDVMHost in PiStar

    If you exit from Hotspot mode, PiStar seems to re-send some of the setup information, but not all of it.
    This causes the OpenGD77 to go back into Hotspot mode, but it doesn’t receive all the necessary settings.

    I should probably change the the code, so that if you press the Red button to exit from Hotspot mode, then the firmware ignores all further commands from PiStar.

    However, I’m busy working on the Tier 2 Passive (repeater operating) mode, so don’t have time to make changes to anything else at the moment

  17. Mario
    |

    Good evening Roger,
    I need to change the firmware to get a menu that fits my needs. How can I unzip the firmware to be able to modify it?
    Thank you 73 de IU0GEH

  18. Ric K7iTE
    |

    Has anyone tried the Open Firmware on the GD-77S? (the one without the LCD display)

  19. Roger Clark
    |

    No.
    It won’t install.

    1. GD-77S uses different firmware encryption, so the firmware file will not run at all if you attempt to install it.

    2.The codeplug is not the same and when the firmware boots it will try to read the codeplug and could crash as the data will be garbage

    3. Its not quite the same hardware. Not only does it now have the display, but it has a switch connected to the keypad input and a lot of the keypad inputs will also be disconnected.

    I leave it to other people to convert the firmware for other platforms. I only have time to develop the firmware for one radio i.e the GD-77

  20. Roger Clark
    |

    Its open source.

    You can change it any way you like.

  21. gaspo
    |

    Hi, really enjoying your firmware on my gd-77. so much that ive been pulling my hair trying to get pi-star to go hotspot with it when i realize “beta testers” only? i have your v0.3.4 loaded, and getting “unable to read the firmware version after six attempts”, do i have the right firmware to start with? thanks for great work! 73 de AF6MQ

  22. Roger Clark
    |

    The Tier 1 version, that I released ages ago (link is in this post) has Hotspot mode in it. But when using it as a normal radio, you can’t access repeaters or duplex hotspots

    The Tier 2 Alpha can access both simplex and duplex hotspots as well as repeaters, but does not currently have Hotspot mode at all.

    Currently there isn’t a version that does both Tier 2 and also Hotspot mode, as I’m still trying to make the Tier 2 version stable.

  23. mrericksoMarc
    |

    I just checked on my PiStar R4.1.0-RC6 hotspot with the latest updates and it now has the OpenGD77 modem listed as a configuration option.

  24. Roger Clark
    |

    This has been an option in most versions for around 2 months.

    I’m surprised it was not in the version 4 until now.

    Are you sure this is a recent change ?

Leave a Reply