ESP32 Using ESP NOW...
 
Notifications
Clear all

ESP32 Using ESP NOW and Bluetooth

212 Posts
5 Users
23 Reactions
7,729 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio Sorry Mike, I don't understand what or why you are doing. Once the freq is found, and the modulation, then on the analysis tab the decoding you should be able to see a pattern (best in hex not bit).

I am worried I am way off base so maybe I will just lay off commenting here and play with the dongle when I get it. The only RF remote I know I have for sure is my car remote. That is a great choice as I am sure it has already been hacked so all you need to do is repeat the same steps.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 8 months ago
Posts: 329
 

@zander

Posted by: @zander

What does the Analysis screen say? I have seen nothing of that.

What did 'Sniff Protocol' say?

What does the Demodulation screen show?

What Modulation did you select, Phase Shift, Amplitude, Frequency?

How many bits per symbol?

I think many (if not all) of these Q's will be answered shortly.

Posted by: @zander

Am I misunderstanding your intent?

A little.

I want to be sure we're all on the same page in terms of what the actual data looks like, what we're measuring, and how we're measuring it. Mike is the only one with the device but once he's captured the signal, he can share that data file with us, and we all see the same thing in URH.

From that we can sensibly move to the extraction of the demodulated data and then coding that for retransmission.

I want to use Mike's captured data file but I should be able to show the extraction process with any URH data file. Surprisingly, I've had trouble finding sample URH data files. I think I found one ask_complex in the git repository

( https://github.com/seclib/urh/blob/master/tests/data/ask.complex)

That's what I'll use here to demo the data selection, and measurement.

If you load the file ask_complex into URH you get

URH 009

The shows the data using Analog view. We want to switch that to Demodulated view. n.b.  this is demodulating the signal as ASK; see the Modulation field. 

URH 010
URH 011

Adjust the Y-scale and zoom the X-Scale to get a better picture

URH 012

Note the fields between the two windows showing number of samples, duration in micro seconds, and the db value.

The demodulated window shows the signal values in binary. When you highlight the bit values in that window, they are highlighted in the waveform window, so you can see what part of the signal you're highlighting and, most critically, you see the duration of highlighted signal. 

You need that information in order to reconstruct the signal for retransmission. This is how Andreas does it, but he glossed over it. Also, luckily for him, the signal was repeated consistently.

In any case, given the captured data file, we can accurately measure how long we must send high and low signals and the order of transmission to retransmit the signal. We may need to adjust the timing and possibly the frequency, but I'm hoping the defaults will work.

The one who has the most fun, wins!


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 8 months ago
Posts: 329
 

@huckohio 

I see the files now.

When I load them in URL they don't look anything like the samples in the demo videos. They seem to contain multiple samples using FSK modulation. I can't make sense of them.

The one who has the most fun, wins!


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@tfmccarthy EXACTLY

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 311
Topic starter  

@zander

Posted by: @zander

Once the freq is found, and the modulation, then on the analysis tab the decoding you should be able to see a pattern (best in hex not bit).

Ron,

   I've found the frequency using the the SDR dongle and it's 433MHZ.  I captured the door open and close commands via the SDR dongle and Universal Radio Hacker.  URH gave me the modulation of ASK.  And I have captured the pattern of pulses for each command.  I measured the duration of each HIGH and LOW using URH. 

I've provided pictures and files of everything except the pulse durations.

I've developed a test program following the example from the Swiss guy on hacking his weather station.  I am sending the output from an UNO to a 433Mhz xmit board and capturing the signal on my SRD dongle and my laptop.  It appears that I am sending out the correct pattern, but the pulse durations are incorrect.  That's what I am messing with now. 

I am sure a big problem is my terminology. Not being a bit-head I am sure my way of explain things is confusing. 

I'll keep plugging away at my test program.  

Thanks  

Mike


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio Actually Mike that explanation is quite clear. It sounds like you will have it working following a bit of tweaking very soon. Congratulations.

For some reason I was not able to get your waveforms from URH using your test data so I was stuck.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 311
Topic starter  

@zander @tfmccarthy

I am able to broadcast a signal from the UNO that is pretty close to the pattern from the remote.  See pic.

Test3

The top is from the remote and the bottom is from the UNO.  No reaction from the door...yet.  I'll keep plugging away.

Thanks

Mike


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio I think it may be helpful to change the bottom part of each display from bits to hex. 

Screenshot 2024 12 14 at 18.29.43

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 311
Topic starter  

@zander 

Ron,  I will.  Taking a break for some wife time.


   
Ron reacted
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 311
Topic starter  

@zander @tfmccarthy

I snuck away from wife time to try something and it WORKED....sort of!  

I can open the door if I run the command string twice, so I am thinking I need to adjust the command pattern.  Every few times it will start, move a few inches, and stop.  

Bottom line is we have movement.  Now just some additional tinkering and we should have it.  


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio Congratulations!

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 8 months ago
Posts: 329
 

@huckohio

Posted by: @huckohio

I've provided pictures and files of everything except the pulse durations.

I agree with your process. I just wish I could get your URH file to match your images. But no matter, you're closing in on it. (FWIW, I was expected the signal timing was going to be the finicky part.)

The one who has the most fun, wins!


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 311
Topic starter  

@tfmccarthy @zander

Thanks for all you help/guidance on this project.  I have the door opening and closing using two push buttons and an Arduino Uno.  See vid.

I have the Nextion display updated to add the open/close buttons and the next step is to port over to my ESP32-S3.


   
Lee G reacted
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 311
Topic starter  

@tfmccarthy @zander

Here is the test code I am running on the UNO

const float DUR_S = 520; // 0.52 milliseconds
const float DUR_L = 1500;  //1.5 milliseconds

const float DUR_C = 520;   //0.52 milliseconds
const float DUR_G = 1500;   //1.5 milliseconds

const float DUR_A = 6000;       //6 milliseconds
const float DUR_B = 4000;       //4 milliseconds

#define outputPin 12

const int button1Pin = 7;
const int button2Pin = 8;


String openCommand =   "ABCLGSCLCLCLGSGSCLGSCLGSCLCLCLCLGSCL";
String closeCommand =  "ABCLGSCLCLCLGSGSGSGSCLGSCLCLCLGSCLCL";

int cmdLength = 36;

void setup() {
  Serial.begin(115200);

  pinMode(outputPin, OUTPUT);
  pinMode(button1Pin, INPUT_PULLUP);
  pinMode(button2Pin, INPUT_PULLUP);
  digitalWrite(outputPin, LOW);
  delay(100);
}

void loop() 
  {
  if (digitalRead(button1Pin) == LOW) 
    { 
    executeCommand(openCommand);
    }  

  if (digitalRead(button2Pin) == LOW) 
    { 
    executeCommand(closeCommand);
    }  
  delay(50);
  }  
  
void executeCommand(String command)
  { 
  for (int j = 0; j<5; j++)
    {
    for (int i = 0; i < command.length(); i++)
      {
      char currentChar = command[i]; // Get the current character
      switch (currentChar)
        {
        Serial.println(command[i]);  
          case 'S': //short space
            delayMicroseconds(DUR_S);
            break;
          case 'L': //long space
            delayMicroseconds(DUR_L);
            break;
          case 'C': //short pulse
            sigPulse(DUR_C);
            break;
          case 'G':  //long pulse
            sigPulse(DUR_G);
            break;
          case 'A':  //long pulse
            sigPulse(DUR_A);
            break;  
          case 'B': //long space
            delayMicroseconds(DUR_B);
            break;  
          default:
            Serial.println("Error");
            break;
          
        }  
      }  
    }   
  }


 void sigPulse(int duration) 
   {
   digitalWrite(outputPin, HIGH);
   delayMicroseconds(duration);
   digitalWrite(outputPin, LOW);
  }

   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio That looks familiar!

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Page 14 / 15