Band Pass detection via I2C bus

177 views
Skip to first unread message

Nicholas Evans

unread,
Aug 11, 2025, 3:03:03 AMAug 11
to Hermes-Lite
This topic has been addressed in many different ways. However, I have run into a problem where I am unable to see any data on the I2C bus. In particular, I am connected via the SDA and SCL lines on the 20 Pin header connecting the main board of the Hermes to the filter board (pin 4 and 5 in from the rj45 network side of the main board). The wired connections connect to an Arduino Nano development chip with appropriate code to read the SDA and SCl lines. This has been documented and tested thoroughly by a Tech Minds video "https://www.youtube.com/watch?v=nGPKPGUB4O0". My own code can see the I2C bus, reports back address 0x20 and 0x2C as connections points into the I2C bus. I have attempted to read data from these addresses and have rewritten the code in many different ways to access the band data. I obtain nothing more than the 0x00 output when changing the band on the Hermes via Thetis software. All expected things liking wiring, coding, code compilation are showing no errors with expected outputs in Arduino IDE. My last piece of code I wrote, just simply snoops for any data on the I2C bus, this also returns nothing. See Below for Code and output.

Code:
#include <Wire.h> // Include the Wire library for I2C communication

// Define a dummy slave address for the Arduino.
// When acting as a 'snooper', the Arduino will mostly ignore its own address
// and listen to all traffic passing through the bus. However, Wire.begin()
// for slave mode typically requires an address. We'll use a common unused one.
const byte ARDUINO_SLAVE_ADDRESS = 0x7F; // A high, generally unused address

// This function is called automatically whenever the Arduino receives a write
// (data from master to this slave address) on the I2C bus.
// For snooping, it will be called for any data sent by the master, even if not
// explicitly addressed to ARDUINO_SLAVE_ADDRESS (depending on Wire library implementation).
void receiveEvent(int howMany) {
  Serial.print("Received ");
  Serial.print(howMany);
  Serial.print(" byte(s) from Master: ");
  while (Wire.available()) { // loop through all but the last byte
    byte receivedByte = Wire.read(); // receive byte as an int
    Serial.print("0x");
    if (receivedByte < 16) Serial.print("0");
    Serial.print(receivedByte, HEX);
    Serial.print(" (Bits: ");
    for (int i = 7; i >= 0; i--) {
      Serial.print((receivedByte >> i) & 0x01);
      if (i == 4) Serial.print(" ");
    }
    Serial.print(") ");
  }
  Serial.println(); // end of message
}

// This function is called automatically whenever the Master requests data from
// this slave address. We won't be sending data for snooping, but it's good practice.
void requestEvent() {
  // If the master requests data from this Arduino's address, you could respond here.
  // For snooping, we typically don't need to send anything.
  // Wire.write("hello"); // example: respond with "hello"
  Serial.println("Master requested data from Arduino (ignored for snooping).");
}


void setup() {
  Serial.begin(9600); // Start serial communication
  Serial.println("\n--- Arduino I2C Snooper (Slave Mode) ---");
  Serial.println("Listening for I2C traffic...");

  // Initialize the Wire library in slave mode with a dummy address.
  // The crucial part for snooping is that Wire.onReceive will trigger for all traffic.
  Wire.begin(ARDUINO_SLAVE_ADDRESS);

  // Register event handlers
  Wire.onReceive(receiveEvent); // Register receiveEvent to fire when master writes to bus
  Wire.onRequest(requestEvent); // Register requestEvent to fire when master requests from us
}

void loop() {
  // Nothing to do in the main loop, as communication is handled by event functions.
  // The Arduino is just listening in the background.
  delay(100); // Small delay to prevent busy-waiting, but still responsive.
}

OutPut:

 --- Arduino I2C Snooper (Slave Mode)
Listening for I2C Traffic...
    < no data>
Any help or assistance for be greatly appreciated!


Gary Abercrombie

unread,
Aug 11, 2025, 8:37:07 AMAug 11
to Nicholas Evans, Hermes-Lite
Nicholas,

I have not attempted to eavesdrop on multiple ports with an Arduino as you are trying but I have implemented a Hermes monitor using various ports 0x20, 0x21, 0x22, ...0x2c.  I ended up using port 0x2c which was the port which receives commands from Hermes for multiple purposes.  Typically in HPSDR, a PCA9555 I2C extender is used on each peripheral board with unique addresses (0x20, 0x21, 0x22, ...) for each.

Wonder if having two event handlers registered - receiveEvent and requestEvent is causing issues or not.  This is also something I have not tried to do.  Seems like your requestEvent would be listening on port 0x7f and not all ports. I would suspect the Arduino I2C library code could only be a slave on one address and not multiple ports.

From the video link you provided, I am not sure why they needed one Arduino to eavesdrop on the I2C and another Arduno to process the band request via serial link.  Seems like both functions could be done by a single Nano.

Gary

--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hermes-lite/04258155-6351-4311-923d-bd5a0daaf7c1n%40googlegroups.com.

Ed Marciniak

unread,
Aug 11, 2025, 2:42:25 PMAug 11
to Nicholas Evans, Hermes-Lite
I haven’t worked with a nano, or looked at its I2C slave implementation, but it’s worth mentioning that a 7 bit I2C address is concatenated with the read/write bit when a byte is actually sent on the wire. 

Is it possible you need to set that bit when snooping writes to a device?


From: herme...@googlegroups.com <herme...@googlegroups.com> on behalf of Nicholas Evans <tssn...@gmail.com>
Sent: Monday, August 11, 2025 2:03:03 AM
To: Hermes-Lite <herme...@googlegroups.com>
Subject: Band Pass detection via I2C bus
 

Nicholas Evans

unread,
Aug 12, 2025, 3:07:30 AMAug 12
to Hermes-Lite

Thanks to both Ed and Gary for your quick responses. Much appreciated. I have written alot of code to investigate this problem, all are coming up ZERO. I have scanned the bus for devices handlers ... Comes back with 0x20 and 0x2c addresses. Have tested on both these addresses. So that is good. I have pulled backed 1 byte from these locations, returned 0x00, I have pulled in more than 1 byte, no go on that either. I have written the code to both trigger on an event and also directly polled the address on a continuos' basis, also a no-go.  Ed, your idea is worth investigating, I did see this mentioned in some forum topics. What I don't understand, is the youtube video mentioned above, has very simple code that is seeing the I2c bus data on address 0x20. What gives, I do not know! Will keep investigating .....

Nicholas Evans

unread,
Aug 12, 2025, 3:13:49 AMAug 12
to Hermes-Lite
Another option that I am investigating is that the SDA and SCL lines run at different voltages. The Nano chip runs at 5V and the Hermes lite runs at 3.3V. From what I understand from my research, this should not cause a problem...however?
I have just ordered a 5v <--> 3.3V logic shifter from Alli Express. Will let the forum know, how that experiment pans out!

Mike Lewis

unread,
Aug 12, 2025, 4:58:07 AMAug 12
to Nicholas Evans, Hermes-Lite
Have looked at the N2ADR IO board code?

Sent from my T-Mobile 4G LTE Device
Get Outlook for Android

Sent: Tuesday, August 12, 2025 12:13:48 AM
To: Hermes-Lite <herme...@googlegroups.com>
Subject: Re: Band Pass detection via I2C bus
 

Ed Marciniak

unread,
Aug 13, 2025, 6:16:20 PMAug 13
to Nicholas Evans, Hermes-Lite
Don’t overlook I2C isolators like the ones from Analog devices. In the process of providing DC isolation, they also permit one side to be run at a different voltage.

Years back, I was playing with multiple I2C gyroscopes and ended up needing an I2C multiplexer because the computer had 1.8–>2.5V—>3.3V—>5v level shifters and couldn’t drive the capacitive load. I didn’t just get unreliable communication. The devices didn’t answer at all. In hindsight, an isolator would’ve been better, regenerating the signal with full load drive capability.

Going from memory, a representative part number would be the Analog Devices ADUM1254. There are other interesting chips in the same line for other purposes like I2S or SPI isolation.

Those use a magnetic (transformer) coupling with circuits that encode the signal and determine the direction since the I2C SDA line is bidirectional.


Sent: Tuesday, August 12, 2025 2:13:48 AM
To: Hermes-Lite <herme...@googlegroups.com>
Subject: Re: Band Pass detection via I2C bus
 

Mike Lewis

unread,
Aug 13, 2025, 6:27:15 PMAug 13
to Ed Marciniak, Nicholas Evans, Hermes-Lite
Adafruit has several i2c isolators and driver modules at low cost and small easy to use pcb modules. 

Sent from my T-Mobile 4G LTE Device
Get Outlook for Android

From: herme...@googlegroups.com <herme...@googlegroups.com> on behalf of Ed Marciniak <edr1...@gmail.com>
Sent: Tuesday, August 12, 2025 9:46:35 AM
To: Nicholas Evans <tssn...@gmail.com>; Hermes-Lite <herme...@googlegroups.com>

Clifford Heath

unread,
Aug 13, 2025, 6:42:14 PMAug 13
to Ed Marciniak, Nicholas Evans, Hermes-Lite
These isolators are also useful for isolating noise sources.

Clifford Heath 

Reply all
Reply to author
Forward
0 new messages