Small Software Project Looking For Volunteers

381 views
Skip to first unread message

Steve Haynal

unread,
Oct 29, 2019, 1:41:43 AM10/29/19
to Hermes-Lite
Hi Group,

Jim N2ADR provided an initial basic program for HL2 testing which has been extended over time. It is written in C/C++ and uses the fltk gui library. It is cross platform and runs on Windows and Linux (x86 and ARM). It is small and compiles to a single executable with no external dependencies. Recently I added the ability to target Windows with mingw so all development can be done on Linux. I am looking for a volunteer to own and enhance this utility program:

* Add support for gateware programming over the network. See this post from Alan for working code from SparkSDR that does the same.
* Add support for setting fixed IP and MAC addresses, and then enabling/disabling them, as described on the  wiki.

The goal is to have HL2 specific configuration and testing in one simple executable so that other software is not required to support all configuration features. (Any software can still support these features if they desire!) The code is on github:


Please reply to the group or to me privately if you are interested.

73,

Steve
kf7o

Jeff _

unread,
Nov 19, 2019, 6:52:34 AM11/19/19
to Hermes-Lite
Hi, has someone responded to this, or are you still looking for a volunteer ?
I just received my build 9, and I'm happy to start playing with it :)
I can be interested but I have a few questions about the program you are looking for :
-I understand you're looking for a small, multi-platform, self contained program. But is FLTK mandatory ? A network code library is also needed. I think that Qt would provide smaller code, network library included, also multi-platform. Final executable could be  bigger but it can also be self-contained.
-Looking at Alan's code for gateware programming, this is plain UDP writing, with no checksum or correction code : is this implemented ine the gateware ? (Sorry, I'm a newbie here)

Jeff

Alan Hopper

unread,
Nov 19, 2019, 7:22:15 AM11/19/19
to Hermes-Lite
Hi Jeff,
as far as I know there is no checksum. I believe it has been added recently to the hpsr protocol 2 spec and it would be nice to have. I also think the last packet is not ack'd as I guess the radio is busy reseting before the packet gets out.  It would be good to have some means to prevent the wrong firmware being selected, ideally the hardware should report its build but if the gateware reported the hardware version it was built for, it could at least prevent getting it wrong once a correct version has been loaded ie.'gateware is built for a different hw release than currently installed'
73 Alan M0NNB

Steve Haynal

unread,
Nov 20, 2019, 1:23:10 AM11/20/19
to Hermes-Lite
Hi Jeff,

Yes, I am still looking for a volunteer. There is no requirement to use FLTK. It was just a possible starting point. Multi-platform QT would be great. Just functionality to update the gateware and set EEPROM values would be a terrific start. We have implemented the openhpsdr protocol 1 gateware update which has no checksum in the current gateware. SparkSDR and Quisk provide support to update the gateware. We can consider something safer if there is interest and we go out on our own. 

Thanks for you consideration!

73,

Steve
kf7o

Jeff _

unread,
Nov 20, 2019, 1:20:50 PM11/20/19
to Hermes-Lite
Thanks for your answers, Alan and Steve !
I will start working on that with Qt then, stay tuned :)

Jeff _

unread,
Nov 25, 2019, 4:13:25 AM11/25/19
to Hermes-Lite
Do you have a pointer to the UDP protocol ? I'm quite lost trying to figure out how it works. The Wiki refers tu an 'USB' protocol ?

Alan Hopper

unread,
Nov 25, 2019, 4:25:51 AM11/25/19
to Hermes-Lite
Jeff,
the udp stuff is described here https://github.com/TAPR/OpenHPSDR-Firmware/blob/master/Protocol%201/Documentation/Metis-%20How%20it%20works_V1.33.pdf  For programming I think that is all that is needed.  The earlier usb based protocol is wrapped in these udp packets so you have to refer to that as well for other radio functions.
73 Alan M0NNB

Matthew

unread,
Dec 3, 2019, 4:55:58 PM12/3/19
to Hermes-Lite
I've been trying to write a basic Cpp application to receive data from the HL2. I'm working from the two protocol files linked on the wiki https://github.com/softerhardware/Hermes-Lite2/wiki/Protocol

I've got the discover packet being returned from the HL2, I can read this, send back some settings, then issue a start. I've been using wireshark and I can see I broadly mirror the sequencing of gnuradio hl2 plugin  and linhpsdr.

The how metis works document says if I issue a start command it will continue sending until a stop command is issued. Is this true for the hl2? Using wireshark I can see PC software periodically sending a packet back to EP2. Do I have to do this for receive only? Right now I'm not doing this and after the HL2 sends around 2000 UDP messages, it stops. I'm not sure if this is just a bug in my code.

I've had a look at the gateware, but my verilog is rusty having not used it for about 4 years.

Any pointers would be much appreciated.

73 Matthew M5EVT.

Alan Hopper

unread,
Dec 3, 2019, 5:05:34 PM12/3/19
to Hermes-Lite
Hi Matthew,
you are probably seeing the watchdog working, It stops sending after a while if no packets are sent to the radio, you can keep it alive by sending the cc/tx/audio packet to the radio, at 48k it is simple as you can just send one for each received packet.
73 Alan M0NNB

Steve Haynal

unread,
Dec 3, 2019, 5:06:43 PM12/3/19
to Hermes-Lite
Hi Matthew,

I think your Cpp code is working correctly. The HL2 expects to receive regular packets from the host. There is a watchdog timer in the HL2 that is reset to zero whenever it receives a packet from the host. If the watchdog counter overflows, then the HL2 disconnects and stops running. This is to prevent some situations where we saw software crashing but the HL2 kept chugging away and had to be manually power cycled. In this worst scenario, this could happen during TX. This watchdog is not documented in the older protocol 1 documents. I think you are hitting this timeout after ~2000 UDP messages to the host.

Thanks for your work. I'm interested in what app your are developing. 

73,

Steve

si...@sdr-radio.com

unread,
Dec 3, 2019, 5:15:45 PM12/3/19
to Matthew, Hermes-Lite

Matthew,

 

I have C++ HL2 support working in SDR Console, if you’re on 80m I’m available for on-air hand-holding.

 

Advanced warning – swap the I and Q you receive otherwise the waterfall is inverted. The document mentions this.

 

Simon Brown, G4ELI

https://www.sdr-radio.com

Matthew

unread,
Dec 3, 2019, 5:27:24 PM12/3/19
to Hermes-Lite
Thanks all. Good to know this is not me.

This cpp code is my first step in building upon my prototype CW skimmer https://groups.google.com/d/msg/hermes-lite/OjsSzgF6jng/XrJDsnfjAwAJ I have purchased an NVIDIA Jetson Nano and I am moving prototype Python scripts into working Cpp and offloading as much as possible to the GPU. I cheated and used GNU radio for this first prototype. The TensorFlow parts of the CW "decoder" are exactly what the Jetson seems to be designed for.

I'll report back if/when I have something more promising. I still want to see how this could link into other SDR software like Spark. But first I need to prove ability to "decode" a full band off CW in real time using the GPU.

73 Matthew M5EVT.

Jeff _

unread,
Dec 10, 2019, 2:49:07 PM12/10/19
to Hermes-Lite

Thanks ! I started the project (slowly, beacause my C++ is rusty and I don't have a lot of spare time :p).

Nothing usefull yet, it is simply discovering my HL2 unit on the network ^^

hl2c_ip.png

Steve Haynal

unread,
Dec 12, 2019, 1:26:53 AM12/12/19
to Hermes-Lite
Hi Jeff,

Thanks for the update and the github link. Great progress!

73,

Steve
kf7o

Jeff _

unread,
Dec 12, 2019, 3:40:30 PM12/12/19
to Hermes-Lite
Thanks !
I have another question about seeting the IP address.
Here is what I have found in the documentation :

Set IP address
The IP address may be set as follows. First use Discovery to determine the MAC address
of the
Metis you wish to set the IP address.
Send a Broadcast UDP/IP frame to Port 1024 containing the following:
<0xEFFE>< 0x03>< MAC Address><IP Address to set><60 bytes of 0x00>
Where <MAC Address > is the address of the Metis you wish to set the IP Address, 6
bytes
and <IP Address> is the IP address to store in the EEPROM, 4 bytes.
After the Address has been written to EEPROM, which may take a few seconds, Metis
will respond to the IP address of the PC that
set the IP address and using the set IP
address
as follows:
<0xEFFE>< 0x02>< MAC Address>< 60 bytes of 0x00>

How do I siwtch back top DHCP mode after the IP address is set ?
Thanks :)

Jonas Sanamon

unread,
Dec 12, 2019, 4:29:47 PM12/12/19
to Hermes-Lite
Hi Jeff,

I guess the following answers Your question:

---------- Forwarded message ---------
Från: Steve Haynal <softerh...@gmail.com>
Date: fre 18 okt. 2019 kl 19:44
Subject: Re: Gateware 20191013 Released (+ Question)
To: Hermes-Lite <herme...@googlegroups.com>


Hi All,

Thanks for the discussion. I agree that when DHCP is available it should be used, and static allocation should be done by the DHCP server. The main need for fixed IP that I can think of is when there is no DHCP server, such as a simple single connection between host and HL2. The original openhpsdr RTL and current HL2 gateware (when fixed IP is hardcoded in the gateware build) does the following:

1. Use fixed IP if not 0.0.0.0.
2. If no fixed IP, use DHCP IP
3. If no DHCP IP, use APIPA IP

-----

In other words, my first guess would be to set the IP as 0.0.0.0 in order to enable DHCP client mode.

Best Regards
Jonas - SM4VEY

Alan Hopper

unread,
Dec 12, 2019, 4:35:50 PM12/12/19
to Hermes-Lite
Hi Jeff,
I may be wrong and I have not got around to trying this yet but my belief is that the ip address and priority is set by programming the eeprom on the HL2 as described here https://github.com/softerhardware/Hermes-Lite2/wiki/Protocol in the Configuration EEPROM section.
73 Alan M0NNB

Steve Haynal

unread,
Dec 13, 2019, 2:20:07 AM12/13/19
to Hermes-Lite
Hi Jeff,

It is a little confusing as there was some early discussion on this list that didn't materialize, plus the original IP set spec from openhpsdr which is not implemented in the HL2. The best information is the wiki page Alan pointed you to. Also, a good reference is the code in Quisk: https://pypi.org/project/quisk/#files  

See hermes/quisk_hardware.py 

I've copied some relevant portions of this file below.

73,

Steve
kf7o

  def WriteEEPROM(self, addr, value):
    ## Write values into the MCP4662 EEPROM registers
    ## For example, to set a fixed IP of 192.168.33.20
    ## hw.WriteEEPROM(8,192)
    ## hw.WriteEEPROM(9,168)
    ## hw.WriteEEPROM(10,33)
    ## hw.WriteEEPROM(11,20)
    ## To set the last two values of the MAC to 55:66
    ## hw.WriteEEPROM(12,55)
    ## hw.WriteEEPROM(13,66)
    ## To enable the fixed IP and alternate MAC, and favor DHCP
    ## hw.WriteEEPROM(6, 0x80 | 0x40 | 0x20)
    if self.hermes_code_version >= 60: 
      i2caddr,value = 0xac,(value%256)
    else:
      i2caddr,value = 0xa8,(255-(value%256))
    addr = (addr << 4)%256
    self.pc2hermeslitewritequeue[0:5] = 0x7d,0x06,i2caddr,addr,value
    self.WriteQueue(1)
    if DEBUG: print ("Write EEPROM", addr, value)

Jeff _

unread,
Dec 15, 2019, 12:03:24 PM12/15/19
to Hermes-Lite
I'm sorry to ask so much questions, but I'm still struggling with to protocol.
I looked at Quisk, and can't figure what I'm doing wrong : I don't get any response when trying to read EEPROM.
Here is a debug log of what goes over UDP :

Scanning network...


Message broadcast:  "effe02000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"


Message receive:  "effe02001cc0a213dd43064845524d45534c540406060606060606060606060606060606060606060606060606060606060606060606060606060600"


Message send:  "effe0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"


Message send:  "effe0106307d07ac08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"


After sending the last message, there is no response : do I miss something ?

Steve Haynal

unread,
Dec 15, 2019, 4:14:58 PM12/15/19
to Hermes-Lite
Hi Jeff,

No worries about questions. Response only occur when IQ data is started. effe0400 should be effe0401 to turn on the IQ data. Currently it is a bit heavy weight as the radio must be running for you to see data. I'd like to change that in the future by opening another port that doesn't require the radio to be running.

73,

Steve
kf7o

Jeff _

unread,
Dec 15, 2019, 5:05:30 PM12/15/19
to Hermes-Lite
Thanks ! Now I see the data :)
Reply all
Reply to author
Forward
0 new messages